NFT Marketplace Royalty Standards (EIP-2981) 3 — Questions and Answers
Question 1: A contract wants a flat 5% royalty on all tokens. How should royaltyInfo compute the amount?
- Return salePrice * 500 / 10000 (Correct answer)
- Return salePrice * 5
- Return salePrice / 5
- Return a hardcoded constant
Correct answer: Return salePrice * 500 / 10000
Using basis points, 5% equals 500/10000 of the salePrice.
Question 2: What is a common pattern for storing the royalty receiver in an EIP-2981 implementation?
- A settable address variable, often the creator or a payout splitter (Correct answer)
- The msg.sender of every sale
- The marketplace contract address
- The buyer's address
Correct answer: A settable address variable, often the creator or a payout splitter
Implementations store a configurable receiver, frequently a creator wallet or a revenue-splitting contract.
Question 3: OpenZeppelin's ERC2981 implementation lets you set royalties at which levels?
- A default for the collection and per-token overrides (Correct answer)
- Only per-token
- Only globally and immutably
- Only per-buyer
Correct answer: A default for the collection and per-token overrides
OpenZeppelin provides _setDefaultRoyalty and _setTokenRoyalty for collection-wide and token-specific values.
Question 4: In OpenZeppelin's implementation, how is the royalty fraction expressed by default?
- In basis points out of 10000 (Correct answer)
- As a raw wei amount
- As a percentage out of 100
- As a fixed-point Q64.64 number
Correct answer: In basis points out of 10000
The default _feeDenominator returns 10000, so fees are set in basis points.
Question 5: What happens if you call _setTokenRoyalty with a feeNumerator greater than the denominator in OpenZeppelin's ERC2981?
- It reverts because royalty exceeds sale price (Correct answer)
- It silently caps at 100%
- It sets a negative royalty
- It disables royalties
Correct answer: It reverts because royalty exceeds sale price
OpenZeppelin reverts when the numerator exceeds the denominator to prevent royalties larger than the sale price.
Question 6: Which interface ID must supportsInterface return true for to claim EIP-2981 compliance?
- The IERC2981 interface ID (0x2a55205a) (Correct answer)
- The IERC721 interface ID
- The IERC165 interface ID only
- 0x80ac58cd
Correct answer: The IERC2981 interface ID (0x2a55205a)
Type(IERC2981).interfaceId equals 0x2a55205a, which marketplaces check for royalty support.
Question 7: To resell royalty payouts among multiple creators, a receiver is often set to what?
- A PaymentSplitter or similar splitter contract (Correct answer)
- A burn address
- The zero address
- Each buyer in turn
Correct answer: A PaymentSplitter or similar splitter contract
A splitter contract receives the royalty and distributes shares to multiple beneficiaries.
A contract wants a flat 5% royalty on all tokens.
How should royaltyInfo compute the amount?