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.
| Parameter | Type | Description |
|---|---|---|
address | string | A 0x-prefixed Ethereum address |
bytecode | string | 0x-prefixed hex |
Returns { 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.
| Parameter | Type | Description |
|---|---|---|
address | string | A 0x-prefixed Ethereum address |
nonce | string | Non-negative integer (decimal or 0x-hex) |
Returns { address, nonce } where nonce is the post-update value as a decimal string.
dev_setStorageAt
Write a 32-byte value into a specific storage slot.
The slot key accepts decimal slot numbers and short 0x hex (left-padded — slot keys are uint256, so this is unambiguous). The value must be an exactly 32-byte hex word (0x + 64 hex chars): uint-style vs bytes-style padding is ambiguous for values, so encode explicitly.
| Parameter | Type | Description |
|---|---|---|
address | string | A 0x-prefixed Ethereum address |
slot | string | number | Storage slot key — 0x hex (≤32 bytes) or a decimal slot number ("10" / 10 is slot ten, not 0x10) |
value | string | Value to write — exactly 32 bytes |
Returns { address, slot } (the canonical 32-byte slot key is echoed back).
curl -X POST <YOUR_STAGENET_RPC_URL> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "dev_setStorageAt",
"params": [
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"0",
"0x000000000000000000000000000000000000000000000000000000000000002a"
]
}'dev_setBalance
Overwrite an account’s native token balance. Amount is in wei.
| Parameter | Type | Description |
|---|---|---|
address | string | A 0x-prefixed Ethereum address |
amount | string | Amount in wei (decimal or 0x-hex) |
Returns { address, balance } where balance is the post-update value in wei as a string.
curl -X POST <YOUR_STAGENET_RPC_URL> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "dev_setBalance",
"params": ["0x1111111111111111111111111111111111111111", "1000000000000000000"]
}'