What you’ll build
ACounter contract deployed to BOT Chain testnet from Remix, which you can call from the Remix panel.
Prerequisites
- MetaMask (or another browser wallet) with BOT Chain testnet added. See Connect a wallet.
- Some tBOT in that wallet. See Get testnet tokens.
Steps
1
Create the contract
Open remix.ethereum.org. In the File explorer, create a file named
Counter.sol in the contracts folder and paste:Counter.sol
2
Compile for Cancun
Open the Solidity compiler tab.
- Pick compiler version
0.8.28or later. - Open Advanced configurations and set EVM version to
cancun. - Click Compile Counter.sol.
3
Connect MetaMask
Open the Deploy & run transactions tab. Set Environment to Injected Provider - MetaMask (the exact label depends on your wallet). Approve the connection in MetaMask.Check that MetaMask is on BOT Chain Testnet. Remix shows the chain ID under the environment, and it should say
968.4
Deploy
Select
Counter in the Contract list and click Deploy. MetaMask opens. Check the network and fee, then confirm.BOT Chain needs a priority fee of at least 20 gwei. MetaMask reads this from the node, so the default fee works. See Gas and fees.Verify it worked
- Under Deployed Contracts, expand
Counter. - Click count. It returns
0. - Click increment and confirm in MetaMask.
- Click count again. It returns
1.
https://scan.bohr.life/address/YOUR_ADDRESS to see it on BOTScan. To publish the source, follow Verify in the BOTScan UI and use the same compiler version, optimizer setting and EVM version you used in Remix.
Troubleshooting
Remix shows the wrong chain ID
Remix shows the wrong chain ID
MetaMask is on another network. Switch to BOT Chain Testnet in MetaMask; Remix updates on its own.
The transaction fails with invalid opcode
The transaction fails with invalid opcode
The EVM version is not set to
cancun. Set it in Advanced configurations, compile again and redeploy.insufficient funds
insufficient funds
Your wallet has no tBOT on testnet. Claim some from a faucet; see Get testnet tokens.
Next steps
Verify in the BOTScan UI
Publish your source code by hand.
Choose a toolchain
Move to Hardhat or Foundry when your project grows.