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: 15/126
Findings: 3
Award: $434.83
🌟 Selected for report: 0
🚀 Solo Findings: 0
389.9867 USDC - $389.99
https://github.com/code-423n4/2022-08-fiatdao/blob/main/contracts/features/Blocklist.sol#L37
In order to avoid being blocked, a malicious contracts can frontrun the block()
function by calling selfdestruct()
.
The selfdestruct(address)
function ejects the ether to the set address and wipes the contract's bytecode, which makes the block function revert. The contract can resurrect back to the same address as long as it uses CREATE2
with the same parameters as it's original deployment (assuming it was initially deployed using the same function), sandwiching the blocklist function call.
Note that the contract doesn't lose the lock nor it's delegation in the process.
block()
is called, but this function returns falseblock()
fails due to the requirement check hereCode reading
#0 - bahurum
2022-08-16T20:42:57Z
Duplicate of #168
#1 - lacoop6tu
2022-08-17T09:48:50Z
Duplicate of #168
#2 - gititGoro
2022-08-31T02:11:48Z
Duplicate of #75
🌟 Selected for report: oyc_109
Also found by: 0x1f8b, 0x52, 0xDjango, 0xLovesleep, 0xNazgul, 0xNineDec, 0xbepresent, 0xmatt, 0xsolstars, Aymen0909, Bahurum, Bnke0x0, CertoraInc, Chom, CodingNameKiki, DecorativePineapple, Deivitto, Dravee, ElKu, Funen, GalloDaSballo, IllIllI, JC, JohnSmith, Junnon, KIntern_NA, Lambda, LeoS, MiloTruck, Noah3o6, PaludoX0, RedOneN, Respx, ReyAdmirado, Rohan16, RoiEvenHaim, Rolezn, Ruhum, Sm4rty, TomJ, Vexjon, Waze, Yiko, __141345__, a12jmx, ajtra, ak1, apostle0x01, asutorufos, auditor0517, bin2chen, bobirichman, brgltd, bulej93, byndooa, c3phas, cRat1st0s, cryptphi, csanuragjain, d3e4, defsec, delfin454000, djxploit, durianSausage, ellahi, erictee, exd0tpy, fatherOfBlocks, gogo, jonatascm, ladboy233, medikko, mics, natzuu, neumo, p_crypt0, paribus, pfapostol, rbserver, reassor, ret2basic, robee, rokinot, rvierdiiev, sach1r0, saneryee, seyni, sikorico, simon135, sseefried, wagmi, wastewa
29.8918 USDC - $29.89
Both contract's constructors are missing zero address checks for their deployment.
🌟 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.9461 USDC - $14.95
immutable
keywordThe LockedBalance
struct can consume 3 storage slots instead of 4 with the following ordering: {int128,int128,uint256,address}
payable
keyworduEpoch + 1
should be saved in a local variable in order to save gasx = x + y
is a more efficient operation than x += y
#L418 #L420 #L460-L461 #L465 #L472 #L603 #L654
++i
for loop increments rather than i++