Remix is a web-based IDE for writing, compiling, and deploying contracts.
Before using Remix to develop on ThunderCore testnet, we need to add ThunderCore testnet and get some testnet gas fee:
- 2.Search for
- 3.Click connect, adding ThunderCore testnet and mainnet:
- 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:
TT20 template contract
Great, we can work on Remix now.
- 1.Go to "File explorers"
contractsfolder 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
- 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
mintfunction if you don't want your token being mintable.
Okay, we are ready to compile it.
- 1.Click TT20 contract, and go to "Solidity compiler" tab
- 2.The compiler settings are:
- COMPILER: 0.5.17+commit.d19bba13
- EVM VERSION: EVM VERSION: london
- Auto compile: clicked
- Enable optimization: clicked and select
- 3.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.
- 4.After successful compilation, the tab will look like:
Now we can deploy compiled contract to ThunderCore network.
- 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
90000000which 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!