Skip to content
Smart contracts Audit finding Intermediate

FTokens are burned after `quorumVotes` are recorded making a portion of the shares unclaimable

g Follow with zarkk01

Originally disclosed on Sherlock

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.

Solidity
    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

  1. At least 50% of Holders have voted for a collection to shut down.
  2. No listings for the target collection exist.

External pre-conditions

None

Attack Path

  1. 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().

The original report as published on Sherlock, by g. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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.

More by g

View all

23 more disclosed reports, best first.

More from Flayer

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.