Balances
RPC methods for writing native and ERC20 balances directly to Stagenet state. No transaction, no gas.
dev_add*methods are additive — they add to the existing balance.dev_set*methods overwrite — they replace the existing balance.
Amounts are passed as strings in the token’s base units — wei for native, the token’s smallest unit for ERC20s. Decimal or 0x-hex strings are both accepted.
For ERC20s, the Stagenet writes to the token contract’s balanceOf storage slot (the slot is discovered automatically).
totalSupply is not adjusted by the ERC20 balance helpers. If your code reads it, set it explicitly with dev_setStorageAt.
dev_addBalance
Adds native tokens to an account.
| Parameter | Type | Description |
|---|---|---|
address | string | 0x-prefixed Ethereum address |
amount | string | Amount in wei (decimal string or 0x-hex) |
Returns:
{
"success": true,
"address": "0x1111111111111111111111111111111111111111",
"newBalance": "1000000000000000000"
}Example:
curl -X POST <YOUR_STAGENET_RPC_URL> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "dev_addBalance",
"params": ["0x1111111111111111111111111111111111111111", "1000000000000000000"]
}'dev_setBalance
Overwrites an account’s native balance.
Parameters and return shape: same as dev_addBalance.
dev_addERC20Balance
Adds ERC20 tokens to an account.
| Parameter | Type | Description |
|---|---|---|
address | string | Recipient address |
tokenAddress | string | ERC20 token contract address |
amount | string | Amount in the token’s smallest unit |
Returns:
{
"success": true,
"tokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"address": "0x1111111111111111111111111111111111111111",
"newBalance": "1000000"
}dev_setERC20Balance
Overwrites an account’s ERC20 balance.
Parameters and return shape: same as dev_addERC20Balance.