Skip to content
Business logic Audit finding Intermediate

Precision is not enough for proposalThreshold and quorum. Collections with at least 20000 NFTs in total supply may have some trouble.

The proposal threshold and quorum calculations use integer division by 10,000, so for collections with a total supply of 20,000 or more, the minimum possible threshold or quorum becomes 2 instead of 1. This prevents setting these values to 1, potentially making governance parameters less precise than intended.

Chom Follow

Originally disclosed on Code4rena

Submitted by Chom

Governor.sol#L465-L477

Precision is not enough for proposalThreshold and quorum. Collections with at least 20000 NFTs in total supply may have some trouble. These collections can’t be set proposalThreshold = 1 or quorum = 1.

Proof of Concept

    /// @notice The current number of votes required to submit a proposal
    function proposalThreshold() public view returns (uint256) {
        unchecked {
            return (settings.token.totalSupply() * settings.proposalThresholdBps) / 10_000;
        }
    }

    /// @notice The current number of votes required to be in favor of a proposal in order to reach quorum
    function quorum() public view returns (uint256) {
        unchecked {
            return (settings.token.totalSupply() * settings.quorumThresholdBps) / 10_000;
        }
    }

If totalSupply = 20000, with the lowest settings (settings.proposalThresholdBps, settings.quorumThresholdBps = 1), it would returns (20000 * 1) / 10000 = 2. And it can’t be lowered more.

Recommended Mitigation Steps

Increase division to a more precise value such as 1e18 to allow high total supply NFT to always set threshold as 1

    /// @notice The current number of votes required to submit a proposal
    function proposalThreshold() public view returns (uint256) {
        unchecked {
            return (settings.token.totalSupply() * settings.proposalThresholdBps) / 1e18;
        }
    }

    /// @notice The current number of votes required to be in favor of a proposal in order to reach quorum
    function quorum() public view returns (uint256) {
        unchecked {
            return (settings.token.totalSupply() * settings.quorumThresholdBps) / 1e18;
        }
    }

Alex the Entreprenerd (judge) commented:

While I think more could have been said, this report quantifies how the quorum math can be rounded down to zero.

Because the math is used to manage value, and allowances, I agree with Medium Severity.

I recommend end users to Fuzz Test the settings to visualize a rational quorum that prevents it from being too low.

kulkarohan (Nouns Builder) acknowledged


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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the use of a low-precision divisor (10,000) in integer division causes rounding up to 2 when the numerator is at least 20,000 and the basis points value is 1.

Impact

Collections with at least 20,000 NFTs cannot set proposalThreshold or quorum to 1, potentially affecting governance flexibility.

What the attacker needed

TotalSupply >= 20000; proposalThresholdBps or quorumThresholdBps = 1

The fix

Increase the division precision to 1e18 to allow setting threshold to 1 for high total supply NFTs.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Smart contracts often use whole numbers, so dividing can lose fractions. Here, the code divides by 10,000, which means for large NFT collections the smallest possible result is 2 instead of 1. This makes it impossible to set very low thresholds for proposals or quorum.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by Chom

View all

13 more disclosed reports, best first.

More from Nouns Builder contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.