diff --git a/docs/tokens/nft-tokens.mdx b/docs/tokens/nft-tokens.mdx index e1ebacdbb..a2aee81ea 100644 --- a/docs/tokens/nft-tokens.mdx +++ b/docs/tokens/nft-tokens.mdx @@ -293,6 +293,11 @@ For NFT: - ESDTRoleNFTUpdateAttributes : this role allows one to change the attributes of a specific NFT - ESDTRoleNFTAddURI : this role allows one add URIs for a specific NFT - ESDTTransferRole : this role enables transfer only to specified addresses. The addresses with the transfer role can transfer anywhere. +- ESDTRoleNFTUpdate : this role allows one to update meta data attributes of a specific NFT +- ESDTRoleModifyRoyalties : this role allows one to modify royalities of a specific NFT +- ESDTRoleSetNewURI : this role allows one to set new uris of a specific NFT +- ESDTRoleModifyCreator : this role allows one to rewrite the creator of a specific token +- ESDTRoleNFTRecreate : this role allows one to recreate the whole NFT with new attributes For SFT: @@ -300,6 +305,11 @@ For SFT: - ESDTRoleNFTBurn : this role allows one to burn quantity of a specific SFT - ESDTRoleNFTAddQuantity : this role allows one to add quantity of a specific SFT - ESDTTransferRole : this role enables transfer only to specified addresses. The addresses with the transfer role can transfer anywhere. +- ESDTRoleNFTUpdate : this role allows one to update meta data attributes of a specific SFT +- ESDTRoleModifyRoyalties : this role allows one to modify royalities of a specific SFT +- ESDTRoleSetNewURI : this role allows one to set new uris of a specific SFT +- ESDTRoleModifyCreator : this role allows one to rewrite the creator of a specific token +- ESDTRoleNFTRecreate : this role allows one to recreate the whole NFT with new attributes To see how roles can be assigned, please refer to [this](/tokens/nft-tokens#assigning-roles) section. @@ -683,7 +693,7 @@ The manager of an ESDT token may wipe out a single NFT held by a frozen Account. ```rust WipeTransaction { - Sender: + Sender: Receiver: erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u Value: 0 GasLimit: 60000000 @@ -698,6 +708,231 @@ _For more details about how arguments have to be encoded, check [here](/develope [comment]: # (mx-context-auto) +### **Modify Royalties** + +The manager of an ESDT token may want to set new royalities. This operation will rewrite the royalities on the specified token ID. +It requires `ESDTRoleNFTModifyRoyalties` role. +This is done by performing a transaction like this: + +```rust +ModifyRoyalitiesTransaction { + Sender: + Receiver: + Value: 0 + GasLimit: 60000000 + Data: "ESDTModifyRoyalties" + + "@" + + + "@" + + + "@" + +} +``` + +_For more details about how arguments have to be encoded, check [here](/developers/sc-calls-format)._ + +[comment]: # (mx-context-auto) + +### **Set new URIs** + +The manager of an ESDT token may want to set new URIs. This operation will rewrite the URIs on the specified token ID. +It requires `ESDTRoleNFTSetNewURIs` role. +This is done by performing a transaction like this: + +```rust +SetNewURIsTransaction { + Sender: + Receiver: + Value: 0 + GasLimit: 60000000 + Data: "ESDTSetNewURIs" + + "@" + + + "@" + + + "@" + + + "@" + + + ... +} +``` + +_For more details about how arguments have to be encoded, check [here](/developers/sc-calls-format)._ + +[comment]: # (mx-context-auto) + +### **Modify Creator** + +The creator of a token can be changed. For this, the token has to be moved to the new creator account. The new creator +account requires `ESDTRoleModifyCreator` role. Also, the token has to be of dynamic type in order for this to work. + +The creator can be modified using a transaction like this: + +```rust +ModifyCreatorTransaction { + Sender: + Receiver: + Value: 0 + GasLimit: 60000000 + Data: "ESDTModifyCreator" + + "@" + + + "@" + +} +``` + +_For more details about how arguments have to be encoded, check [here](/developers/sc-calls-format)._ + +[comment]: # (mx-context-auto) + +### **MetaData Update** + +The manager of an ESDT token may want to update token metadata. This operation will update token metadata on the specified token ID. +It requires `ESDTRoleNFTUpdate` role. If nothing is received for a given attribute, the old version of that attribute will be kept. + +This is done by performing a transaction like this: + +```rust +MetaDataUpdateTransaction { + Sender: + Receiver: + Value: 0 + GasLimit: 60000000 + Data: "ESDTMetaDataUpdate" + + "@" + + + "@" + + + "@" + + + "@" + + + "@" + + + "@" + + + "@" + +} +``` + +_For more details about how arguments have to be encoded, check [here](/developers/sc-calls-format)._ + +[comment]: # (mx-context-auto) + +### **MetaData Recreate** + +The whole NFT can be recreated with new attributes using a transaction like this: + +The manager of an ESDT token may want to recreate the whole token with new attributes. This operation will recreate token attributes on the specified token ID. +It requires `ESDTRoleNFTRecreate` role. If an argument is not being set, that field is set to zero. + +This is done by performing a transaction like this: + +```rust +MetaDataRecreateTransaction { + Sender: + Receiver: + Value: 0 + GasLimit: 60000000 + Data: "ESDTMetaDataRecreate" + + "@" + + + "@" + + + "@" + + + "@" + + + "@" + + + "@" + + + "@" + +} +``` + +_For more details about how arguments have to be encoded, check [here](/developers/sc-calls-format)._ + +[comment]: # (mx-context-auto) + +### **Make token dynamic** + +The ESDT manager can change token type to dynamic using a transaction like this: + +```rust +ChangeToDynamicTransaction { + Sender: + Receiver: erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u + Value: 0 + GasLimit: 60000000 + Data: "changeToDynamic" + + "@" + +} +``` + +The following token types cannot be changed to dynamic: `FungibleESDT`, `NonFungibleESDT`, `NonFungibleESDTv2` + +_For more details about how arguments have to be encoded, check [here](/developers/sc-calls-format)._ + +[comment]: # (mx-context-auto) + +### **Update token** + +The token type can be updated to the lastest version, which will update token type and propagate it to shard's +system account. Currently, token type is correctly saved only on metachain and there is no type related information +on shard level, the shard only knows if the token is non fungible with implicit type `NonFungibleESDT`, but it +does not know specifically if it's `NonFungibleESDT`, `MetaESDT` or `SemiFungibleESDT`. So, the update operation will +proceed in the following way: +- if token type is `NonFungibleESDT` it will be set to `NonFungibleESDTv2`, and it will be propagated to shard's system account +- if token type is `MetaESDT` or `SemiFungibleESDT` it will be propagated to shard's system account + +This can be done using a transaction like this: + +```rust +UpdateTokenIDTransaction { + Sender: + Receiver: erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u + Value: 0 + GasLimit: 60000000 + Data: "updateTokenID" + + "@" + +} +``` + +The following token types cannot be changed to dynamic: `FungibleESDT`, `NonFungibleESDT`, `NonFungibleESDTv2` + +_For more details about how arguments have to be encoded, check [here](/developers/sc-calls-format)._ + +[comment]: # (mx-context-auto) + +### **Register dynamic token** + +A token can be registered directly as dynamic. + +This can be done using a transaction like this: + +```rust +RegisterDynamicTransaction { + Sender: + Receiver: erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u + Value: 0 + GasLimit: 60000000 + Data: "registerDynamic" + + "@" + + + "@" + + + "@" + +} +``` + +The following token types cannot be registered as dynamic: `FungibleESDT` + +[comment]: # (mx-context-auto) + +### **Register and set all roles to dynamic** + +A token can be registered directly as dynamic together will all roles set for the specific type. + +This can be done using a transaction like this: + +```rust +RegisterAndSetAllRolesDynamicTransaction { + Sender: + Receiver: erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u + Value: 0 + GasLimit: 60000000 + Data: "registerAndSetAllRolesDynamic" + + "@" + + + "@" + + + "@" + +} +``` + +The following token types cannot be registered as dynamic: `FungibleESDT` + +[comment]: # (mx-context-auto) + ### **Transferring token management rights** The manager of an ESDT token can transfer the ownership if the ESDT was created as upgradable. Check the [ESDT - Upgrading (changing properties)](/tokens/esdt-tokens#upgrading-changing-properties) section for more details.