Platform: Code4rena
Start Date: 11/11/2022
Pot Size: $36,500 USDC
Total HM: 5
Participants: 62
Period: 3 days
Judge: berndartmueller
Id: 181
League: ETH
Rank: 60/62
Findings: 1
Award: $22.22
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: ReyAdmirado
Also found by: 0x4non, 0xRoxas, 0xab00, Awesome, Aymen0909, Bnke0x0, Deivitto, Diana, IllIllI, Rahoz, RaymondFam, Rolezn, Sathish9098, ajtra, aphak5010, aviggiano, c3phas, carlitox477, ch0bu, cryptostellar5, erictee, lukris02, martin, rotcivegaf, saian, shark, trustindistrust, zaskoh
22.2155 USDC - $22.22
Instead of using the shorthand of addition/subtraction assignment operators (+=
, -=
)
it costs less to remove the shorthand (x += y
same as x = x+y
) saves ~22 gas
There are 6 instances of this issue:
Line 316, Line 601, Line 74, Line 574, Line 46, Line 73
A function with access control marked as payable will be cheaper for legitimate callers: the compiler removes checks for msg.value
, saving approximately 20
gas per function call.
There are 2 instances of this issue:
Storage
Variables in Memory
To Save GasAnytime you are reading from storage
more than once, it is cheaper in gas cost to cache the variable in memory
: a SLOAD
cost 100gas, while MLOAD
and MSTORE
cost 3 gas.
Gas savings: at least 97 gas.
There is 1 instance of this issue:
public/external function names and public member variable names can be optimized to save gas. See this link for an example of how it works. Below are the interfaces/abstract contracts that can be optimized so that the most frequently-called functions use the least amount of gas possible during method lookup. Method IDs that have two leading zero bytes can save 128 gas each during deployment, and renaming functions to have lower method IDs will save 22 gas per call, per sorted position shifted
#0 - c4-judge
2022-11-17T14:10:11Z
berndartmueller marked the issue as grade-b