An attacker can manipulate profit distribution by front-running the sendProfit
function, purchasing a large number of tokens just before profits are distributed. This allows them to claim an unfairly large share of the profits at the expense of other DAO members.
In the MembershipERC1155
contract, the sendProfit
function distributes profits based on the current totalSupply
of tokens:
Since totalProfit
is calculated at the moment sendProfit
is called, an attacker can purchase a significant number of tokens right before this function is executed. By doing so, they increase their share of the totalSupply, and thus receive a disproportionately large share of the profits when they claim them.
The profit a user can claim is calculated using:
By increasing shareOf(account)
just before totalProfit
is updated, the attacker maximizes their profit.
Consider the following test :
This vulnerability allows attackers to capture almost all of the profits intended for distribution among DAO members, depriving honest participants of their fair share and undermining the integrity of the profit-sharing mechanism.
Manual review and foundry
Considering implementing a holding period or snapshots.
Limit token purshases for a single wallet
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.