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: 42/110
Findings: 2
Award: $117.90
🌟 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.5411 USDC - $82.54
ReadOnlyDelegateCall.sol
ProposalStorage.sol
L6 - the IERC721 interface is imported but it is never used.
L14/15 - A structure with a single element inside is created, this could be omitted and the IProposalExecutionEngine interface is simply called. The goal of structures is to connect multiple elements, in this case there is only one.
BuyCrowdfund.sol
Crowdfund.sol
L77 - An OnlyContributorAllowedError() error is created that is never used.
L262/306 - There are two functions with the same name _createParty() but they have different inputs, one of them just converts base type inputs to arrays, this should make it have a different name.
BuyCrowdfund.sol
CrowdfundNFT.sol
PartyGovernanceNFT
ProposalExecutionEngine
L13 - the LibProposal library is imported but it is never used.
L210-222 - A switch could be used instead of concatenating if/else.
L246/247 - The requirements should have a defined message so that when they revert the message received by the user is consistent with the error that occurred.
TokenDistributor
L44 - An OnlyPartyDaoAuthorityError error is created that is never used.
L225/236 - When the for is iterated, the length of an array is used, but two arrays are used inside. This could bring errors since a length can be longer than another, generating exceptions without knowing a reason why, to improve the user experience, it should be previously validated and throw an exception with a correct message.
PartyGoverance.sol
L173/175 - Errors are created: ProposalExistsError, ProposalHasNoVotesError that are never used.
L795 - A low gas level transfer is performed that does not revert when it returns false. This should be a standard, although in this case it does not generate major inconveniences since it simply returns false, but there is no type of status modification within the contract.
L1062/1079 - It should be validated that totalVotingPower is != 0 and return a corresponding message, otherwise it would revert showing an unreadable message.
proposals/vendor/FractionalV1.sol
#0 - 0xble
2022-09-26T02:14:37Z
Unused errors and imports will be removed
🌟 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.3567 USDC - $35.36
Crowdfund.sol
L144/423/471 - You can save gas if instead of doing uint256() > 0 you do != 0.
L180/242/300/348 - When we create a variable and we want it to have its base value, it is not necessary to set that value, since this would imply a double setting.
L180/300 - When we are using a for and the length of the array is constantly consulted inside, it would be less expensive to create a variable in memory of the length of the array.
L180/242/300/348/358 - When a uint256 value is impossible to overflow, such as in a for loop, it can become unchecked.
BuyCrowdfund.sol
L62 - When we are using a for and the length of the array is constantly consulted inside, it would be less expensive to create a variable in memory of the length of the array.
L62 - When a uint256 value is impossible to overflow, such as in a for loop, it can become unchecked.
ArbitraryCallsProposal
L52/61/78 - When we create a variable and we want it to have its base value, it is not necessary to set that value, since this would imply a double setting.
L52/61/78 - When we are using a for and the length of the array is constantly consulted inside, it would be less expensive to create a variable in memory of the length of the array.
L52/61/78 - When a uint256 value is impossible to overflow, such as in a for loop, it can become unchecked.
L137/139 - It is not necessary to create the hasPrecious variable, this generates an extra gas cost. Less gas could be wasted simply by returning the bool.
TokenDistributor
L170/230 - When a uint256 value is impossible to overflow, such as in a for loop, it can become unchecked.
L230 - When we create a variable and we want it to have its base value, it is not necessary to set that value, since this would imply a double setting.
L230 - When we are using a for and the length of the array is constantly consulted inside, it would be less expensive to create a variable in memory of the length of the array.
L381 - It is less expensive to make variable = variable - varA; which variable -= varA;
PartyGoverance.sol
L306/432 - When we create a variable and we want it to have its base value, it is not necessary to set that value, since this would imply a double setting.
L306 - When we are using a for and inside the length of the array is constantly consulted, it would be less expensive to create a variable in memory of the length of the array.
L306 - When a uint256 value is impossible to overflow, such as in a for loop, it can become unchecked.
L1062/1066 - It is not necessary to create a variable if it is only going to be used once, this saves gas expenses.
LibProposal.sol
L14/32 - When we create a variable and we want it to have its base value, it is not necessary to set that value, since this would imply a double setting.
L14/32 - When we are using a for and inside the length of the array is constantly consulted, it would be less expensive to create a variable in memory of the length of the array.
L14/32 - When a uint256 value is impossible to overflow, such as in a for loop, it can become unchecked.