Platform: Code4rena
Start Date: 14/11/2021
Pot Size: $30,000 USDC
Total HM: 7
Participants: 13
Period: 3 days
Judge: leastwood
Total Solo HM: 4
Id: 57
League: ETH
Rank: 5/13
Findings: 3
Award: $1,086.58
🌟 Selected for report: 2
🚀 Solo Findings: 0
🌟 Selected for report: WatchPug
Also found by: 0x0x0x, Meta0xNull, fatima_naz, gzeon, ksk2345
925.536 USDC - $925.54
Meta0xNull
governance = _guardian
The Guardian will become Governance of the Contract which is Not Expected. Original Governance will lose control of this contract if they call setGuardian() with Address/Key beyong their control.
https://github.com/Badger-Finance/badger-ibbtc-utility-zaps/blob/6f700995129182fec81b772f97abab9977b46026/contracts/IbbtcVaultZap.sol#L116-L119 https://github.com/Badger-Finance/badger-ibbtc-utility-zaps/blob/a5c71b72222d84b6414ca0339ed1761dc79fe56e/contracts/SettToRenIbbtcZap.sol#L130-L133
Manual Review
Before: governance = _guardian;
After: guardian = _guardian;
#0 - GalloDaSballo
2021-11-17T14:42:31Z
Agree with the finding, we fixed it before deployment
#1 - 0xleastwood
2021-12-09T12:11:04Z
duplicate of #51
🌟 Selected for report: Meta0xNull
Meta0xNull
The Pool size is known which is 0 to 3. Thus, SLOAD pools.length for Every Loop is Waste of Gas
Manual Review
Before: for (uint i = 0; i < pools.length; i++)
After: for (uint i = 0; i < 4; i++)
#0 - GalloDaSballo
2021-11-17T16:49:18Z
Agree with finding
🌟 Selected for report: Meta0xNull
Meta0xNull
The local variable used as for loop index need not be initialized to 0 because the default value is 0. Avoiding this anti-pattern can save a few opcodes and therefore a tiny bit of gas.
https://github.com/Badger-Finance/badger-ibbtc-utility-zaps/blob/6f700995129182fec81b772f97abab9977b46026/contracts/IbbtcVaultZap.sol#L149 https://github.com/Badger-Finance/ibbtc/blob/d8b95e8d145eb196ba20033267a9ba43a17be02c/contracts/Zap.sol#L70
Manual Review
Remove explicit 0 initialization of for loop index variable.
Before: for (uint256 i = 0;
After for (uint256 i;
#0 - GalloDaSballo
2021-11-17T16:49:07Z
Agree with finding