Issuing a TRC-20 token

Walkthrough for deploying a TRC-20 token on TRON using TronLink and the TRONSCAN contract deployment tool.

📘

Prerequisites

Deploying a smart contract on TRON can be done in several ways depending on the tools you choose. This guide uses the TRONSCAN Contract Deployment tool. For other tools, refer to their respective documentation.

1. Prepare TronLink

Make sure you have installed the TronLink extension and connected it to the correct network (Mainnet or testnet). If you have not installed TronLink yet, visit the TronLink Chrome Web Store page to download the latest version. Also ensure the account holds enough resources (Energy/Bandwidth) or TRX.

2. Prepare the TRC-20 contract code

Before deploying a custom TRC-20 token, finalize your contract code. This guide uses the TRC-20 Contract Template.

Adjust the following parameters before deployment:

  • Token name — change to your desired name (example: "TestTokenName")
  • Token symbol — your token's short symbol (example: TTN)
  • Decimals — number of decimal places, specified by the project based on its business needs. Common values in the TRON ecosystem include 6 and 18
  • Total supply — defined in the constructor. The initial supply is multiplied by 10 ** decimals for precision (example: 10000000000)
// Solidity compiler version: 0.5.10
// Keep the optimizer setting consistent across deployment and source verification.
pragma solidity 0.5.10;

/* ....Please copy the full code from the example code and update the following section!*/
/**
 * @dev 5. Final Token Business Contract 
 */
contract Token is TRC20, TRC20Detailed {
    /**
     * @dev Constructor that assigns all pre-assigned tokens to the creator.
     * Replace "YourTokenName" and "YTN" with your desired values.
     */
    constructor () public TRC20Detailed("YourTokenName", "YTN", 18) {
        /**
         * @dev Mint initial supply. 
         * Total Supply = 10,000,000,000 * 10^18 (if decimals is 18)
         */
        _mint(msg.sender, 10000000000 * (10 ** uint256(decimals())));
    }
}

3. Deploy the TRC-20 contract

Deploying a TRC-20 contract is straightforward with the TRONSCAN Contract Deployment tool.

  • Connect your wallet and confirm the account holds enough TRX.
  • Upload the contract files: Token.sol.
  • Compile the contract with these parameters:
    • Solidity compiler version: select 0.5.10
    • Optimization: Activated
    • Runs: default value 0
  • Deploy the contract — choose Token as the main contract.

4. Verify the TRC-20 contract (optional)

Open the TRONSCAN Verification tool and enter the required contract details. For more on contract verification, see Contract verification.

  • Contract address: the address used during deployment
  • Main contract: the main contract name (typically Token)
  • Solidity compiler version: 0.5.10
  • License: choose None if not applicable
  • Optimization and Runs: set Optimization to Activated, leave Runs as 0
  • Click Upload Contract File(s), select your contract source code files, and upload them. The uploaded code must exactly match the version deployed on the chain, including all dependency files.
  • Complete the CAPTCHA check.
  • Click Verify and Publish.
  • Once verification succeeds, you can view the contract details on TRONSCAN.

5. Record the TRC-20 token

The TRONSCAN Record tool lets token creators record their TRC-20 token information on TRONSCAN — basic info, contract info, and social media profiles.

  • For token type, choose TRC-20 and click Confirm.
  • Fill in the TRC-20 token details — basic information, contract information, and social media profiles.
🚧

Match the contract exactly

The details you enter must match exactly with the information in your deployed TRC-20 contract.

  • Double-check the information and sign. Once complete, a confirmation appears showing your token has been recorded on the TRON network.
  • To update the token information later, go to the wallet details page and click Update a Token.

6. Add the token to TronLink

  • Click the + button on the TronLink homepage and search by your TRC-20 contract address. The token details appear automatically — click + on the right to add the token to your asset list. The token then appears on your wallet homepage and supports transfers and other operations.
  • For more details, search for the contract on TRONSCAN.
📘

Token must be recorded first

TronLink can add tokens to the wallet homepage on Mainnet and the Shasta testnet, but the target token must have been recorded on TRONSCAN. Allow about 15 minutes for data synchronization before searching for it in TronLink.


Related resources