We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Since the loop's variable can't overflow in most circumstances, you can safe gas by incrementing it inside a unchecked block:
unchecked
for (uint i; i < length;) { unchecked { ++i; } }
e.g.
In the ETHRegistraryController contract, you allow the user to pay more than necessary for the registration. Any surplus amount is then refunded.
If you force the user to pay the exact amount, you can remove the refund logic and thus save gas.
The text was updated successfully, but these errors were encountered:
Ruhum issue #53
80eb4d7
G-02: Don't allow the user to send more ETH than necessary allows you to remove the refund logic
Intended behavior because the amount of ETH varies based on the oracle.
Sorry, something went wrong.
No branches or pull requests
Gas Report
G-01: use unchecked when incrementing the loop's variable
Since the loop's variable can't overflow in most circumstances, you can safe gas by incrementing it inside a
unchecked
block:e.g.
G-02: Don't allow the user to send more ETH than necessary allows you to remove the refund logic
In the ETHRegistraryController contract, you allow the user to pay more than necessary for the registration. Any surplus amount is then refunded.
If you force the user to pay the exact amount, you can remove the refund logic and thus save gas.
The text was updated successfully, but these errors were encountered: