-
Notifications
You must be signed in to change notification settings - Fork 25
NFTEditable Standard Extension #68
Description
⚠️ WARNING: Standards are now published and discussed in the TEPs repository. This page may be out of date.
NFTEditable
Summary
Extension for NFT Standard.
-
Introducing
editorrole on collection level simplifies process of mass update as well as signalling of impossibility of such mass update -
Introducing
editorrole on NFT level simplifies process of per NFT updates and provide interface for algorithmic updates
Specification
NFT Collection and/or NFT item smart contracts must implement:
Internal messages
1. edit_content
Request
TL-B schema of inbound message:
edit_content#1a0b9d51 query_id:uint64 payload:Cell = EditRequest;
Should be rejected if:
Message is not from current editor.
Otherwise should do:
Update NFT content according it' inner logic and payload.
2. transfer_editorship
Request
TL-B schema of inbound message:
transfer_editorship#1c04412a query_id:uint64 new_editor:MsgAddress response_destination:MsgAddress custom_payload:(Maybe ^Cell) forward_amount:(VarUInteger 16) forward_payload:(Either Cell ^Cell) = EditRequest;
query_id - arbitrary request number.
new_editor - address of the new editor of the NFT item.
response_destination - address where to send a response with confirmation of a successful transfer and the rest of the coins.
custom_payload - optional custom data.
forward_amount - the amount of nanotons to be sent to the new editor.
forward_payload - optional custom data that should be sent to the new editor.
Should be rejected if:
-
message is not from current editor.
-
there is no enough coins (with respect to NFT own storage fee guidelines) to process operation and send
forward_amount. -
After processing the request, the contract must send at least
in_msg_value - forward_amount - max_tx_gas_priceto theresponse_destinationaddress.If the contract cannot guarantee this, it must immediately stop executing the request and throw error.
max_tx_gas_priceis the price in Toncoins of maximum transaction gas limit of NFT habitat workchain. For the basechain it can be obtained fromConfigParam 21.
Otherwise should do:
-
change current editor of NFT to
new_editoraddress. -
if
forward_amount > 0send message tonew_editoraddress withforward_amountnanotons attached and with the following layout:TL-B schema:
editorship_assigned#511a4463 query_id:uint64 prev_editor:MsgAddress forward_payload:(Either Cell ^Cell) = InternalMsgBody;query_idshould be equal with request'squery_id.forward_payloadshould be equal with request'sforward_payload.prev_editoris address of the previous editor of this NFT item.If
forward_amountis equal to zero, notification message should not be sent. -
Send all excesses of incoming message coins to
response_destinationwith the following layout:TL-B schema:
excesses#d53276db query_id:uint64 = InternalMsgBody;query_idshould be equal with request'squery_id.
Get-methods
get_editorreturns(slice editor)
return slice of typeMsgAddress- address of editor which can update common content in NFT collection/NFT item.
TL-B Schema
edit_content query_id:uint64 payload:Cell = InternalMsgBody;
transfer_editorship query_id:uint64 new_editor:MsgAddress response_destination:MsgAddress custom_payload:(Maybe ^Cell) forward_amount:(VarUInteger 16) forward_payload:(Either Cell ^Cell) = InternalMsgBody;
editorship_assigned query_id:uint64 prev_editor:MsgAddress forward_payload:(Either Cell ^Cell) = InternalMsgBody;
crc32('edit_content query_id:uint64 payload:Cell = InternalMsgBody') = 0x1a0b9d51 & 0x7fffffff = 0x1a0b9d51
crc32('transfer_editorship query_id:uint64 new_editor:MsgAddress response_destination:MsgAddress custom_payload:Maybe ^Cell forward_amount:VarUInteger 16 forward_payload:Either Cell ^Cell = InternalMsgBody') = 0x9c04412a & 0x7fffffff = 0x1c04412a
crc32('editorship_assigned query_id:uint64 prev_editor:MsgAddress forward_payload:Either Cell ^Cell = InternalMsgBody') = 0xd11a4463 & 0x7fffffff = 0x511a4463