Using Remix
Last updated
Last updated
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:
The fastest way to add ThunderCore networks is adding them by visit Chainlist.
Search for ThunderCore
:
Click connect, adding ThunderCore testnet and mainnet:
You can add ThunderCore testnet explorer to network settings from Metamask Settings > Networks
:
Now we need some gas fee to deploy. So we just visit ThunderCore Faucet and paste the public address to get some testnet TT:
Download the TT20 template contract if you need:
Great, we can work on Remix now.
Visit Remix to access the Remix IDE from your web browser.
Go to "File explorers"
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.
Rename the token name and symbol, and the initial total-supply amount which will mint to your account when deployment is done:
You can choose to remove the mint
function if you don't want your token being mintable.
Okay, we are ready to compile it.
The compiler settings are:
COMPILER: 0.5.17+commit.d19bba13
EVM VERSION: EVM VERSION: london
Auto compile: clicked
Enable optimization: clicked and select 200
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.
Go to "Deploy & run transactions" tab.
In the "environment" selection, we choose "Injected Web3". It will connect to MetaMask to get network settings:
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.
In the "Contract" selection, choose the "TT20" contract:
Click on "Deploy" button and confirm the transation:
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!
Click TT20 contract, and go to "Solidity compiler" tab
After successful compilation, the tab will look like: