Prerequisites
- Foundry installed (
forge,cast, andanvilavailable in your PATH) - A wallet with a private key you control (a fresh test key is fine — never use a key holding real funds on testnet)
- An internet connection to reach the testnet RPC and faucet
1. Create a new Foundry project
Run the following command to scaffold a fresh project:src/ directory with a sample Counter.sol contract and a matching test file. You will deploy this contract as-is — the goal is to get something real on-chain, not to write novel Solidity.
2. Review the contract you are deploying
Open src/Counter.sol. It contains two functions:number is a public state variable stored on-chain. increment() and setNumber() are the two ways to change it. Reading number costs no gas — it is a free eth_call.
3. Configure the Stable testnet
Create a file named .env at the project root to store your network credentials:[profile.default] section:
stable_testnet. Stable is EVM-compatible, so no other configuration is needed.
Checkpoint: Confirm your RPC endpoint is reachable:
2201 is the Stable testnet. If you see this number, your machine can reach the network.
4. Get your wallet address
Derive your deployer address from your private key so you know which account to fund:5. Fund your wallet with USDT0
Stable uses USDT0 as its gas token — the same asset you use to pay for goods and services, used directly to pay for computation. There is no secondary native token. Visit the testnet faucet and request funds:Checkpoint: Confirm your balance arrived:
0, wait a few seconds and re-run — Stable produces a new block roughly every 0.7 seconds, so funds settle quickly.
6. Deploy the contract
Run the deployment withforge create:
Checkpoint: The output should look like this:
Deployed to address. You need it in the next two steps.
7. Call a write function
Now callsetNumber() to store a value on-chain:
42 is now stored in the number variable on the Stable testnet.
8. Read state from the chain
Callnumber() to read the value back. This is a free read — no transaction, no gas:
9. Inspect your deployment on Stablescan
Open the Stable testnet block explorer and paste your contract address:setNumber call you made. Stablescan is the canonical tool for inspecting on-chain state, verifying contract source code, and reading transaction history on Stable.
What you have built
You deployed a contract, sent a state-changing transaction, and read on-chain state — all on the Stable testnet. You now know how to:- Configure Foundry (or any EVM toolchain) to target Stable using a standard RPC endpoint
- Fund a wallet using the USDT0 faucet
- Pay for transactions with USDT0 as the gas token
- Inspect your work on Stablescan
- JSON-RPC API — see which
eth_methods Stable supports and any differences from mainline Ethereum - Gas & Pricing — understand how USDT0-denominated fees are calculated
- Testnet Information — full network parameters, contract addresses, and bridge details

