FTokens are burned after `quorumVotes` are recorded making a portion of the shares unclaimable
Source: https://github.com/sherlock-audit/2024-08-flayer-judging/issues/610
Found by
g, zarkk01
Summary
params.quorumVotes is larger than it should because Locker's collection tokens are burned after quorumVotes is recorded.
uint newQuorum = params.collectionToken.totalSupply() * SHUTDOWN_QUORUM_PERCENT / ONE_HUNDRED_PERCENT;
if (params.quorumVotes != newQuorum) {
params.quorumVotes = uint88(newQuorum);
}
// Lockdown the collection to prevent any new interaction
// @audit sunsetCollection() burns the Locker's tokens decreasing the `totalSupply`. If this was called before
// `params.quorumVotes` was set, the totalSupply() would be smaller and each vote would get more share of the ETH profits.
locker.sunsetCollection(_collection);
When a collection is shut down, its NFTs are sold off via Dutch auction in a SudoSwap pool. This sale's ETH profits are distributed to the holders of the collection token (fToken).
The claim amount is calculated with availableClaim * claimableVotes / params.quorumVotes * 2. The higher params.quorumVotes, the lower the claim amount for each vote.
Root Cause
params.quorumVotes is larger than it should because Locker's collection tokens are burned after quorumVotes is recorded.
Internal pre-conditions
- At least 50% of Holders have voted for a collection to shut down.
- No listings for the target collection exist.
External pre-conditions
None
Attack Path
- Admin calls
CollectionShutdown::execute(). The vulnerability always happens when this is called.
Impact
A portion of the claimable ETH can never be claimed and all voters can claim less ETH.
PoC
No response
Mitigation
Consider calling Locker::sunsetCollection() before setting the params.quorumVotes in CollectionShutdown::execute().
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity smart contracts bug in Flayer. Sherlock made it public on 10 October 2024. Found in the 468 audit contest (finding M-22), also found by 1 other warden.
About Smart contracts
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.