BONUS - Launch your own token

circle-exclamation

Set up MetaMask and get BTC on Botanix testnet

To get started, you will need the Metamaskarrow-up-right browser extension to create an EVM wallet and some Bitcoin, which you can get by following the steps laid out on this link.

Implement contract

Head over to the Ethereum Remixarrow-up-right IDE and make a new Solidity file, for example <YOUR_NAME>-token.sol . Paste the following code into your new Solidity script:

Replace the following values:

  • Line 52: Replace "QKCToken" with your own name (In the example it is BotanixTestToken)

  • Line 62: symbol = "QKC"; Choose your own symbol

  • Line 63: name = "QuikNode Coin"; Choose your own name

  • Line 64: decimals = 2; set the decimal (value in which tokens can be divided, 0 to 8 decimal units can be used) and establish a total supply value as you wish

  • Line 65 _totalSupply = 100000; Choose a total supply

  • Line 66: balances[YOUR_METAMASK_WALLET_ADDRESS] = _totalSupply; Please change YOUR_METAMASK_WALLET_ADDRESS to your own wallet address (This one can be found in your MetaMask interface)

  • Line 67: emit Transfer(address(0), YOUR_METAMASK_WALLET_ADDRESS, _totalSupply);

circle-info

Note: The total supply value must have additional trailing zeros as specified by the decimals field. For example, the decimals value in this contract is 2 and we need a total supply of 1000 tokens, so we’ll have to set the total supply variable to 100000 (simply because it won’t allow a decimal point).

Compile the smart contract. Make sure you select the right compiler based on the chosen Solidity version.

Deploy it using injected Web3 (make sure to select the Botanix networkon MetaMask before compiling the contract) and select the right contract to be deployed. Approve the transaction from MetaMask.

circle-info

Note: We need to deploy the main token contract, select the name of the contract appropriately under the contracts section before deploying the contract (BotanixTestToken here).

circle-info

Gas fees

If the gas fees appear to high to deploy the contract, try lowering them manually.

circle-info

If you receive an error message before deployment “This contract may be abstract”, make sure to select the appropriate contract under the Contract tab. Confirm the transaction in Metamask.

That’s it! your token contract is now deployed on Botanix!

Get token in MetaMask

To get the token in Metamask, go to the “Deployed Contracts” section in Remix and copy the deployed contract’s address using the copy button near the contract’s name.

Open Metamask, go to the Token tab and click on the Import Tokens button. Paste the contract’s address in the first field. Metamask will fetch the Token Symbol and decimals automatically.

Last updated

Was this helpful?