Creating a SPL token on the Anchor/Solana playground: a step -by -step guide

Are you ready to mount yourow ble Sola SPL Simbol? In this article, we will go for the process of creating a SPL Simbol use the Solana Anchor playground. By the end of this guide, you afnctional SPL token, with a burn 2% for all transactions and an an an an an an an an-combustion 65% of the total supply.
Premise
Step 1: Create a new one
To the crate a new one on the anchor, follow thees steps:
Step 2: Configure the SPL token functions
Next, we need to configure the funken SPL functions:
Thealtcoin.Sol file:`Solidity
Pragma solidity ^0.8.0;
Import “@solar/spl-token/spltokenaadapters.sol”;
Structure Thealtcoin {
approach tokenaddress public;
UINT256 Public TotalSuply;
}
Burn function (address _account, suum uint256) internal {
Request (_account! =address (0), “Burn: account must be a non-zero address”);
Request (the subtalsupply, “Burning: Insufficient Funds”);
Spltokenaadapters spltokenaadapters = spltokenaadapters sola_adapters;
spltokenaadapters.burn (_account, sub);
}
`
Step 3: Set up Auto Burning
In order to allow automatic burning, we must crate a personized SPL function that ceses burning wen reaching 65% of theal supply:
Soaltcoin.Sol in the so-same as youror contractor.
Solidity
Pragma solidity ^0.8.0;
Import “@solar/spl-token/spltokenaadapters.sol”;
Structure Thealtcoin {
approach tokenaddress public;
UINT256 Public TotalSuply;
}
SPL contract {
Burn function (address _account, suum uint256) internal {
Request (_account! =address (0), “Burn: account must be a non-zero address”);
Requist (the subtalsupply, “Burning: Insufficient Funds”);
Spltokenaadapters spltokenaadapters = spltokenaadapters sola_adapters;
spltokenaadapters.burn (_account, sub);
}
Autburn () Public Function {
UINT256 NewTalsuply = TotalSupply * 0.65;
Request (NewTalsuply> 0, “Autob: unable to burn due to insufficient funds”);
Totalsuply = NewTtalsuply;
}
}
`
soil.Step 4: Implement the token
To implement the token, you will need to crate a new configuration of the fire:
) in the Dierector of Token Config.Step 5: Check the sin
To check if your token is successfully created, yu can the Anchor CLI:
2.
Yazar hakkında