Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gas Optimized Semaphore.sol #113

Merged
merged 1 commit into from
Jul 25, 2022
Merged

Gas Optimized Semaphore.sol #113

merged 1 commit into from
Jul 25, 2022

Conversation

TradMod
Copy link
Contributor

@TradMod TradMod commented Jul 25, 2022

Description

Semaphore.sol had some require statements. It was making it too much gas costly. As error messages were storing a full length of strings. So I just replace those require statements with the custom errors. Now the contract is more gas optimized (Alhumduilah)

Related Issue

Semaphore.sol is not much Gas Optimized. #112

Does this introduce a breaking change?

  • Yes
  • No, It's just an enhancement.

Other information

Check this post out for more info: https://ethereum.stackexchange.com/questions/101782/requirecondition-message-vs-revert-with-a-custom-error-which-is-better-a

Before (adding Custome errors):

beforeSemaphora
beforeSemaphora2

After (adding Custome errors):

afterSemaphora
afterSemaphora2

I hope that the Semaphore Community will appreciate my small contribution to this wonderful project.
Thanks,

AB Dee

Copy link
Member

@cedoor cedoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @DevABDee for your contribution 👍🏽 Really appreciated!

@cedoor cedoor added the performance 📈 A code change that improves the performance label Jul 25, 2022
@cedoor cedoor linked an issue Jul 25, 2022 that may be closed by this pull request
@cedoor cedoor merged commit 92c3b59 into semaphore-protocol:main Jul 25, 2022
0xjei added a commit that referenced this pull request Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance 📈 A code change that improves the performance
Projects
No open projects
Status: ✔️ Done
Development

Successfully merging this pull request may close these issues.

Semaphore.sol is not much Gas Optimized.
2 participants