Deploy a Contract on Shape
Deploy a smart contract to Shape Sepolia and verify it on the block explorer using Foundry.
Prerequisites
- Foundry installed
- Shape Sepolia ETH from the Alchemy Faucet
- A wallet private key funded with testnet ETH
1. Create a Project
forge init my-shape-contract
cd my-shape-contractThis scaffolds a project with a Counter.sol contract in src/.
2. Deploy
forge create src/Counter.sol:Counter \
--rpc-url https://sepolia.shape.network \
--private-key $PRIVATE_KEYSave the Deployed to address from the output.
3. Verify on the Explorer
forge verify-contract <DEPLOYED_ADDRESS> src/Counter.sol:Counter \
--verifier blockscout \
--verifier-url https://explorer-sepolia.shape.network/api/Replace <DEPLOYED_ADDRESS> with the address from step 2.
4. Deploy to Mainnet
When ready for mainnet, use the mainnet RPC and verify against the mainnet explorer:
forge create src/Counter.sol:Counter \
--rpc-url https://mainnet.shape.network \
--private-key $PRIVATE_KEYforge verify-contract <DEPLOYED_ADDRESS> src/Counter.sol:Counter \
--verifier blockscout \
--verifier-url https://shapescan.xyz/api/5. Register for Gasback
Gasback returns 80% of sequencer fees to contract owners. Register your deployed contract to start earning.
See Registering Your Contract for Gasback for the full walkthrough.
Next Steps
- Build a dApp with the Shape Builder Kit
- Connect to Shape from your frontend
- Gasback (how fee reclamation works)
Last updated on