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 Optimizations #432

Open
code423n4 opened this issue Jul 14, 2023 · 3 comments
Open

Gas Optimizations #432

code423n4 opened this issue Jul 14, 2023 · 3 comments
Labels
bug Something isn't working G (Gas Optimization) G-06 grade-a 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

See the markdown file with the details of this report here.

@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Jul 14, 2023
code423n4 added a commit that referenced this issue Jul 14, 2023
code423n4 added a commit that referenced this issue Jul 14, 2023
@c4-judge
Copy link
Contributor

Picodes marked the issue as grade-a

@c4-sponsor
Copy link

asselstine marked the issue as sponsor confirmed

@c4-sponsor c4-sponsor added the sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") label Jul 20, 2023
@C4-Staff C4-Staff added the G-06 label Aug 15, 2023
@PierrickGT
Copy link
Member

G-01: we are using Solidity 0.8.19, looks like contract existence is not checked anymore, so no need to use a low level call.
G-02: constants can't be private.
G-03: no need to mark functions payables if they are not.
G-04, 08, 12, 14, 19, 20, 21, 22, 23, 24, 25, 26: we would lose in code clarity.
G-05: checked by safeTransfer
G-06: we would need to pass ringBufferInfo to a require function, which will increase gas consumption since it won't be inline anymore.
G-07, 18: does not save any gas
G-09: we assign in the second case, so no multiple accesses here
G-10: has been fixed for the Vault. For the PrizePool, we need to pass values.
G-11: we can't use abi.encodePacked
G-13: we don't calculate anything here.
G-15, 16, 17: has been fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working G (Gas Optimization) G-06 grade-a 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

5 participants