Skip to Content
ReferenceRPCMainnet Follow

Mainnet Follow

Pin contract state to the live chain your Stagenet forks. A followed account or slot always reads the current mainnet value — even after transactions on your Stagenet have written to it.

For the full mechanics (read/write semantics, what to follow and what never to follow), see Mainnet Follow.

Following is a standing mode, not a one-shot copy: reads stay live from the moment you follow, writes are visible within a transaction/block but discarded at block seal, and the registry survives restarts.

dev_followAccount

Follow everything on a contract: every storage slot, plus the account record (ETH balance, nonce) and its code. Use for contracts holding only market state — AMM pools, settlement contracts, oracles.

ParameterTypeDescription
addressstring0x-prefixed contract address
curl -X POST <YOUR_STAGENET_RPC_URL> \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "dev_followAccount", "params": ["0xc9034c3E7F58003E6ae0C8438e7c8f4598d5ACAA"] }'

Returns:

{ "address": "0xc9034c3e7f58003e6ae0c8438e7c8f4598d5acaa", "followed": true, "residueCleared": 623 }

residueCleared is the number of previously-persisted local slots that were removed (any locally-persisted account record or code is cleared as well) — the contract reads fully live from this moment.

Direct dev writes to followed account-level state (dev_setBalance, dev_setNonce, dev_setCode) return an error while the account is followed, the same way dev_setStorageAt does for followed slots — unfollow first.

Contracts deployed on your Stagenet can’t be followed (they have no mainnet counterpart); the call returns an error.

dev_unfollowAccount

Stop following a contract. Local history for it is cleared, so it behaves as never-touched: it keeps tracking mainnet until your next write.

ParameterTypeDescription
addressstring0x-prefixed contract address

Returns { address, removed, residueCleared }.

dev_followTokenBalance

Follow a single holder’s balance on a token — without computing the storage slot. The Stagenet discovers balanceOf[holder]’s slot by probing the contract (works with proxies and non-standard layouts), then follows just that key. Other balances on the token are untouched.

ParameterTypeDescription
tokenstringERC20 contract address
holderstringThe holder whose balance should track mainnet
curl -X POST <YOUR_STAGENET_RPC_URL> \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "dev_followTokenBalance", "params": [ "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "0x67336CeC42645F55059efF241CB02eA5cC52FF86" ] }'

Returns:

{ "token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "holder": "0x67336cec42645f55059eff241cb02ea5cc52ff86", "slot": "0x6e91f60197c982353033e86512311820683e018e0f39963c5d00c2c490bc45d3", "residueCleared": 1 }

dev_unfollowTokenBalance

Stop following a holder’s balance on a token (same slot discovery). Returns { token, holder, slot, removed }.

dev_followSlots

Follow specific storage slots on a contract, when you know the keys (allowances, custom mappings, packed words).

ParameterTypeDescription
addressstringContract address
slots(string | number)[]0x-prefixed 32-byte slot keys, or decimal slot numbers — "10" / 10 is declared slot ten, not 0x10
curl -X POST <YOUR_STAGENET_RPC_URL> \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "dev_followSlots", "params": [ "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", ["0x6e91f60197c982353033e86512311820683e018e0f39963c5d00c2c490bc45d3", "3"] ] }'

Returns { address, followedSlots, residueCleared }.

dev_unfollowSlots

Stop following specific slots. Same parameters; returns { address, removed, residueCleared }.

dev_getFollowed

Returns everything currently followed on the Stagenet. No parameters.

{ "accounts": ["0xc9034c3e7f58003e6ae0c8438e7c8f4598d5acaa"], "slots": { "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": [ "0x6e91f60197c982353033e86512311820683e018e0f39963c5d00c2c490bc45d3" ] } }

dev_setStorageAt on a followed key returns an error — the write would be silently masked. Unfollow the key first.

Last updated on