Platform: Code4rena
Start Date: 27/01/2022
Pot Size: $75,000 USDC
Total HM: 10
Participants: 26
Period: 7 days
Judge: pauliax
Total Solo HM: 5
Id: 81
League: ETH
Rank: 21/26
Findings: 2
Award: $70.45
π Selected for report: 0
π Solo Findings: 0
47.4141 USDC - $47.41
robee
Users can mistakenly think that the return value is the named return, but it is actually the actualreturn statement that comes after. To know that the user needs to read the code and is confusing. Furthermore, removing either the actual return or the named return will save gas.
Bitmap.sol, getMSB SafeInt256.sol, subNoNeg SafeInt256.sol, neg LibStorage.sol, _getStorageSlot Bitmap.sol, getNextBitNum
#0 - jeffywu
2022-02-06T14:58:29Z
Should be Non Critical
#1 - pauliax
2022-02-13T09:55:34Z
No vulnerability. Even though this issue does not talk about the gas savings, I will do a favor for the warden and group this together with #95
23.0433 USDC - $23.04
robee
Prefix increments are cheaper than postfix increments.
Further more, using unchecked {++x} is even more gas efficient, and the gas saving accumulates every iteration and can make a real change
There is no risk of overflow caused by increamenting the iteration index in for loops (the ++i
in for (uint256 i = 0; i < numIterations; ++i)
).
But increments perform overflow checks that are not necessary in this case.
change to prefix increment and unchecked: TreasuryAction.sol, i, 157
#0 - jeffywu
2022-02-06T15:00:44Z
Duplicate #228
#1 - pauliax
2022-02-13T10:37:06Z
#228