mirror of
https://github.com/status-im/EIPs.git
synced 2025-02-23 20:28:21 +00:00
Automatically merged updates to draft EIP(s) 2981 (#3367)
Hi, I'm a bot! This change was automatically merged because: - It only modifies existing Draft, Review, or Last Call EIP(s) - The PR was approved or written by at least one author of each modified EIP - The build is passing
This commit is contained in:
parent
785a06c886
commit
ed1ea94631
@ -1,7 +1,7 @@
|
||||
---
|
||||
eip: 2981
|
||||
title: ERC-721 Royalty Standard
|
||||
author: Zach Burks (@vexycats), James Morgan (@jamesmorgan)
|
||||
author: Zach Burks (@vexycats), James Morgan (@jamesmorgan), Blaine Malone (@blmalone)
|
||||
discussions-to: https://github.com/ethereum/EIPs/issues/2907
|
||||
status: Draft
|
||||
type: Standards Track
|
||||
@ -20,7 +20,7 @@ This extension provides even more flexibility to the [ERC-721 specification](./e
|
||||
|
||||
|
||||
## Motivation
|
||||
There are many marketplaces for NFTs and the ones that support royalties are using their own standard version of royalties that are not easily compaitble or usable by other marketplaces. Just as in the early days of Ethereum, smart contracts are varied by ecosystem and not compatible. This would solve that issue such that an NFT created, purchased, or sold on one marketplace, provides the royalties that the creator is entitled too, regardless of the next marketplace/ecosystem it is sold at.
|
||||
There are many marketplaces for NFTs and the ones that support royalties are using their own standard version of royalties that are not easily compatible or usable by other marketplaces. Just as in the early days of Ethereum, smart contracts are varied by ecosystem and not compatible. This would solve that issue such that an NFT created, purchased, or sold on one marketplace, provides the royalties that the creator is entitled too, regardless of the next marketplace/ecosystem it is sold at.
|
||||
|
||||
|
||||
Many of the largest ERC-721 marketplaces have implemented a form of royalties that is not compatible across the board and therefore making it much harder to enforce if the NFT is sold on another marketplace, not fulfulling the potential of any royalty system put in place. This standard is a proposed way to minimally implement royalties that can be accepted across any type of NFT marketplace smart contracts. This standard allows for a royalty standard to be accepted on all marketplaces - leaving the funds transfer up to the marketplace itself, and only providing a means to fetch the royalty amounts and a event to be fired off when transfer has happened.
|
||||
@ -46,8 +46,9 @@ The `_RoyaltyAmount` **MUST** be calculated as a percentage fixed point with a s
|
||||
|
||||
Marketplaces that support this standard **MAY** implement any method of calculating or transferring royalties to the royalty recipient.
|
||||
|
||||
Marketplaces that support this standard **MUST** emit the event, `royaltiesReceived`, after sending a payment.
|
||||
```
|
||||
Marketplaces that support this standard **MUST** emit the event, `ReceivedRoyalties`, after sending a payment.
|
||||
|
||||
```solidity
|
||||
/**
|
||||
@notice This event is emitted when royalties are transferred.
|
||||
@dev The marketplace would emit this event from their contracts.
|
||||
@ -94,7 +95,7 @@ interface IERC2981 is ERC165 {
|
||||
```
|
||||
|
||||
### Event `ReceivedRoyalties` to be used by marketplaces when transferring royalty payments
|
||||
```
|
||||
```solidity
|
||||
/**
|
||||
@notice This event is emitted when royalties are transferred.
|
||||
@dev The marketplace would emit this event from their contracts.
|
||||
@ -117,8 +118,8 @@ The `Royalty` ERC being used on a ERC-721 during deployment:
|
||||
|
||||
**Deploying an ERC-721 and setting the royalty amount and creator**
|
||||
|
||||
```
|
||||
constructor (string memory name, string memory symbol, string memory baseURI) public Royalties(royalty_amount, msg.sender){
|
||||
```solidity
|
||||
constructor (string memory name, string memory symbol, string memory baseURI) public Royalties(royalty_amount, msg.sender) {
|
||||
_name = name;
|
||||
_symbol = symbol;
|
||||
_setBaseURI(baseURI);
|
||||
@ -133,16 +134,16 @@ constructor (string memory name, string memory symbol, string memory baseURI) p
|
||||
|
||||
**Checking if the NFT being purchased/sold on your marketplace implemented royalties (note using address.call() is completely **OPTIONAL** and is just one method)**
|
||||
|
||||
```
|
||||
function checkRoyalties(address _token) internal returns(bool){
|
||||
```solidity
|
||||
function checkRoyalties(address _token) internal returns(bool) {
|
||||
(bool success,) = address(_token).call(abi.encodeWithSignature("royaltyInfo()"));
|
||||
return success;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Transferring funds and calling the event to be emitted**
|
||||
|
||||
```
|
||||
```solidity
|
||||
_recipient.transfer(amount);
|
||||
IERC2981(_tokenAddress).royaltiesReceived(_recipient, _buyer, amount);
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user