Impersonate Accounts
Add an address to your Stagenet’s impersonation allowlist from the command line. Once impersonated, your Stagenet will accept eth_sendTransaction requests where from is the impersonated address — no private key required.
Targets your active stagenet — see Target a Stagenet. Backed by the impersonation RPC methods.
Start impersonating
contract.dev impersonate 0x28C6c06298d514Db089934071355E5743bf21d60| Argument | Description |
|---|---|
<address> | The address to impersonate |
--fund <amount> | Optional. Top up the impersonated address with native tokens (e.g. for gas). Accepts decimal, 0x-hex, or "1 ether" / "1000000 wei". |
Funding in one shot:
contract.dev impersonate 0x28C6... --fund "1 ether"Impersonating 0x28c6c06298d514db089934071355e5743bf21d60
funded with +1000000000000000000 wei (new balance: 1000000000000000000)impersonate stop
Remove an address from the allowlist. After this, unsigned transactions from that address are rejected unless you impersonate it again.
contract.dev impersonate stop 0x28C6...impersonate list
Print every address currently on the allowlist (lowercased), one per line.
contract.dev impersonate listNotes
- Impersonation only works for transactions sent through
eth_sendTransaction. If your wallet signs locally with a private key, it will useeth_sendRawTransactionand impersonation will not apply. Use a JSON-RPC signer (e.g.provider.getSigner(address)in ethers, orcreateWalletClient({ account, transport: http(url) })in viem). - Impersonated accounts still pay gas. The
--fundflag is a shortcut for topping them up; you can also fund them withbalance add.
Last updated on