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 #199

Open
code423n4 opened this issue Mar 30, 2022 · 1 comment
Open

Gas Optimizations #199

code423n4 opened this issue Mar 30, 2022 · 1 comment
Assignees
Labels
bug Something isn't working G (Gas Optimization) resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix)

Comments

@code423n4
Copy link
Contributor

Prefix increments are cheaper than postfix increments.

Handle

tchkvsky

Vulnerability details

These functions use not using prefix increments (++x)

Impact

Using prefix increment is more gas efficient

Proof of Concept

DexManagerFacet.sol

#L33

#L52

#L65

Swapper.sol

#L14

Tools Used

Manual review

Recommendation

Consider using prefix increments (++i) to save gas

@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Mar 30, 2022
code423n4 added a commit that referenced this issue Mar 30, 2022
@H3xept H3xept self-assigned this Apr 1, 2022
@H3xept
Copy link
Collaborator

H3xept commented Apr 1, 2022

We internally decided to ignore prefix increments for now.

@H3xept H3xept closed this as completed Apr 1, 2022
@H3xept H3xept added the resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) label Apr 11, 2022
@H3xept H3xept reopened this Apr 11, 2022
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) resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix)
Projects
None yet
Development

No branches or pull requests

2 participants