Platform: Code4rena
Start Date: 15/06/2022
Pot Size: $35,000 USDC
Total HM: 1
Participants: 36
Period: 3 days
Judge: Jack the Pug
Total Solo HM: 1
Id: 137
League: ETH
Rank: 28/36
Findings: 1
Award: $40.25
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x1f8b, 0xKitsune, 0xNazgul, 0xkatana, Chom, ElKu, JC, Meera, MiloTruck, Picodes, PierrickGT, SooYa, TerrierLover, UnusualTurtle, Waze, _Adam, asutorufos, c3phas, delfin454000, fatherOfBlocks, joestakey, minhquanym, oyc_109, robee, sach1r0, simon135
40.2482 USDC - $40.25
Examples of this issue in the codebase:
The local variable used for the 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.
Examples of this issue in the codebase:
using the prefix increment/decrement operators (++i/--i) cost less gas PER LOOP than the postfix increment/decrement operators (i++/i--)
Examples of this issue in the codebase:
In Solidity 0.8+, there’s a default overflow check on unsigned integers. It’s possible to uncheck this in for-loops and save some gas at each iteration, but at the cost of some code readability, as this uncheck cannot be made inline.
Examples of this issue in the codebase:
Custom errors from Solidity 0.8.4 are cheaper than revert strings (cheaper deployment cost and runtime cost when the revert condition is met).
Custom errors are defined using the error
statement, which can be used inside and outside of contracts (including interfaces and libraries).
#0 - maximebrugel
2022-06-24T14:28:20Z
#6 (see comment)
#1 - Yashiru
2022-06-24T15:47:35Z
Duplicated of #2 at For loop optimizaion
Duplicated of #2 at For loop optimizaion
Duplicated of #2 at For loop optimizaion