Platform: Code4rena
Start Date: 12/08/2022
Pot Size: $35,000 USDC
Total HM: 10
Participants: 126
Period: 3 days
Judge: Justin Goro
Total Solo HM: 3
Id: 154
League: ETH
Rank: 122/126
Findings: 1
Award: $14.95
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x040, 0x1f8b, 0xDjango, 0xHarry, 0xLovesleep, 0xNazgul, 0xNineDec, 0xSmartContract, 0xackermann, 0xbepresent, 2997ms, Amithuddar, Aymen0909, Bnke0x0, CRYP70, CertoraInc, Chom, CodingNameKiki, Deivitto, Dravee, ElKu, Fitraldys, Funen, GalloDaSballo, JC, JohnSmith, Junnon, LeoS, Metatron, MiloTruck, Noah3o6, NoamYakov, PaludoX0, RedOneN, Respx, ReyAdmirado, Rohan16, Rolezn, Ruhum, Sm4rty, SooYa, SpaceCake, TomJ, Tomio, Waze, Yiko, __141345__, a12jmx, ajtra, ak1, apostle0x01, asutorufos, bobirichman, brgltd, bulej93, c3phas, cRat1st0s, carlitox477, chrisdior4, csanuragjain, d3e4, defsec, delfin454000, djxploit, durianSausage, ellahi, erictee, fatherOfBlocks, gerdusx, gogo, ignacio, jag, ladboy233, m_Rassska, medikko, mics, natzuu, newfork01, oyc_109, paribus, pfapostol, rbserver, reassor, ret2basic, robee, rokinot, rvierdiiev, sach1r0, saian, sashik_eth, sikorico, simon135
14.9459 USDC - $14.95
!= 0
instead of > 0
for Unsigned Integer ComparisonBlocklist.sol::42 => return size > 0; VotingEscrow.sol::176 => if (delegatee != _addr && value > 0) { VotingEscrow.sol::236 => if (_oldLocked.end > block.timestamp && _oldLocked.delegated > 0) { VotingEscrow.sol::244 => if (_newLocked.end > block.timestamp && _newLocked.delegated > 0) { VotingEscrow.sol::288 => if (epoch > 0) { VotingEscrow.sol::412 => require(_value > 0, "Only non zero amount"); VotingEscrow.sol::448 => require(_value > 0, "Only non zero amount"); VotingEscrow.sol::449 => require(locked_.amount > 0, "No lock"); VotingEscrow.sol::469 => require(locked_.amount > 0, "Delegatee has no lock"); VotingEscrow.sol::502 => require(locked_.amount > 0, "No lock"); VotingEscrow.sol::529 => require(locked_.amount > 0, "No lock"); VotingEscrow.sol::564 => require(locked_.amount > 0, "No lock"); VotingEscrow.sol::587 => require(toLocked.amount > 0, "Delegatee has no lock"); VotingEscrow.sol::621 => if (newLocked.amount > 0) { VotingEscrow.sol::635 => require(locked_.amount > 0, "No lock");
It is cheaper to deal with unsigned integers by using != 0
than > 0
.
VotingEscrow.sol::719 => uint256 mid = (min + max + 1) / 2; VotingEscrow.sol::743 => uint256 mid = (min + max + 1) / 2;
It costs cheaper to use >> 1
instead of dividing by 2.
Blocklist.sol::2 => pragma solidity ^0.8.3; IBlocklist.sol::2 => pragma solidity ^0.8.3; IERC20.sol::2 => pragma solidity ^0.8.3; IERC20Permit.sol::4 => pragma solidity ^0.8.3; IVotingEscrow.sol::2 => pragma solidity ^0.8.3; VotingEscrow.sol::2 => pragma solidity ^0.8.3;
It is suggested to use a concrete compiler version. This is because a new version compiler may be vulnerable and cause fall back in older version of compiler.