Platform: Code4rena
Start Date: 06/09/2022
Pot Size: $90,000 USDC
Total HM: 33
Participants: 168
Period: 9 days
Judge: GalloDaSballo
Total Solo HM: 10
Id: 157
League: ETH
Rank: 166/168
Findings: 1
Award: $45.41
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: pfapostol
Also found by: 0x1f8b, 0x4non, 0x5rings, 0xA5DF, 0xSmartContract, 0xc0ffEE, 0xkatana, Aymen0909, Bnke0x0, CertoraInc, Chandr, CodingNameKiki, Cr4ckM3, Deivitto, DimSon, Franfran, JAGADESH, JC, Jeiwan, Lambda, LeoS, Matin, Metatron, Migue, MiloTruck, PPrieditis, PaludoX0, R2, RaymondFam, Respx, ReyAdmirado, Rolezn, Saintcode_, Samatak, SnowMan, StevenL, Tointer, TomJ, Tomo, WatchDogs, Waze, _Adam, __141345__, ajtra, asutorufos, ballx, brgltd, bulej93, c3phas, ch0bu, dharma09, djxploit, durianSausage, easy_peasy, fatherOfBlocks, gianganhnguyen, gogo, imare, leosathya, lucacez, martin, oyc_109, pauliax, peiw, prasantgupta52, ret2basic, rfa, robee, sikorico, simon135, tofunmi, volky, wagmi, zishansami
45.4138 USDC - $45.41
Findings: Use assembly when getting a contract’s balance of eth Code: src/auction/Auction.sol - line 346 Explanation Non-critical gas optimisation. You can use selfbalance() instead of address(this).balance when getting your contract’s balance of ETH to save gas. ---- Findings: Using private rather than public for constants, saves gas Code: src/governance/governor/Governor.sol - line 27 Explanation: If needed, the value can be read from the verified contract source code. ---- Findings: It costs more gas to initialize non-constant/non-immutable variables to zero than to let the default of zero be applied. Code: src/governance/treasury/Treasure.sol - line 162 src/token/metadata/MetadataRenderer.sol - line 119, line 136, line 193, line 234 Explanation: for (uint256 i = 0; i < numTargets; ++i) { Use instead for (uint256 i; i < numTargets; ++i) { ---- Findings: Empty blocks should be removed or emit something (external receive & fallback) Code: src/governance/treasury/Treasure.sol - line 269 Explanation: The code should be refactored such that they no longer exist, or the block should do something useful, such as emitting an event or reverting. Mitigation: Either remove, or implement an emit event. ---- Findings: Multiplication/division by two should use bit shifting Code: src/lib/token/ERC721Votes.sol Explanation: <x> * 2 is equivalent to <x> << 1 and <x> / 2 is the same as <x> >> 1. The MUL and DIV opcodes cost 5 gas, whereas SHL and SHR only cost 3 gas. DIVISION BY TWO SHOULD USE BIT SHIFTING. Given this is an openzeppelin library modification is at the developers discretion. Mitigation: Use Bit Shifting.
#0 - GalloDaSballo
2022-09-26T14:55:41Z
Less than 50 gas