Nanfeng

Notes on software development, code, and curious ideas

Deploying a TRC-20 Token on the TRON Nile Testnet

This guide demonstrates how to deploy a TRC-20 token contract on the TRON Nile testnet. Use test funds only and verify every wallet request before signing.

Prerequisites

  1. A TRON wallet.
  2. The TronLink browser extension.
  3. Access to TRONSCAN and its Nile testnet pages.

Obtain test TRX

Copy your wallet address from TronLink. Open the Nile test-coin faucet, enter the address under Get 2000 test coins, and click Obtain.

Request test coins

A Successful message indicates that the request completed. Each address can request the funds only once. In TronLink, change the active network to TRON Nile Testnet; test coins are not visible on mainnet.

Open the network selector

Select Nile Testnet

Confirm that the balance arrived:

Test TRX balance

Prepare the TRC-20 contract

Download the five contract files from the example repository. In Token.sol, change the token name, symbol, decimals, and supply as needed. Avoid changing the decimals unless you understand the consequences.

Token settings

Keep the file structure and Solidity syntax intact or compilation will fail.

Compile and deploy

All operations below must use the Nile testnet. Confirm that TRONSCAN URLs begin with nile.:

Confirm the Nile domain

Click Connect Wallet and select TronLink:

Connect Wallet

Select TronLink

Open the Nile contract compiler. Click Upload Contract File, upload all five files, verify the list, and click Compile.

Upload the contract files

Choose Solidity compiler v0.5.10+, leave the other options unchanged, and compile:

Compiler settings

The following state indicates a successful build:

Compilation succeeded

Select Deploy. Change Main Contract to Token, keep the other defaults, and click Confirm:

Deployment settings

Before signing, verify that the request comes from nile.tronscan.org, the correct wallet is selected, and TronLink is connected to Nile Testnet:

Confirm the signature

If a timeout error appears, repeat the signing flow:

Signature timeout

Deployment normally takes one or two minutes. When it succeeds, record the resulting contract address:

Deployment succeeded

Register the token on TRONSCAN

Open the token creation page, choose TRC20, and click Confirm:

Choose TRC20

Enter the new contract address, description, website, and email. Complete all required fields and click Next:

Token information

If TRONSCAN says This address has been recorded... even on the first attempt, follow the link in that notice and click Update Token Information:

Address already recorded

Update token information

Review the details, select Submit, and approve the wallet signature. If registration fails, select Resubmit; adding a token icon before resubmitting may be required.

Resubmit token information

After approval, the token page looks like this:

Registered token

Use the example token page as a reference, replacing its final path component with your contract address.

On the TronLink home page, click +, choose the custom-token option, and enter the contract address. TronLink should populate the remaining fields automatically. Confirm the details to add it.

Add a token

Choose custom token

Token in TronLink

Verify the contract

Open the Nile contract verification page, enter the deployment information, and upload the same five source files:

Verification form

Click Verify And Publish. A successful verification produces this result:

Verification succeeded

The token’s Code page will then display the uploaded source code rather than only hexadecimal bytecode:

Verified source code

+