Stagenet Quickstart
Deploy a Foundry or Hardhat project to a Stagenet and inspect the deployed contracts in their dashboards.
You do not need to change your contracts or scripts. All you need is a Hardhat or Foundry project with a deployment script or command.
Create a Stagenet
In the app, open Stagenets and click + Create stagenet. Pick the chain you want to replicate.
Install the CLI and sign in
npm install -g contract.dev
contract.dev loginThen point the CLI at your new Stagenet:
contract.dev stagenets # list your workspace's stagenets
contract.dev stagenet use my-stagenetPush your contracts
Compile, then push the compiled contracts to your Stagenet:
# Foundry
forge build
# Hardhat
npx hardhat compile
# Then, from either project type
contract.dev push-contractsPushing lets your Stagenet recognise your contracts when they are deployed, so each deployment gets a dashboard automatically.
Deploy
Generate a funded deployer wallet:
contract.dev generate-walletGenerated wallet
Address: 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1
Private key: 0xa3f7c1d2e9b4f5a6c8d0e1f2a3b4c5d6e7f8091a2b3c4d5e6f7081920a1b2c3d
Save the private key now — it is not stored.
Funding wallet...
Funded with 1,000,000 ETH.Copy your Stagenet’s RPC URL from its dashboard, then deploy with your normal flow:
Foundry
Add the RPC URL and the funded private key to your .env:
STAGENET_RPC_URL=<YOUR_STAGENET_RPC_URL>
PRIVATE_KEY=<YOUR_FUNDED_PRIVATE_KEY>source .env
forge script script/Counter.s.sol:CounterScript --rpc-url $STAGENET_RPC_URL --private-key $PRIVATE_KEY --broadcastHardhat V2
Add a stagenet network to hardhat.config:
module.exports = {
solidity: "0.8.21",
networks: {
stagenet: {
url: "<YOUR_STAGENET_RPC_URL>",
accounts: ["<YOUR_FUNDED_PRIVATE_KEY>"],
},
},
};npx hardhat run scripts/my-deploy-script.js --network stagenetHardhat V3
Add a stagenet network to hardhat.config:
export default defineConfig({
networks: {
stagenet: {
type: "http",
chainType: "l1",
url: "<YOUR_STAGENET_RPC_URL>",
accounts: ["<YOUR_FUNDED_PRIVATE_KEY>"],
},
},
});npx hardhat run scripts/my-script.js --network stagenetIf you deploy with Ignition, use the default build profile so pushed contracts are matched:
npx hardhat ignition deploy ignition/modules/MyModule.ts --network stagenet --build-profile defaultInspect your contracts
Open your Stagenet’s Contracts & Wallets page. Each deployed contract now has a dashboard: live overview, balances and approvals, an interact panel for calling functions, and decoded storage.
See Contracts & Wallets for what’s inside.