Platform: Code4rena
Start Date: 04/05/2022
Pot Size: $50,000 DAI
Total HM: 24
Participants: 71
Period: 5 days
Judge: Justin Goro
Total Solo HM: 14
Id: 119
League: ETH
Rank: 6/71
Findings: 3
Award: $1,876.35
🌟 Selected for report: 1
🚀 Solo Findings: 1
🌟 Selected for report: fatherOfBlocks
1759.5116 DAI - $1,759.51
When the transfer is made in the withdraw() function, it is not validated if the transfer was done correctly. This could be a conflict since not being able to perform it would return a false and that case would not be handled, the most common is to revert.
The recommendation is to wrap the transfer with a require, as is done in MerkleDropFactory.sol for example.
#0 - illuzen
2022-05-10T08:33:03Z
Malicious or otherwise bad tokens are considered acceptable risks for this contract as long as they cannot interfere with other trees.
#1 - illuzen
2022-06-03T02:39:08Z
🌟 Selected for report: horsefacts
Also found by: 0x1f8b, 0xYamiDancho, 0xf15ers, 0xkatana, ACai, AlleyCat, Bruhhh, Dravee, Funen, GimelSec, Hawkeye, IllIllI, MaratCerby, PPrieditis, Picodes, Ruhum, TerrierLover, VAD37, berndartmueller, csanuragjain, defsec, delfin454000, eccentricexit, ellahi, fatherOfBlocks, gzeon, hansfriese, hickuphh3, hyh, ilan, joestakey, juicy, kebabsec, oyc_109, rajatbeladiya, reassor, rfa, robee, samruna, simon135, sorrynotsorry, throttle
77.6194 DAI - $77.62
PermissionlessBasicPoolFactory.sol
MerkleVesting.sol
MerkleResistor.sol
MerkleEligibility.sol
VoterID.sol
#0 - illuzen
2022-05-10T08:27:21Z
Zero address checks are not in scope. Most of these are duplicates. Setting max deposit to 0 doesn't lose anyone money, nor does depositing zero tokens. Timewithdrawn does not have only two values, not sure what you meant.
🌟 Selected for report: IllIllI
Also found by: 0x1f8b, 0xNazgul, 0xYamiDancho, 0xf15ers, 0xkatana, ACai, CertoraInc, Dravee, Funen, GimelSec, Hawkeye, PPrieditis, Picodes, Ruhum, TerrierLover, Tomio, VAD37, Waze, csanuragjain, defsec, delfin454000, eccentricexit, ellahi, fatherOfBlocks, gzeon, hansfriese, horsefacts, ilan, joestakey, juicy, minhquanym, oyc_109, rajatbeladiya, reassor, rfa, robee, samruna, simon135, z3s
39.2219 DAI - $39.22
PermissionlessBasicPoolFactory.sol
MerkleLib.sol
MerkleDropFactory.sol
MerkleVesting.sol
MerkleResistor.sol
MerkleIdentity.sol
L124: In the withdraw() function, a validation of an input parameter is performed in the middle of the function, it would be more optimal to do it at the beginning, since if it reverts, less gas is spent than it is now.
L127: In the withdraw() function, a validation is performed with verifyMetadata(), it would be more optimal to do it just after the variable tree = merkleTrees[merkleIndex] is read from storage; since if it reverses, less gas is spent than it is now.
L142/L143: You could save a little gas, if instead of returning a variable directly, you return the function call, in the getPrice() function.
L118/L121: In the withdraw() function, the local variable id is only used once, therefore, it would be less expensive and more explicit (since the name "id" is not at all descriptive) it would be to do it like this: IVoterID(tree.nftAddress ).createIdentityFor(msg.sender, tokenId, uri);
MerkleEligibility.sol
VoterID.sol
#0 - illuzen
2022-05-10T08:09:10Z
Valid, but mostly duplicate, and compiler optimization should cover most of this.