FactoryDAO contest - Picodes's results

The DAO that builds DAOs.

General Information

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

FactoryDAO

Findings Distribution

Researcher Performance

Rank: 15/71

Findings: 3

Award: $589.08

🌟 Selected for report: 1

πŸš€ Solo Findings: 0

Findings Information

🌟 Selected for report: Picodes

Also found by: pedroais, unforgiven

Labels

bug
2 (Med Risk)
disagree with severity
sponsor confirmed

Awards

475.0681 DAI - $475.07

External Links

Lines of code

https://github.com/code-423n4/2022-05-factorydao/blob/db415804c06143d8af6880bc4cda7222e5463c0e/contracts/MerkleVesting.sol#L115 https://github.com/code-423n4/2022-05-factorydao/blob/db415804c06143d8af6880bc4cda7222e5463c0e/contracts/MerkleDropFactory.sol#L92

Vulnerability details

Impact

Contracts should clarify what is the intended behavior for Merkle trees with multiple leafs with the same address.

There is 2 possible behaviors:

  • either - what is currently done - you only authorize one claim per address, in which case the multiple leaf are here to give users a choice - for example you could use MerkleVesting to give users the choice between 2 sets of vesting parameters and have something close to MerkleResistor.
  • either you use a mapping based on the leaf to store if a leaf has been claimed or not.

This behavior should be clarified in the comments at least, and made clear to merkle tree builders.

#0 - illuzen

2022-05-11T09:40:43Z

This is covered in a comment on MerkleResistor:49, but we should put it elsewhere for clarity.

[GAS - 01]


spentTokens variable is not used for accounting so could be removed and tracked on chain to save gas.

Code: https://github.com/code-423n4/2022-05-factorydao/blob/db415804c06143d8af6880bc4cda7222e5463c0e/contracts/MerkleDropFactory.sol#L25

#0 - illuzen

2022-05-12T08:30:58Z

Valid

#1 - gititGoro

2022-06-05T00:16:45Z

The language "tracked on chain" seems to mismatch the abstraction level of tech at hand as we're working in a virtual machine environment with a high level language. But I assume the warden means "inferred from other variables".

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax Β© 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter