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

Adding unchecked directive can save gas #27

Open
code423n4 opened this issue Oct 13, 2021 · 2 comments
Open

Adding unchecked directive can save gas #27

code423n4 opened this issue Oct 13, 2021 · 2 comments
Labels
bug Warden finding duplicate Another warden found this issue G (Gas Optimization) sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")

Comments

@code423n4
Copy link
Contributor

Handle

WatchPug

Vulnerability details

For the arithmetic operations that will never over/underflow, using the unchecked directive (Solidity v0.8 has default overflow/underflow checks) can save some gas from the unnecessary internal over/underflow checks.

For example:

code423n4 added a commit that referenced this issue Oct 13, 2021
@CalabashSquash CalabashSquash added the duplicate Another warden found this issue label Oct 17, 2021
@CalabashSquash
Copy link
Collaborator

Duplicate of #34

Although #27 does provide more in-depth examples.

@CalabashSquash CalabashSquash added the sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") label Oct 17, 2021
@GalloDaSballo
Copy link
Collaborator

Agree with finding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Warden finding duplicate Another warden found this issue G (Gas Optimization) sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Projects
None yet
Development

No branches or pull requests

3 participants