Skip to content
Business logic Audit finding Intermediate

Owners receive more percentage of total nft if some nfts were burned(because were not sold)

The token contract does not decrement the total supply counter when an unsold NFT is burned, so the founder's fixed number of tokens becomes a larger percentage of the remaining supply. An attacker could exploit this by causing NFTs to be burned, increasing the founder's voting power and share of the community.

rvierdiiev Follow

Originally disclosed on Code4rena

Submitted by rvierdiiev

According to Nouns Builder, founder can have percentage of created nft. This is set in Token::_addFounders function. When new nft is minted by mint function then total supply of tokens is incremented and assigned to tokenId using tokenId = settings.totalSupply++. Then this token is checked if it should be mint to founder(then again increment total supply of tokens) or should be mint to auction using while (_isForFounder(tokenId)).

If token wasn’t sold during the auction then auction burns it using burn function. And this function doesn’t decrement settings.totalSupply value. But total supply has changed now, it has decreased by one.

So suppose that we have 1 founder of dao that should receive 2% of nft, that means that if 100 nft are available(for example), then 2 of them belongs to that founder. If we have minted 100 nft and 10 of them were not sold(they were then burned), then there are 90 nft available now. And in current implementation founder has ownership of 2 of them, however 2 is not 2% of 90. So in case when nft are not sold on auction the percentage of founder’s tokens is increasing and the increasing speed depends on how many tokens were not sold. Also founder gets more power in the community(as he has more percentage now).

Proof of Concept

https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/token/Token.sol#L71-L126 https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/token/Token.sol#L154 https://github.com/code-423n4/2022-09-nouns-builder/blob/main/src/token/Token.sol#L207-L213

Recommended Mitigation Steps

When burn function is called then do settings.totalSupply--.

kulkarohan (Nouns Builder) confirmed

Alex the Entreprenerd (judge) decreased severity to Medium and commented:

In contrast to #423, this report is arguing the fairness of token distribution when a token is burned.

I think that, because they are relating to a different aspect, this report is unique, however, because the impact and mechanism is based on burn not changing totalSupply, and “accounting being incorrect” because of that, then I believe this is also a Medium Severity finding.


The original report as published on Code4rena, by rvierdiiev. 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

The burn function fails to decrement the totalSupply counter, so the recorded supply no longer matches the actual number of tokens in circulation.

Impact

The founder's percentage of tokens and community voting power increases beyond the intended share, which could unfairly influence governance; the judge rated this as a Medium severity issue.

What the attacker needed

Unsold NFTs are burned; founder has a percentage allocation

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.

In this NFT auction system, a founder is promised a fixed percentage of all tokens. The total supply is tracked by a counter, but when an unsold token is destroyed (burned), the counter is not reduced. So the founder ends up owning a larger slice of the smaller remaining supply, giving them more voting power than intended.

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 rvierdiiev

View all

72 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.