Using Remix

Remix is a web-based IDE for writing, compiling, and deploying contracts.

Before Using Remix

Before using Remix to develop on ThunderCore testnet, we need to add ThunderCore testnet and get some testnet gas fee:

  1. The fastest way to add ThunderCore networks is adding them by visit Chainlist.

  2. Search for ThunderCore:

  3. Click connect, adding ThunderCore testnet and mainnet:

  4. You can add ThunderCore testnet explorer to network settings from Metamask Settings > Networks:

  5. Now we need some gas fee to deploy. So we just visit ThunderCore Faucet and paste the public address to get some testnet TT:

  6. Download the TT20 template contract if you need:

Great, we can work on Remix now.

Setting up Remix IDE

Visit Remix to access the Remix IDE from your web browser.

  1. Go to "File explorers"

  2. Click contracts folder in your workspace, choose your prefered way to adding contracts. In here, we are using downloaded TT20 template contract in previous step. Click the "Load a local file into current workspace" icon and upload the file into contracts folder.

  3. Rename the token name and symbol, and the initial total-supply amount which will mint to your account when deployment is done:

  4. You can choose to remove the mint function if you don't want your token being mintable.

Okay, we are ready to compile it.

Compile smart contract

  1. The compiler settings are:

    • COMPILER: 0.5.17+commit.d19bba13

    • EVM VERSION: EVM VERSION: london

    • Auto compile: clicked

    • Enable optimization: clicked and select 200

  2. Click on Compile TT20 button. If the button doesn't display the right contract name, you'll need to go back to files tab and select the correct one.

Now we can deploy compiled contract to ThunderCore network.

Deploy Contract to ThunderCore Testnet

  1. Go to "Deploy & run transactions" tab.

  2. In the "environment" selection, we choose "Injected Web3". It will connect to MetaMask to get network settings:

  3. You can change the "Gas Limit" to 90000000 which is ThunderCore network's limit. However in this contract, we don't need so much gas to deploy, so you can keep it as default.

  4. In the "Contract" selection, choose the "TT20" contract:

  5. Click on "Deploy" button and confirm the transation:

  6. You shall find the contract address display in "Deployed Contracts". You can open it and test around those functions:

Congratulations! You have successfully deployed a TT20 token on ThunderCore testnet. Keep developing more interesting contracts!

Last updated