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

[BUG BOUNTY] [Gas Optimization] Use custom errors instead of revert strings to save gas. #73

Closed
Sechunt3r opened this issue Dec 6, 2022 · 0 comments · Fixed by #90
Closed
Labels
bug Something isn't working

Comments

@Sechunt3r
Copy link

Sechunt3r commented Dec 6, 2022

Vulnerable URL: https://github.com/masa-finance/masa-contracts-identity/blob/main/contracts/SoulLinker.sol

Description:
Well, the contract SoulLinker has a solidity version of 0.8.7 and uses a lot of require statements for errors. But a solidity version that is greater than 0.8.4 can use custom errors to save gas. In this contract
the require statement use more gas per iteration. Instead of using strings for error messages, you can use custom
errors to reduce both deployment and runtime gas costs. In addition, they are very convenient as you can easily pass
dynamic information to them. By this, you can save a lot of gas.

┆Issue is synchronized with this Jira Bug by Unito

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants