Urgent.News

What's breaking now, across thousands of outlets.

Tech

ERC-2981 in practice: what a 5% royalty actually pays out

How an ERC-2981 royalty actually lands in a sale: in Seaport it is an extra consideration item with a fixed recipient, not a post-hoc transfer ERC-2981 does not transfer a royalty. It answers a question: for this token and sale price, which address should receive the royalty, and how much should it receive? (address receiver, uint256 royaltyAmount) = royaltyInfo(tokenId, salePrice); When I build…

An ERC-2981 royalty's payout is determined by the address and amount, which are calculated before the sale through a method called royaltyInfo. This function takes the token ID and sale price as inputs and returns the recipient address and the royalty amount. When a Seaport listing is created, the royaltyInfo function is called before signing the order. The returned royalty amount and recipient are then added to the order's consideration array.

The seller net amount, after accounting for the marketplace fee and the royalty, can be calculated using the formula: price - royalty - F. Here, 'price' refers to the sale price, 'royalty' is the calculated royalty amount based on a 5% rate, and 'F' represents the marketplace fee. The seller net amount is derived from the seller's startAmount in the consideration array, which is the amount the seller agrees to receive.

When using this system, it's important to verify that the royalty consideration in the signed order matches the result of the royaltyInfo function. This involves checking three sources: the direct call to royaltyInfo, the decoded signed Seaport order, and the fulfilled transaction's payment transfers. Any discrepancy between these records indicates a deviation from the standard ERC-2981 royalty payment process.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Why your PDF signature breaks the moment someone edits the file

A client sent me a signed supplier agreement last month with a note: "we changed one date in appendix 2, that's fine right?" The signature panel in their viewer still showed a green tick.

  • PDF signatures verify file bytes, not content
  • Editing PDF shifts byte ranges, invalidates signature
  • Re-sign document after changes to maintain signature validity

More from Sunday 8 November →