Create SPL-TOKEN on Fixing Playground/Solana: Step by Step
Are you ready to lie to the Token Solana SPL? In this article, we guide you through the process of creating token SPL, with the Solana Anchor Game Space. At the end of the guide, there will be a fully functional SPL token SPL with a 2% burn at all transactions and an automatic stop burning mechanism when it reaches 65% of the total offer.
Prerequisites
- You have one set and works on anchor node
- Installed SDK Solana for recording (available on [ ( ) )))))))))))))))))))))
- There is a basic knowledge of the concepts of treating Solana blockchain and token
Step 1: Create a new token
If you create a new token on the anchor, follow these steps:
- Start the fixing CLI by implementing the «anchoring» of the terminal.
- Select «Token» from the Drop -Down menu.
3
- Enter a symbolic name: Theltcoin
- Set a symbol: Taltc
- Enter a full offer: 99.99.99.999.999
Step 2: Configure token SPL
functions
We need to configure token SPL functions:
- Place on the «Functions» tab.
- Add the following strength code to
Thealtcoin.sol:
Solidity
Pragma solidity ^0.8.0;
Import «@Solana/Splitt-token/Imppl/Splagadapers.sol»;
Struct thealtcoin {
face public tokenaddress;
Uint256 public;
}
BruCia function (address _account, quantity uint256) internal {
Requirements (_account! = Address (0), «Burn: Account must be an outside address»);
Request (sum <= totalsupply, "Burns: Insufficient funds");
Spltokokadapers Spltokuadapers = Splutuakadapers Solana_ADAPTERS;
Spltokokadapers.burn (_account, sum);
}
`
3
- Save and reconstruct the token contract with "Sol Buildis.
Step 3: Set the automatic burn
To enable automatic burns, we need to create a personalized spp feature that stops burning when 65% of the total offer is available:
1
- Add the following strength code:
Solidity
Pragma solidity ^0.8.0;
Import «@Solana/Splitt-token/Imppl/Splagadapers.sol»;
Struct thealtcoin {
face public tokenaddress;
Uint256 public;
}
SPL contract {
BruCia function (address _account, quantity uint256) internal {
Requirements (_account! = Address (0), «Burn: Account must be an outside address»);
Request (sum <= totalsupply, "Burns: Insufficient funds");
Spltokokadapers Spltokuadapers = Splutuakadapers Solana_ADAPTERS;
Spltokokadapers.burn (_account, sum);
}
Autoburn Function () public {
Uint256 Newtotalsupply = Totalpuply * 0.65;
Request (Newtotalsupply> 0, «Autob: You can’t burn because of inappropriate funds»);
Totalpuply = Newtotalsupply;
}
}
`
3
- Save and reconstruct the contract with the help ofSol Buildis.
Step 4: Divide token
To spread the token, you need to create a new configuration file:
- Start the fixing CLI by implementing the «anchoring» of the terminal.
- Select «Token» from the Drop -Down menu.
3
8
Step 5: Check token
To check that the token is created correctly, you can use the CLI:
- Start the fixing CLI by implementing the «anchoring» of the terminal.
2.