Add a Workspace
Attach a Workspace (per-address dashboard) to a wallet, a mainnet contract, or a contract you’ve deployed and have an ABI for.
For bulk creation from a Hardhat/Foundry project’s compiled artifacts, use push-contracts instead.
Usage
With a contract.dev.js at your project root (see Setup):
contract.dev workspace add <address> --name <name> [--abi <json>] [--type <ERC20|ERC721>]
contract.dev workspace add --name <name> --abi <json> # ABI-only, no addressYou never declare the Workspace “type” — the CLI infers it from what you provide.
| You provide | What gets created |
|---|---|
<address> only, no on-chain code at the address | wallet Workspace |
<address> only, code matches mainnet | mainnet-contract Workspace (ABI fetched from Etherscan on demand) |
<address> and --abi | manual Workspace, with deployment linked to the address |
--abi only, no address | manual Workspace, ABI-only (use this to scaffold before deploy) |
Each created Workspace prints its kind in the output so the inference is never a mystery.
Examples
A whale’s wallet
contract.dev workspace add 0x28C6c06298d514Db089934071355E5743bf21d60 --name "Binance Hot Wallet"The address has no on-chain code, so a wallet Workspace is created. The dashboard shows balances and incoming/outgoing transactions.
A real mainnet contract
contract.dev workspace add 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 --name "USDC" --type ERC20The address has code matching mainnet, so a mainnet-contract Workspace is created. The ABI is fetched from Etherscan on demand. --type is a UI hint — pass ERC20 or ERC721 to enable token-specific views.
A contract you deployed
contract.dev workspace add 0xYourVault \
--name "MyVault" \
--abi "$(jq -c .abi out/MyVault.sol/MyVault.json)"The ABI tells the CLI you want a manual Workspace, regardless of what’s at the address on-chain. The deployment is linked to the address you passed.
ABI-only (no address yet)
contract.dev workspace add --name "FutureVault" \
--abi "$(jq -c .abi out/Vault.sol/Vault.json)"Useful for scaffolding a Workspace before deploy. Bytecode is stored as 0x until you re-run with --address to link a deployment.
Errors
Address has code but doesn’t match mainnet
If you call workspace add <address> for a contract you deployed on your Stagenet outside push-contracts (e.g. via Remix, a custom script, or state set-code), the CLI returns:
0xAddr is deployed on your Stagenet but needs an ABI to have a Workspace created for it.
• pass --abi <json>
• or run `contract.dev push-contracts` from a Hardhat/Foundry projectA Stagenet-only deployment without an ABI would produce a Workspace with no decoded calls or events — silently broken. The CLI refuses up-front so you can recover with one of the two paths above.
Other validation errors
Missing required <address>— you passed neither an address nor--abi.--type must be "ERC20" or "ERC721"—--typeonly accepts those two values.
SDK equivalent
const result = await stagenet.addWorkspace({
address: "0x28C6c06298d514Db089934071355E5743bf21d60",
name: "Binance Hot Wallet",
});
result.kind; // → "wallet" | "mainnet-contract" | "manual"The result is a discriminated union — switch on kind to read the per-flavor fields. See SDK reference.