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
- Push compiled contracts from your Hardhat or Foundry project to your Stagenet (initialises a Workspace per contract).
- Generate funded wallets for use on your Stagenet.
- Set native and ERC20 balances on your Stagenet.
- Set code, nonce, and storage on your Stagenet.
- Impersonate accounts when sending transactions.
- Apply function overrides to smart contract reads.
- Track and graph balances, storage slots, and function results as they evolve on your Stagenet.
Install
The contract.dev npm package contains both the CLI and the SDK.
npm install contract.devSetup
Create a contract.dev.js file in your project root:
npx contract.dev initGet 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 0x000000000000000000000000000000000000000000000000000000000000002aLast updated on