Skip to main content
In this guide you deploy a contract to BOT Chain testnet with Hardhat Ignition, then read it back from a script.
Everything on this page uses testnet (chain 968). Get free test tokens from the faucet.

What you’ll build

An Ignition module that deploys Counter, a record of the deployment in your project, and a script that reads the deployed contract.

Prerequisites

  • A Hardhat 3 project set up for BOT Chain, including the fee hook. Follow Set up Hardhat first.
  • BOT_PRIVATE_KEY set in the Hardhat keystore or your terminal, for a wallet with at least 0.01 tBOT.
  • contracts/Counter.sol from the setup guide.

Steps

1

Write an Ignition module

An Ignition module describes what to deploy. Ignition works out the order and keeps a journal, so a failed deploy can resume where it stopped.
ignition/modules/Counter.ts
If your contract takes constructor arguments, pass them as an array: m.contract("Greeter", ["Hello"]).
2

Deploy to testnet

Ignition asks you to confirm the network. Type y. When it finishes you’ll see output like:
Output
Your address will be different. Ignition also saves it in ignition/deployments/chain-968/deployed_addresses.json.
3

Read the contract from a script

scripts/read-counter.ts
You should see count is 0.

Verify it worked

  • Run npx hardhat ignition status chain-968. It prints Deployment chain-968 (chainId: 968) was successful and the address.
  • Open https://scan.bohr.life/address/YOUR_ADDRESS. BOTScan shows the contract and the deploy transaction.
Next, verify the source so others can read it on BOTScan.

Deploy to mainnet

Mainnet deploys cost real BOT and can’t be undone. Test on testnet first and use a separate key for mainnet.
Use the same module with the mainnet network:
Ignition stores mainnet deployments in ignition/deployments/chain-677.

Troubleshooting

Ignition sent a fee of 0 because BOT Chain’s base fee is 0. Add the fee hook from Set up Hardhat, then deploy again.
Ignition resumes from its journal. If the earlier run failed before anything was sent (for example, an RPC error), delete ignition/deployments/chain-968 and deploy again. Don’t delete it if a contract was deployed, or Ignition will deploy a second copy.
Your wallet needs tBOT. Check the address with the script in Set up Hardhat and claim from a faucet.
The public RPC sometimes drops a request. Run the same deploy command again; Ignition picks up where it stopped.

Next steps

Verify with Hardhat

Publish your source on BOTScan.

Set up wagmi

Call your contract from a web app.
Last modified on October 3, 2026