-
Notifications
You must be signed in to change notification settings - Fork 118
Add Royalty standard #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add Royalty standard #155
Changes from 9 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
e033939
Add loyalty standard in NEP-11
superboyiii 60ad293
add mail
superboyiii f01b436
Change it to an independent standard
superboyiii b229a55
Apply some feedback
superboyiii 0ef359d
fix
superboyiii ac114e9
update
superboyiii 7c5aa74
fix
superboyiii c5c82d5
fix
superboyiii 4a56389
fix safe
superboyiii 6ccfe0c
remove isGlobalRoyalty() & modify the description
superboyiii 2d0ceb7
udpate
superboyiii 2ddf6a3
Vincent's advice
superboyiii f6d6939
add Vincent to author
superboyiii e769920
format
superboyiii fbcaaf5
add royaltyToken in royaltyInfo
superboyiii 674bfa3
update RoyaltiesTransferred
superboyiii c126eb1
Fix description
superboyiii a0d3bc6
format
superboyiii 088aad5
Fix the definition of royaltyAmount
superboyiii d31194e
fix Motivation
superboyiii bb726a5
Update nep-x1.mediawiki
superboyiii 4da58cd
Merge branch 'neo-project:master' into add-nep11-royalty
superboyiii 8b61cc9
some improvement on description
superboyiii 1066b62
name proposal as NEP-24
superboyiii 8a8b8c2
fix README.mediawiki
superboyiii b0d2211
Add Implementation
superboyiii 4cde4d3
little-fix
superboyiii 351f751
Merge branch 'master' into add-nep11-royalty
superboyiii fd7035a
add example
superboyiii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
<pre> | ||
NEP: Undefined | ||
Title: NFT Royalty Standard | ||
Author: Owen Zhang<[email protected]> | ||
Type: Standard | ||
Status: Draft | ||
Created: 2022-09-05 | ||
</pre> | ||
|
||
==Abstract== | ||
superboyiii marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
This NEP defines a global standard to get royalty payment information for non-fungible tokens (NFTs) to enable support for royalty payments across all NFT marketplaces in the NEO Smart Economy. | ||
superboyiii marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
==Motivation== | ||
|
||
Need support royalty information which is not only for royalty payments across NFT marketplaces, but also good to protect creative copyright. Currently, no standard for creators to declare loyalty to all marketplaces in their NFTs. They have to discuss the loyalty with different marketplaces, otherwise these marketplaces which haven't touched with the creators can't get royalty details and have to define the loyalty in their marketplace contract by themselves. This standard is compatible with [https://github.com/neo-project/proposals/blob/master/nep-11.mediawiki NEP-11]. | ||
|
||
==Specification== | ||
|
||
===Common methods=== | ||
|
||
====isGlobalRoyalty==== | ||
|
||
<pre> | ||
{ | ||
"name": "isGlobalRoyalty", | ||
"safe": true, | ||
"parameters": [], | ||
"returntype": "Boolean" | ||
} | ||
</pre> | ||
|
||
This function shows if this contract has <code>global royalty</code> or <code>specific royalty</code> to different tokenId. | ||
|
||
If return <code>true</code>, then it has global royalty. All tokenId MUST implement the same static royalty amount. | ||
|
||
If return <code>false</code>, then it has specific royalty. MUST store specific royalty amount for each tokenId, static or dynamic, either is OK . | ||
|
||
====royaltyInfo==== | ||
|
||
If <code>isGlobalRoyalty</code> return true, this function should be: | ||
|
||
<pre> | ||
{ | ||
"name": "royaltyInfo", | ||
superboyiii marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"safe": true, | ||
"parameters": [], | ||
"returntype": "Array" | ||
} | ||
</pre> | ||
|
||
If <code>isGlobalRoyalty</code> return false, this function should be: | ||
|
||
<pre> | ||
{ | ||
"name": "royaltyInfo", | ||
"safe": true, | ||
"parameters": [ | ||
{ | ||
"name": "tokenId", | ||
"type": "ByteString" | ||
}, | ||
{ | ||
"name": "salePrice", | ||
"type": "Integer" | ||
} | ||
], | ||
"returntype": "Array" | ||
superboyiii marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
</pre> | ||
|
||
Returns a JSON Array which includes <code>royaltyRecipient</code> and <code>royaltyAmount</code>. | ||
superboyiii marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
MUST follow the JSON Array below: | ||
<pre> | ||
[ | ||
{ | ||
"name":"royaltyRecipient", | ||
"type":"Hash160" | ||
}, | ||
{ | ||
"name":"royaltyAmount", | ||
"type":"Integer" | ||
} | ||
] | ||
</pre> | ||
|
||
<code>royaltyRecipient</code> is the address of who should be sent the royalty payment, SHOULD be a 20-byte address. | ||
superboyiii marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<code>royaltyAmount</code> Must be a percentage fixed point with a scaling factor of 100 (x/100). For example: "1000" for 10%. | ||
|
||
This function is not for initial sale or mint, it's only for secondary marketplaces. | ||
|
||
Marketplaces that support this method MAY implement any method of calculating or transferring royalties to the royalty recipient. | ||
|
||
Marketplaces MUST pay the royalty in the same unit of exchange as that of the <code>salePrice</code> passed to royaltyInfo(). For example, if the sale price is in NEO, then the royalty payment must also be paid in NEO, and if the sale price is in GAS, then the royalty payment must also be paid in GAS. | ||
|
||
The royaltyInfo() function MUST NOT ignore the <code>salePrice</code>, <code>royaltyAmount</code> MAY be dynamic due to <code>salePrice</code> and time. | ||
|
||
Marketplaces that support this standard MUST emit the event, <code>ReceivedRoyalties</code>, after sending a payment. | ||
|
||
===Events=== | ||
|
||
====RoyaltiesTransferred==== | ||
|
||
<pre> | ||
{ | ||
"name": "RoyaltiesTransferred", | ||
superboyiii marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"parameters": [ | ||
{ | ||
"name": "contractHash", | ||
"type": "Hash160" | ||
}, | ||
{ | ||
"name": "royaltyRecipient", | ||
superboyiii marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"type": "Hash160" | ||
}, | ||
{ | ||
"name": "buyer", | ||
"type": "Hash160" | ||
}, | ||
{ | ||
"name": "tokenId", | ||
"type": "ByteString" | ||
}, | ||
{ | ||
"name": "amount", | ||
"type": "Integer" | ||
} | ||
] | ||
} | ||
</pre> | ||
|
||
<code>royaltyRecipient</code> MUST be the same address as that in <code>royaltyInfo</code> method. | ||
MUST trigger after marketplaces transferring royalties to the royalty recipient if <code>royaltyInfo</code> method is implemented. | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.