What you’ll build
A TypeScript Hardhat 3 project with:botTestnetandbotMainnetnetworks.- A private key read through
configVariable, so it stays out of your code. chainDescriptorsthat point Hardhat at BOTScan for verification.- A small network hook that fixes the fee Hardhat Ignition sends on BOT Chain.
Prerequisites
- Node.js 22 or later. These docs were tested with Node 24.
- A testnet wallet with some tBOT. See Get testnet tokens.
Steps
1
Create the project
hardhat 3.18.1, @nomicfoundation/hardhat-toolbox-viem 5.0.7 and @nomicfoundation/hardhat-ignition 3.1.8.2
Add the fee hook
BOT Chain blocks have a base fee of 0. Hardhat Ignition reads that as “gas is free” and sends transactions with a fee of 0, which the node rejects with Transactions that already carry a fee pass through unchanged, so the hook is safe on other chains too.
transaction underpriced. This hook asks the node what tip it wants and adds it.plugins/bot-chain-fees.ts
3
Write the config
hardhat.config.ts
evmVersion: "cancun"stops the compiler from using opcodes BOT Chain doesn’t support yet.configVariable("BOT_PRIVATE_KEY")is resolved only when a task needs it, sonpx hardhat buildworks without a key.chainDescriptorstells Hardhat that BOTScan is a Blockscout explorer.hardhat verify blockscoutuses it. No API key is needed.
4
Provide your private key
Use a key made only for testing. You have two options.Option 1: the Hardhat keystore (recommended). The key is stored encrypted on your machine and Hardhat asks for the password when it needs it.Option 2: an environment variable for the current terminal session only.
5
Add a contract and compile
contracts/Counter.sol
Verify it worked
Check that Hardhat can reach the network and load your key with a small script:scripts/check-network.ts
Chain ID: 968, your address and your tBOT balance.
Troubleshooting
transaction underpriced: effective gas tip 0, minimum needed 20000000000
transaction underpriced: effective gas tip 0, minimum needed 20000000000
The fee hook isn’t loaded. Check that
plugins/bot-chain-fees.ts exists and that the config imports it as ./plugins/bot-chain-fees.js (with .js, even though the file is .ts).HHE7 or a missing configuration variable error
HHE7 or a missing configuration variable error
Hardhat couldn’t find
BOT_PRIVATE_KEY. Set it with the keystore or export it in the same terminal you run Hardhat from.invalid opcode or a deploy that reverts with no reason
invalid opcode or a deploy that reverts with no reason
You compiled for a newer EVM version. Make sure
evmVersion: "cancun" is set, then run npx hardhat clean and build again.Next steps
Deploy with Hardhat
Deploy
Counter to testnet with Ignition.Verify with Hardhat
Publish your source on BOTScan.