Skip to content
Business logic Audit finding Beginner

MAX_ROYALTY_RECIPIENTS_INDEX set too low

The smart contract caps the number of royalty recipients at a fixed index, so only the first five creators receive payouts and any additional creators are ignored. An attacker could not directly exploit this, but creators beyond the limit would lose their expected royalties.

cmichel Follow

Originally disclosed on Code4rena

Submitted by cmichel

NFTMarketFees.sol#L78

The creator payouts are capped at MAX_ROYALTY_RECIPIENTS_INDEX. It’s currently set to 4 and only 5 creators are paid out. Other creators are ignored.

Recommended Mitigation Steps

I don’t think cases with more than 5 creators / royalty receivers are unlikely. It can and should probably be increased, especially as the transfers are already gas restricted.

NickCuso (Foundation) acknowledged and commented:

Yes this is a fair point. The limit we put in place is arbitrary. We want some limit in order to ensure that the gas costs (which are often pushed to users other than the original creator) never get to be very expensive.

What we can and should do is document this limitation so that it’s more clear what exactly will happen when too many recipients are defined. Additionally we should comment on a possible workaround: If you have a contract that splits with too many participants you could use the Royalty Override in order to define a single contract recipient instead to handle the splits - e.g. https://www.0xsplits.xyz/


The original report as published on Code4rena, by cmichel. 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 constant `MAX_ROYALTY_RECIPIENTS_INDEX` is set to 4, which limits the loop to five recipients, and the code does not handle or warn about additional recipients.

Impact

Creators beyond the first five are not paid their royalties, which could lead to financial loss for those creators; the report does not describe an attacker gaining funds.

What the attacker needed

More than five royalty recipients

The fix

The limit should be increased or documented, and a workaround using a royalty override to a single splitting contract should be provided.

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.

This is a smart contract that pays royalties to creators when an NFT is sold. The code only pays the first five creators on a list and silently skips anyone after that, so some people who should get paid do not. It is a design flaw rather than an attack that steals money.

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 cmichel

View all

196 more disclosed reports, best first.

More from Foundation Exhibition, Scheduling & Early Access Solo Audit by Lambda

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.