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

QA Report #157

Open
liveactionllama opened this issue Jun 22, 2022 · 2 comments
Open

QA Report #157

liveactionllama opened this issue Jun 22, 2022 · 2 comments
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons valid

Comments

@liveactionllama
Copy link
Contributor

__

I recommend to set

line 117

uint256 length = tokens.length; to

uint256 tokensLength = tokens.length;

this will ofcourse also set 

line 118 to

for(uint i = 0; i < tokensLength; i++)

this will provide better general clarity in line with other consistency factors of, 

for example

line 175

of the AuraLocker.sol contract where as it is

uint256 rewardTokensLength = rewardTokens.length;

instead of 

uint256 length = rewardTokens.length;

__

For consistency in line with code of for loop

line 153

for (uint256 i; i < numRewards; ++i)

I recommend to also set other for loops to also implement code structure

line 118

change the uint i = 0; to uint256 i;

line 300
line 317

change the uint256 i = 0; to uint256 i;

Result

for(uint256 i; i < length; i++)

for (uint256 i; i < _claims.length; i++)

for (uint256 i; i < _claims.length; i++)
@liveactionllama liveactionllama added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels Jun 22, 2022
@liveactionllama
Copy link
Contributor Author

On June 18 at 18:19, warden reached out via C4 help request to let us know that they accidentally submitted this to the wrong contest. Since we received their message prior to the contest closing, adding their submission here. Will notify sponsor and judge as well.

liveactionllama added a commit that referenced this issue Jun 22, 2022
@GalloDaSballo
Copy link
Collaborator

These are valid gas optimizations, savings is 3 gas per length cached and 3 gas for not initializing the iterator

@GalloDaSballo GalloDaSballo added the sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons label Jun 22, 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 QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons valid
Projects
None yet
Development

No branches or pull requests

3 participants