unlock
unlock copied to clipboard
Unlock.sol Gas Optimized Contract Now
Description
unlcok.sol had many require statements with Error Messages. It was making it too much gas costly. As error messages were storing a full length of strings.
So I replace those require statements with the Custom Errors. Now the contract is more gas optimized (Alhumduilah)
It's saving 162646 Gas (this is execution cost and obv the function calling gas is reduced as well)
Before Gas Optimization:
After Gas Optimization:
Issues
Fixes - Gas Optimization
Refs #9417
Checklist:
- [x] 1 PR, 1 purpose: my Pull Request applies to a single purpose
- [-] I have commented my code, particularly in hard-to-understand areas // My changes do not need those, the core is pretty self-explanatory.
- [-] I have updated the docs to reflect my changes if applicable // My changes does not needed that also
- [-] I have added tests (and stories for frontend components) that prove my fix is effective or that my feature works // My changes does not needed that aswell
- [x] I have performed a self-review of my own code
- [x] If my code involves visual changes, I am adding applicable screenshots to this thread
I hope that the Unlock Team & Community will appreciate my small contribution to this beautiful project.
Thanks, AB Dee.
Thank you for your pull request and welcome to Unlock! We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @DevABDee on file. In order for us to review and merge your code, please contact us (easiest way is to open an issue) to get yourself added.
@DevABDee Thanks a lot of for your contribution here!
However I think you need to update the tests because these are absolutely needed :)
Thank you for your pull request and welcome to Unlock! We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @DevABDee on file. In order for us to review and merge your code, please contact us (easiest way is to open an issue) to get yourself added.
Thank you for your pull request and welcome to Unlock! We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @DevABDee on file. In order for us to review and merge your code, please contact us (easiest way is to open an issue) to get yourself added.
@DevABDee Thanks a lot for your contribution here!
However I think you need to update the tests because these are absolutely needed :)
Hey @julien51, Thanks for reviewing.
Actually, all the unit tests are clear (and they should be because the changes I made it's just a replacement & enhancement of simple pieces of code.) So there is no need of test updates i think.
The only problem is that the Bot is not allowing me xD
See this:
The Bot is responding this:
Thank you for your pull request and welcome to Unlock! We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @DevABDee on file. In order for us to review and merge your code, please contact us (easiest way is to open an issue) to get yourself added.
I have no idea what should I do to get added to the list. I have already opened issue #9417 & Read the CLA. So pls guide me and add me to the contributors' list. Thanks
Thank you for your pull request and welcome to Unlock! We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @DevABDee on file. In order for us to review and merge your code, please contact us (easiest way is to open an issue) to get yourself added.
Thank you for your pull request and welcome to Unlock! We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @DevABDee on file. In order for us to review and merge your code, please contact us (easiest way is to open an issue) to get yourself added.
/rebase
/run-all-tests
results are visible here https://github.com/unlock-protocol/unlock/actions/runs/2882347987
Cool work @DevABDee ~ thanks for this ! I like the prefix on custom errors and may actually keep for other contracts
Finally!!!!! :D
Finally!!!!! :D
Aug 3, 2022...