This shows you the differences between two versions of the page.
fob:laboratoare:04 [2022/11/10 14:15] costin.carabas |
fob:laboratoare:04 [2022/11/10 21:22] (current) costin.carabas |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Practical Session 04. ===== | + | ===== Fungible Tokens ===== |
- | Fungible vs Non-Fungible Tokens: | + | __Fungible vs Non-Fungible Tokens:__ |
* Fungibility refers to an asset's ability to be exchanged for something else of equal value; | * Fungibility refers to an asset's ability to be exchanged for something else of equal value; | ||
* Some examples of fungible assets include currencies, commodities, and precious stones; | * Some examples of fungible assets include currencies, commodities, and precious stones; | ||
Line 35: | Line 35: | ||
If you want to make an ''erdpy'' transaction use the info from [[https://docs.elrond.com/tokens/esdt-tokens/#parameters-format | Elrond documentation]] to correctly format your parameters. | If you want to make an ''erdpy'' transaction use the info from [[https://docs.elrond.com/tokens/esdt-tokens/#parameters-format | Elrond documentation]] to correctly format your parameters. | ||
+ | <note tip> | ||
+ | You can find more details [[https://docs.elrond.com/tokens/esdt-tokens/|here]]. | ||
+ | </note> | ||
Issuance example: | Issuance example: | ||
<code bash> | <code bash> | ||
IssuanceTransaction { | IssuanceTransaction { | ||
- | Sender: erd1sg4u62lzvgkeu4grnlwn7h2s92rqf8a64z48pl9c7us37ajv9u8qj9w8xg | + | Sender: <account address of the token manager> |
Receiver: erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u | Receiver: erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u | ||
Value: 50000000000000000 # (0.05 EGLD) | Value: 50000000000000000 # (0.05 EGLD) | ||
GasLimit: 60000000 | GasLimit: 60000000 | ||
Data: "issue" + | Data: "issue" + | ||
- | "@416c696365546f6b656e73" + // "AliceTokens" hex encoded | + | "@" + <token name in hexadecimal encoding> + |
- | "@414c43" + // "ALC" hex encoded | + | "@" + <token ticker in hexadecimal encoding> + |
- | "@f3d7b4c0" + // 4091000000 hex encoded | + | "@" + <initial supply in hexadecimal encoding> + |
- | "@06" // 6 hex encoded | + | "@" + <number of decimals in hexadecimal encoding> |
} | } | ||
</code> | </code> | ||
Line 104: | Line 107: | ||
</code> | </code> | ||
You can find more details [[https://docs.elrond.com/tokens/esdt-tokens/#setting-and-unsetting-special-roles | here]] | You can find more details [[https://docs.elrond.com/tokens/esdt-tokens/#setting-and-unsetting-special-roles | here]] | ||
+ | |||
+ | == TASK == | ||
+ | |||
+ | Set roles for your address. | ||
+ | |||
+ | == Minting ESDT Tokens == | ||
+ | |||
+ | An account with the //ESDTRoleLocalMint// role set can perform a local mint. | ||
+ | |||
+ | <code bash> | ||
+ | LocalMintTransaction { | ||
+ | Sender: <address with ESDTRoleLocalMint role> | ||
+ | Receiver: <same as sender> | ||
+ | Value: 0 | ||
+ | GasLimit: 300000 | ||
+ | Data: "ESDTLocalMint" + | ||
+ | "@" + <token identifier in hexadecimal encoding> + | ||
+ | "@" + <supply to mint in hexadecimal encoding> | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | == TASK == | ||
+ | |||
+ | Mint 1.000.000 ESDT Tokens you created. | ||
+ | |||
+ | == Burning ESDT Tokens == | ||
+ | |||
+ | Anyone that holds an amount of ESDT tokens may burn it at their discretion, effectively losing them permanently. This operation reduces the total supply of tokens, and cannot be undone, unless the token manager mints more tokens. | ||
+ | |||
+ | Do you have roles for burning? | ||
+ | <note tip> | ||
+ | Check the creation transaction. | ||
+ | </note> | ||
+ | |||
+ | <code bash> | ||
+ | LocalBurnTransaction { | ||
+ | Sender: <address with ESDTRoleLocalBurn role> | ||
+ | Receiver: <same as sender> | ||
+ | Value: 0 | ||
+ | GasLimit: 300000 | ||
+ | Data: "ESDTLocalBurn" + | ||
+ | "@" + <token identifier in hexadecimal encoding> + | ||
+ | "@" + <supply to burn in hexadecimal encoding> | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | == Task == | ||
+ | |||
+ | Burn 30% of your ESDTTokens | ||
+ | |||
+ | |||
+ | === Other actions for ESDTTokens === | ||
+ | |||
+ | == Pausing and Unpausing == | ||
+ | |||
+ | The manager of an ESDT token may choose to suspend all transactions of the token, except minting, freezing/unfreezing and wiping. Check more details [[https://docs.elrond.com/tokens/esdt-tokens/#pausing-and-unpausing |here]]. | ||
+ | |||
+ | == Freezing and Unfreezing == | ||
+ | |||
+ | The manager of an ESDT token may freeze the tokens held by a specific Account. As a consequence, no tokens may be transferred to or from the frozen Account. Freezing and unfreezing the tokens of an Account are operations designed to help token managers to comply with regulations. | ||
+ | The manager of an ESDT token may choose to suspend all transactions of the token, except minting, freezing/unfreezing and wiping. Check more details [[https://docs.elrond.com/tokens/esdt-tokens/#freezing-and-unfreezing |here]]. | ||
+ | |||
+ | == Wiping == | ||
+ | |||
+ | The manager of an ESDT token may wipe out all the tokens held by a frozen Account. This operation is similar to burning the tokens, but the Account must have been frozen beforehand, and it must be done by the token manager. Wiping the tokens of an Account is an operation designed to help token managers to comply with regulations. | ||
+ | The manager of an ESDT token may choose to suspend all transactions of the token, except minting, freezing/unfreezing and wiping. Check more details [[https://docs.elrond.com/tokens/esdt-tokens/#wiping |here]]. | ||
+ |