Platform: Code4rena
Start Date: 12/09/2022
Pot Size: $75,000 USDC
Total HM: 19
Participants: 110
Period: 7 days
Judge: HardlyDifficult
Total Solo HM: 9
Id: 160
League: ETH
Rank: 57/110
Findings: 2
Award: $117.69
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: Lambda
Also found by: 0x1f8b, 0x4non, 0x52, 0x5rings, 0xDanielC, 0xNazgul, 0xSmartContract, 0xbepresent, Anth3m, Aymen0909, B2, CRYP70, CertoraInc, Ch_301, Chom, ChristianKuri, CodingNameKiki, Deivitto, Funen, JC, JansenC, Jeiwan, KIntern_NA, MasterCookie, MiloTruck, Olivierdem, PaludoX0, R2, RaymondFam, ReyAdmirado, StevenL, The_GUILD, Tomo, Trust, V_B, __141345__, asutorufos, ayeslick, bin2chen, brgltd, bulej93, c3phas, cccz, ch0bu, cryptphi, csanuragjain, d3e4, delfin454000, djxploit, erictee, fatherOfBlocks, gogo, hansfriese, indijanc, ladboy233, leosathya, lukris02, malinariy, martin, pedr02b2, pfapostol, rvierdiiev, slowmoses, smiling_heretic, tnevler, wagmi
82.3373 USDC - $82.34
Event is missing indexed fields - Each event should use three indexed fields if there are three or more fields. Found in ./contracts/crowdfund/BuyCrowdfundBase.sol, line 52 : event Won(Party party, IERC721 token, uint256 tokenId, uint256 settledPrice)
Return values of transferFrom() not checked - Not all implementations revert when there's a failure in transferFrom(). The function signature has a boolean return value and they indicate errors that way instead. By not checking the return value, operations that should have marked as failed, may potentially go through without actually making a payment. Mitigation: Check the return value of transferFrom()
Unused receive() function - If the intention is for the Ether to be used, the function should call another function, otherwise it should revert. Found line 144 of ./contracts/crowdfund/AuctionCrowdfund.sol and in ./contracts/party/Party.sol.
Several Todos left in the code - The code still has some todos, which should be resolved before production, recommend checking and fixing or remove the todos Found in CrownfundNFTRendere.sol, DummyERC721Renderer.sol and PartyGovernanceNFTRenderer.sol
Use a more recent version of Solidity - Use a solidity version of at least 0.8.4 to get bytes.concat() instead of abi.encodePacked(<bytes>, <bytes>). - Use a solidity version of at least 0.8.12 to get string.concat() instead of abi.encodePacked(<str>, <str>). Found in ./contracts/renderers/CrowdfundNFTRenderer.sol, line 28
#0 - 0xble
2022-09-26T02:22:37Z
Unhelpful bot response, the safeTransferFrom()
doesn't make sense because the instances we use transferFrom()
we know with certainty that the NFT can be received.
🌟 Selected for report: CertoraInc
Also found by: 0x1f8b, 0x4non, 0x5rings, 0x85102, 0xNazgul, 0xSmartContract, 0xkatana, Amithuddar, Aymen0909, B2, Bnke0x0, CRYP70, Chom, ChristianKuri, CodingNameKiki, Deivitto, Diraco, Fitraldys, Funen, IgnacioB, JAGADESH, JC, Lambda, LeoS, Matin, Metatron, MiloTruck, Noah3o6, Ocean_Sky, Olivierdem, PaludoX0, RaymondFam, ReyAdmirado, Rohan16, Rolezn, Saintcode_, Sm4rty, SnowMan, StevenL, Tomio, Tomo, V_B, Waze, __141345__, ajtra, asutorufos, aysha, brgltd, bulej93, c3phas, ch0bu, d3e4, delfin454000, dharma09, djxploit, erictee, fatherOfBlocks, francoHacker, gianganhnguyen, gogo, got_targ, ignacio, jag, karanctf, ladboy233, leosathya, lukris02, m_Rassska, malinariy, martin, natzuu, pashov, peanuts, peiw, pfapostol, prasantgupta52, robee, simon135, slowmoses, sryysryy, tnevler
35.3489 USDC - $35.35
1. Use '++i'; instead of 'i++' to save gas (found line 62 of ./contracts/crowdfund/CollectionBuyCrowdfund.sol). 2. Use "!= 0" instead of "> 0" uses less gas (found line 144 of ./contracts/crowdfund/Crowdfund.sol ("if (initialBalance > 0)"). 3. Do not use '+=' ('ethUsed += partialEthUsed', found ./contract/crownfund/Crowdfund.sol). Instead use "ethUsed = ethUsed + partialEthUsed" in order to save some gas. 4. Use assembly to write storage value. Line 28 in transferMultiSig() of ./contracts/globals/Globals.sol, instead of " multiSig = newMultiSig;", use assembly {sstore(multiSig.slot, newMultiSig)} to save gas. 5. Require() string longer than 32 bytes cost extra gas. For exemple, line 69 of ./contracts/market-wrapper/KoansMarketWrapper.sol, the require error string ("KoansMarketWrapper::getCurrentHighestBidder: Auction not active") is 63 bytes long when "KMW::getMinBid: Auction ! active" is 32 bytes long, and therefore a lot cheaper in gas and just as clear. 6. Avoid default assignment of i in loops. 'uint i' instead of 'uint256 i = 0'. Saves 3 gas per instance. (found line 180 of ./contracts/crowdfund/Crowdfund.sol). 7. Increment 'i' at the end of the loop in 'unchecked' so save gas. 'unchecked { ++i; }' at end of loop instead of 'for(uint256 i = 0; i < contributors.length, ++i)'. (found line 180 of ./contracts/crowdfund/Crownfund.sol). 8. Array.length should not be looked up in every loop of a for loop. Should be assigned once before the loop. ('for (uint256 i; i < hosts.length; i++)' found line 62 in ./contracts/crowdfund/CollectionBuyCrowdfund.sol). 9. Division by two should use bit shifting. 'uint256 mid = (low + high) / 2' (line 434 of contracts/party/PartyGovernance.sol) should be 'uint256 mid = (low + high) >> 1)' to save some gas;