Badger-Vested-Aura contest - a12jmx's results

Bringing BTC to DeFi

General Information

Platform: Code4rena

Start Date: 15/06/2022

Pot Size: $30,000 USDC

Total HM: 5

Participants: 55

Period: 3 days

Judge: Jack the Pug

Id: 138

League: ETH

BadgerDAO

Findings Distribution

Researcher Performance

Rank: 39/55

Findings: 1

Award: $53.62

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

53.6173 USDC - $53.62

Labels

bug
QA (Quality Assurance)
sponsor acknowledged
valid

External Links

__

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++)

#0 - liveactionllama

2022-06-22T16:07:13Z

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.

#1 - GalloDaSballo

2022-06-22T16:23:04Z

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

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter