contract.dev

TypeScript SDK and CLI for your Stagenet

Upload contract artifacts from Hardhat or Foundry, run realistic testing flows, and manage Stagenet state directly from scripts.

contract.dev

Install

npm install contract.dev

Start

contract.dev init

// What you can do

Work directly with your Stagenet

Upload Hardhat and Foundry contract artifacts

Mint native tokens and ERC20s

Impersonate accounts over JSON-RPC

Override code, nonce, and storage state

Auto-create Workspaces when uploaded contracts are deployed

// Setup

Get configured in minutes

01Install the package with npm.

02Run contract.dev init in your project root.

03Add your Stagenet RPC URL to contract.dev.js (or contract.dev.cjs for ESM projects).

// CLI

Upload contracts to your Stagenet

The CLI reads your compiled artifacts and matches them against deployments. When a matching uploaded contract is deployed, a Workspace is created automatically.

Commands

contract.dev init

contract.dev upload-contracts

Note

Build first with forge build or npx hardhat compile.

// SDK

Interact from scripts

Use createStagenet() to mint balances, impersonate accounts, and override state for scenario-driven testing.

Code

import { createStagenet } from "contract.dev";

const stagenet = createStagenet();

await stagenet.addBalance(addr, 10n ** 18n);

await stagenet.impersonateAccount(whale);

// Workspaces

Dashboards generated automatically

A Workspace is created whenever a previously uploaded contract is deployed to your Stagenet, giving your team a contract-specific dashboard out of the box.

Transactions
Balances
TVL
Storage
Tracked data

Docs

Full SDK and CLI reference is available in the docs.