Skip to Content

State

RPC methods for setting code, nonce, storage, and balance on any account.

Each method writes directly to your Stagenet’s chain state, as if the value had been changed in a transaction. Once written, the value behaves like any piece of chain state: subsequent transactions can modify it, and reads return the latest write.

dev_setCode

Write bytecode at an address.

ParameterTypeDescription
addressstringA 0x-prefixed Ethereum address
bytecodestring0x-prefixed hex

Returns { success, address }.

curl -X POST <YOUR_STAGENET_RPC_URL> \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "dev_setCode", "params": ["0x0000000000000000000000000000000000001234", "0x6042"] }'

dev_setNonce

Set the nonce on an account. Subsequent transaction-driven increments proceed from this value.

ParameterTypeDescription
addressstringA 0x-prefixed Ethereum address
noncestringNon-negative integer (decimal or 0x-hex)

Returns { success, address, newNonce }.

dev_setStorageAt

Write a 32-byte value into a specific storage slot. Both slot and value must be exactly 32-byte hex words (0x + 64 hex chars). Short inputs are rejected — encode explicitly.

ParameterTypeDescription
addressstringA 0x-prefixed Ethereum address
slotstringStorage slot key — 32 bytes
valuestringValue to write — 32 bytes

Returns { success, address, slot }.

curl -X POST <YOUR_STAGENET_RPC_URL> \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "dev_setStorageAt", "params": [ "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000002a" ] }'

dev_setBalance

Overwrite an account’s native token balance. Amount is in wei.

ParameterTypeDescription
addressstringA 0x-prefixed Ethereum address
amountstringAmount in wei (decimal or 0x-hex)

Returns { success, address, newBalance }.

curl -X POST <YOUR_STAGENET_RPC_URL> \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "dev_setBalance", "params": ["0x1111111111111111111111111111111111111111", "1000000000000000000"] }'
Last updated on