Skip to content
237 changes: 236 additions & 1 deletion docs/tokens/nft-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,23 @@ 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:

- ESDTRoleNFTCreate : this role allows one to create a new 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.

Expand Down Expand Up @@ -683,7 +693,7 @@ The manager of an ESDT token may wipe out a single NFT held by a frozen Account.

```rust
WipeTransaction {
Sender: <account address of the token managers>
Sender: <account address of the token manager>
Receiver: erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u
Value: 0
GasLimit: 60000000
Expand All @@ -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: <account address of the token manager>
Receiver: <same as sender>
Value: 0
GasLimit: 60000000
Data: "ESDTModifyRoyalties" +
"@" + <token identifier in hexadecimal encoding> +
"@" + <token nonce in hexadecimal encoding> +
"@" + <new royalties in hexadecimal encoding>
}
```

_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: <account address of the token manager>
Receiver: <same as sender>
Value: 0
GasLimit: 60000000
Data: "ESDTSetNewURIs" +
"@" + <token identifier in hexadecimal encoding> +
"@" + <token nonce in hexadecimal encoding> +
"@" + <new URI1 in hexadecimal encoding> +
"@" + <new URI2 in hexadecimal encoding> +
...
}
```

_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: <account address of the new creator that has `ESDTRoleModifyCreator` role>
Receiver: <same as sender>
Value: 0
GasLimit: 60000000
Data: "ESDTModifyCreator" +
"@" + <token identifier in hexadecimal encoding> +
"@" + <token nonce in hexadecimal encoding>
}
```

_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: <account address that has `ESDTRoleNFTUpdate` role>
Receiver: <same as sender>
Value: 0
GasLimit: 60000000
Data: "ESDTMetaDataUpdate" +
"@" + <token identifier in hexadecimal encoding> +
"@" + <token nonce in hexadecimal encoding> +
"@" + <token name in hexadecimal encoding> +
"@" + <royalities in hexadecimal encoding> +
"@" + <hash in hexadecimal encoding> +
"@" + <attributes in hexadecimal encoding> +
"@" + <uris list in hexadecimal encoding>
}
```

_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:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add: If an argument is not received, that field is set to zero

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


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: <account address that has `ESDTRoleNFTRecreate` role>
Receiver: <same as sender>
Value: 0
GasLimit: 60000000
Data: "ESDTMetaDataRecreate" +
"@" + <token identifier in hexadecimal encoding> +
"@" + <NFT nonce in hexadecimal encoding> +
"@" + <token name in hexadecimal encoding> +
"@" + <royalities in hexadecimal encoding> +
"@" + <hash in hexadecimal encoding> +
"@" + <attributes in hexadecimal encoding> +
"@" + <uris list in hexadecimal encoding>
}
```

_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: <account address of the token manager>
Receiver: erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u
Value: 0
GasLimit: 60000000
Data: "changeToDynamic" +
"@" + <token identifier in hexadecimal encoding>
}
```

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: <account address of the token manager>
Receiver: erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u
Value: 0
GasLimit: 60000000
Data: "updateTokenID" +
"@" + <token identifier in hexadecimal encoding>
}
```

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: <account address of the token manager>
Receiver: erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u
Value: 0
GasLimit: 60000000
Data: "registerDynamic" +
"@" + <token name in hexadecimal encoding> +
"@" + <token ticker in hexadecimal encoding> +
"@" + <token compressed type (which can be `NFT`, `SFT`, `META`, `FNG`) in hexadecimal encoding>
}
```

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: <account address of the token manager>
Receiver: erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u
Value: 0
GasLimit: 60000000
Data: "registerAndSetAllRolesDynamic" +
"@" + <token name in hexadecimal encoding> +
"@" + <token ticker in hexadecimal encoding> +
"@" + <token compressed type (which can be `NFT`, `SFT`, `META`, `FNG`) in hexadecimal encoding>
}
```

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.
Expand Down