Skip to main content
In this guide you deploy a contract with constructor arguments to BOT Chain testnet in two ways: a one-line forge create, and a repeatable forge script.
Everything on this page uses testnet (chain 968). Get free test tokens from the faucet.

What you’ll build

A Greeter contract on testnet, deployed and verified on BOTScan in one command.

Prerequisites

  • A Foundry project configured for BOT Chain with the uzo-dev keystore. Follow Set up Foundry first.
  • At least 0.01 tBOT in uzo-dev.

Steps

1

Add the contract

src/Greeter.sol
2

Option 1: deploy with forge create

forge create deploys one contract. Put --constructor-args last, because it takes every value after it.
Cast asks for your keystore password, then prints:
Output
Without --broadcast, forge create only simulates the deploy.
3

Option 2: deploy with a script

A script is Solidity code that runs your deploy steps. Use it when you deploy more than one contract or need setup calls after the deploy.
script/DeployGreeter.s.sol
Run it, and verify on BOTScan in the same command:
Forge simulates first, sends the transaction, waits for it, then submits the source. The output ends with All (1) contracts were verified!. Forge records the run in broadcast/DeployGreeter.s.sol/968/run-latest.json.

Verify it worked

Read the greeting back from the chain:
You should see the string you deployed with. Open https://scan.bohr.life/address/0xYOUR_GREETER to see the contract on BOTScan.

Deploy to mainnet

Mainnet deploys cost real BOT and can’t be undone. Use a separate keystore for mainnet and run the script without --broadcast first to check the simulation.
Swap the RPC alias and the verifier URL:

Troubleshooting

You left out --broadcast, so Forge only simulated the deploy. Add it and run again.
--constructor-args takes every value that follows it, so a flag placed after it becomes an argument. Move --constructor-args to the end of the command.
Check that the verifier URL ends in /api/, with the trailing slash. To retry only the verification, use forge verify-contract; see Verify with Foundry.
If you pass --priority-gas-price or --with-gas-price, use at least 20gwei. Otherwise leave them out and Forge reads the right value from the node.

Next steps

Verify with Foundry

Verify a contract that is already deployed.

Set up wagmi

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