Skip to Content
ReferenceCLIOverview

CLI

Run Stagenet operations from your terminal — push contracts, generate funded wallets, override balances and state, and track on-chain data as it evolves.

Commands

Install

The contract.dev npm package contains both the CLI and the SDK.

npm install contract.dev

Setup

Create a contract.dev.js file in your project root:

npx contract.dev init

Get your Stagenet’s RPC URL from your project dashboard and add it:

/** @type {import('contract.dev').Config} */ module.exports = { rpcUrl: "<YOUR_STAGENET_RPC_URL>", };

Use contract.dev.cjs instead if your package.json has "type": "module".

Run your first command

From your project root:

# Upload your Hardhat/Foundry project's compiled contracts to your Stagenet # They will have Workspaces auto-generated for them when they are deployed contract.dev push-contracts # Generate a funded wallet on your Stagenet contract.dev generate-wallet # Mint USDC to a recipient contract.dev erc20-balance add 0xRecipient \ 0xUSDC \ 1000000000 # 100 USDC (6 decimals) # Set the on-chain value of a storage slot contract.dev state set-storage 0xContract... \ --slot 0x0000000000000000000000000000000000000000000000000000000000000000 \ --value 0x000000000000000000000000000000000000000000000000000000000000002a
Last updated on