In MembershipERC1155
, new members can join immediately before a profit distribution and claim the same share as long-term members, this could be unfair for loyal DAO members.
This issue has been reported by Cyfrin team in their previous audit report, and one-world replied users will need to acquire a significant amount of shares to gain profit. However, this assumption breaks down when:
The DAO is created with tierPrice = 0
(free membership) or cheap membership DAO, the user then can join multiple times to gain shares
The sendProfit()
function distributes profits equally among all token holders at the time of distribution, regardless of how long they've held their tokens. This is especially viable if the tier price is 0 (free to join)
, this creates a zero-cost exploitation.
This allows for opportunistic users to:
Monitor the mempool for incoming sendProfit
calls
Front-run sendProfit
by calling MembershipFactory::joinDAO
multiple times and claim profit
Proof of Concept
Test logs show that Bob doesn't have to spend any tokens and still gets the same amount of profit.
This causes unfair profit distribution, reduced incentives for long-term membership and financial commitment
Manual review
Foundry
Depending on business logic, there are a few mitigation options
Implement a time-tracking feature.
Ensure DAO tierPrice != 0
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.