Platform: Code4rena
Start Date: 26/09/2022
Pot Size: $50,000 USDC
Total HM: 13
Participants: 113
Period: 5 days
Judge: 0xean
Total Solo HM: 6
Id: 166
League: ETH
Rank: 107/113
Findings: 1
Award: $24.02
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x1f8b, 0x5rings, 0xNazgul, 0xRoxas, 0xSmartContract, 0xbepresent, 0xmatt, Aeros, Amithuddar, Awesome, Aymen0909, B2, Bnke0x0, ChristianKuri, CodingNameKiki, Deivitto, Diraco, Fitraldys, HardlyCodeMan, JC, Mukund, Noah3o6, Olivierdem, RaymondFam, ReyAdmirado, RockingMiles, Rolezn, Ruhum, Saintcode_, Shinchan, SnowMan, TomJ, Tomio, Tomo, V_B, Waze, __141345__, ajtra, asutorufos, aysha, beardofginger, bobirichman, brgltd, bulej93, c3phas, ch0bu, cryptonue, defsec, delfin454000, dharma09, durianSausage, emrekocak, erictee, fatherOfBlocks, francoHacker, gianganhnguyen, gogo, imare, kaden, karanctf, ladboy233, lukris02, m_Rassska, martin, medikko, mics, natzuu, oyc_109, peiw, rbserver, ret2basic, rotcivegaf, saian, shark, slowmoses, tnevler, trustindistrust, zeesaw, zishansami
24.0179 USDC - $24.02
require()
statements with custom errorsIntroduced in v0.8.4, Custom errors are a more gas-efficient way to throw an error. Note: Must be v0.8.4 or higher
++i
is more efficient than i++
++i
saves 5 gas compared to i++
, This is because i++
increments a value and returns the old value, Doing so holds two numbers in memory. ++i
only ever uses one number in memory.
Lines Found:
DataStorage.sol
: Line 307
FullMath.sol
: Line 122
Variables if not initialized are by default set to zero, false, etc.
Lines Affected:
AlgebraPool.sol
: Line 774
DataStorage.sol
: Line 307
TickMath.sol
Line 71
!= 0
is more gas efficient compared to > 0
!= 0
costs about 6 less gas compared to > 0
Here is an example: Lines 505-506 in AlgebraPool.sol
can both replace > 0
with != 0