A use case for ERC-20 token advanced features (Part III)
In the last tutorials, we have seen how to create a new ERC-20 token with WPSmartContracts plugin and how to use the basic features of a token like transfer, approve and transfer from.
Now we are going to see how to use more advanced features using the wallet provided in this WordPress plugin for Ethereum contracts.
Burn
Burn a token, means to destroy a number of tokens forever. You can burn tokens that you own or tokens previously approved to you.
Imagine that you are a user of the fictional software Terabyte Online Media (Tom), you have one license of the software, and you want to renounce the right to use it.
In this case, you can click on the button “Burn”, approve the transaction and destroy your license forever. This option, like any other action in the blockchain, is not reversible.
Also, you can burn tokens that were previously approved to you, for that you can use the option “Burn from”.
For more details on how to do this, click on the video.
Mint
Mint is the process to create new tokens out of the air, this will also increase the total supply of the coin.
Imagine that in our fictional software license token (Tom), we sold all the licenses and we want to create a few new licenses to sell.
In this case, the owner of the contract, or authorized accounts, can mint new tokens.
To do that, you just need to be logged in with your min/authorized account, click “Mint”, add the beneficiary account, and the total amount it will receive. Then confirm the transaction in Metamask.
Pause and resume token activity
Authorized accounts can pause all token activity in your contract.
Imagine that the software Tom is going through a major technological refactoring. During this time, the company wants to prevent errors in the process, so they decided to pause all activity in the Tom token.
To do that simply click “Pause” button in the wallet, confirm the transaction and that’s it. After a few minutes, your wallet and all software using your token will receive a message with an error exception indicating that your token is paused.
When you are ready to restart your token activity, click on “Resume”, confirm your transaction and after a few minutes, your token will be back to normal.
It is also possible to assign different roles to different accounts, like minter or pauser roles.
For more information please visit:
- https://WPSmartContracts.com
- https://wordpress.org/plugins/wp-smart-contracts/
- https://twitter.com/wpsmartcontract
See you on the web and enjoy your favorite ERC-20 token flavor.