Platform: Code4rena
Start Date: 28/06/2022
Pot Size: $25,000 USDC
Total HM: 14
Participants: 50
Period: 4 days
Judge: GalloDaSballo
Total Solo HM: 7
Id: 141
League: ETH
Rank: 30/50
Findings: 2
Award: $64.94
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: zzzitron
Also found by: 0v3rf10w, 0x1f8b, 0x29A, AlleyCat, Bnke0x0, Chom, Funen, JC, Lambda, Limbooo, Meera, Picodes, Sm4rty, TerrierLover, TomJ, __141345__, asutorufos, aysha, c3phas, cccz, defsec, fatherOfBlocks, grGred, hake, ignacio, ladboy233, mrpathfindr, oyc_109, rfa, sach1r0, samruna, slywaters, ynnad
43.1396 USDC - $43.14
Proof of Concept
Instances:
BaseJumpRateModelV2.sol -> pragma solidity ^0.8.10; CDaiDelegate.sol -> pragma solidity ^0.8.10; CErc20.sol -> pragma solidity ^0.8.10; CErc20Delegate.sol -> pragma solidity ^0.8.10; CErc20Delegator.sol -> pragma solidity ^0.8.10; CErc20Immutable.sol -> pragma solidity ^0.8.10; CEther.sol -> pragma solidity ^0.8.10; CNote.sol -> pragma solidity ^0.8.10; Comptroller.sol -> pragma solidity ^0.8.10; ComptrollerG7.sol -> pragma solidity ^0.8.10; ComptrollerInterface.sol -> pragma solidity ^0.8.10; ComptrollerStorage.sol -> pragma solidity ^0.8.10; CToken.sol -> pragma solidity ^0.8.10; CTokenInterfaces.sol -> pragma solidity ^0.8.10; DAIInterestRateModelV3.sol -> pragma solidity ^0.8.10; EIP20Interface.sol -> pragma solidity ^0.8.10; EIP20NonStandardInterface.sol -> pragma solidity ^0.8.10; ERC20.sol -> pragma solidity ^0.8.10; WETH.sol -> pragma solidity ^0.8.10; WhitePaperInterestRateModel.sol -> pragma solidity ^0.8.10;
Mitigation:
Do:
pragma solidity 0.8.10;
instead of
pragma solidity ^0.8.0;
#0 - GalloDaSballo
2022-08-13T23:30:55Z
1 NC
🌟 Selected for report: 0x1f8b
Also found by: 0x29A, 0xArshia, 0xKitsune, Bnke0x0, Chom, Fitraldys, Funen, JC, Lambda, Meera, Noah3o6, Picodes, RedOneN, Rohan16, Sm4rty, TerrierLover, TomJ, Tomio, Waze, ajtra, c3phas, cRat1st0s, defsec, durianSausage, fatherOfBlocks, grGred, hake, ladboy233, m_Rassska, mrpathfindr, oyc_109, rfa, ynnad
21.8032 USDC - $21.80
Proof of Concept
Instances Include:
Mitigation:
Use ++i
instead of i++
Proof of Concept
Instances Include:
Mitigation:
Caching the array length outside a loop saves reading it on each iteration, as long as the array's length is not changed during the loop.
Do:
uint256 len = array.length for (uint256 i = 0; i < len; i++) { // do something }
Instead of
for (uint256 i = 0; i < array.length; i++) { //do something }
Proof of Concept
Instances Include:
Mitigation:
DO:
if (amountToSubtract != 0) { ///do something }
Instead of:
if (amountToSubtract > 0) { ///do something }
#0 - GalloDaSballo
2022-08-14T21:00:30Z
Less than 100 gas