Cheatcodes
Cheatcodes are custom JSON-RPC methods. They do what a real chain never lets you. Each one is a POST to the running fork at http://127.0.0.1:9123/, with the standard JSON-RPC 2.0 envelope.
Headers
| Name | Type | Description |
|---|---|---|
Content-Type | string | Required. application/json. |
Envelope
Every request body is { "jsonrpc": "2.0", "id": <n>, "method": "<method>", "params": { ... } }. Every reply is HTTP 200 and carries either a result payload or a JSON-RPC error object. The Parameters tables below describe the params object; the Response blocks show just the result.
Amounts are strings, so they stay exact past 2^53. Addresses and object ids are 0x hex. Types are full Move types, like 0x2::sui::SUI.
galene_mintCoin
Fabricate a Coin<T> with any balance and owner.
galene_mintCoinParameters
| Name | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Full coin type, like 0x2::sui::SUI. |
amount | string | Yes | Balance in base units. |
recipient | string | Yes | Owner address. |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. The result is in result, or a JSON-RPC error object on failure. |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_mintCoin",
"params": {
"type": "0x2::sui::SUI",
"amount": "1000000000",
"recipient": "0xalice"
}
}'Response
{
"objectId": "0x9a3c...e1f0",
"type": "0x2::sui::SUI",
"balance": 1000000000,
"owner": "0xalice"
}galene_faucet
Mint a known coin by symbol. This wraps galene_mintCoin with a built-in registry: SUI, USDC, USDT, WAL, DEEP. For anything else, use galene_mintCoin with a full type.
galene_faucetParameters
| Name | Type | Required | Description |
|---|---|---|---|
coinSymbol | string | Yes | One of the known symbols. |
amount | string | Yes | Balance in base units. |
recipient | string | Yes | Owner address. |
coin | string | No | A full coin type, instead of coinSymbol. |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. A known symbol also returns its decimals. |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_faucet",
"params": {
"coinSymbol": "USDC",
"amount": "1000000",
"recipient": "0xalice"
}
}'Response
{
"objectId": "0x4b71...c2a9",
"type": "0xdba3...::usdc::USDC",
"balance": 1000000,
"owner": "0xalice",
"decimals": 6
}galene_setGas
Fund any address with SUI gas. Now you never run out mid-test.
galene_setGasParameters
| Name | Type | Required | Description |
|---|---|---|---|
address | string | Yes | Address to fund. |
amount | string | No | SUI amount in MIST. Defaults to a large balance. |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. Returns the funded gas coin. |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_setGas",
"params": {
"address": "0xalice"
}
}'Response
{
"objectId": "0x77de...0b14",
"type": "0x2::sui::SUI",
"balance": 1000000000000,
"owner": "0xalice"
}galene_setObject
Overwrite any object’s contents or owner. This writes a new version. It never clobbers the old one.
galene_setObjectParameters
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | Yes | Object to overwrite. |
contents | object | Yes | New contents. |
owner | string | Yes | New owner address. |
type | string | No | Object type, as addr::module::Name. |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. version is the new version this write created. |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_setObject",
"params": {
"objectId": "0x...",
"contents": { "balance": "42" },
"owner": "0xalice"
}
}'Response
{
"objectId": "0x...",
"version": 2,
"owner": "0xalice",
"contents": { "balance": "42" }
}galene_warpEpoch
Jump forward by epochs. Good for epoch-locked logic.
galene_warpEpochParameters
| Name | Type | Required | Description |
|---|---|---|---|
n | number | No | Epochs to advance. Defaults to 1. |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_warpEpoch",
"params": {
"n": 3
}
}'Response
{ "epoch": 3, "advancedBy": 3 }galene_setClock
Set the on-chain clock. This is the Clock at 0x6. Good for time-locked logic.
galene_setClockParameters
| Name | Type | Required | Description |
|---|---|---|---|
timestampMs | number | Yes | Unix time in milliseconds. |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. The clock is monotonic; vmClockMs is what the Move VM reads. |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_setClock",
"params": {
"timestampMs": 1893456000000
}
}'Response
{ "clockMs": 1893456000000, "vmClockMs": 1893456000000 }galene_impersonate
Act as any address. The address is funded with gas for you.
galene_impersonateParameters
| Name | Type | Required | Description |
|---|---|---|---|
address | string | Yes | The address to act as. |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. gasFunded is the MIST auto-funded to the new sender. |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_impersonate",
"params": {
"address": "0xwhale"
}
}'Response
{
"activeSender": "0xwhale",
"gasFunded": 1000000000000,
"gasObjectId": "0x12ab...9f0c"
}galene_overridePackage
Hot-swap a published package’s code for your local build. The patched modules are injected at the package id, preserving its linkage and types, so execution runs the patch against live mainnet state. This powers the exploit-patch workflow.
galene_overridePackageParameters
| Name | Type | Required | Description |
|---|---|---|---|
packageId | string | Yes | The published package id. |
modules | object | Yes | { "<moduleName>": "<base64 compiled module>" }. At least one module. |
rpc | string | No | Fullnode to source the original package from. Defaults to the fork’s source. |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_overridePackage",
"params": {
"packageId": "0x...",
"modules": { "pool": "<base64>" }
}
}'Response
{
"packageId": "0x...",
"version": 2,
"modulesPatched": ["pool"],
"modulesTotal": 3,
"overridden": true,
"overrideCount": 1
}galene_forkObject
Fork a real mainnet object into the engine, on demand.
galene_forkObjectParameters
| Name | Type | Required | Description |
|---|---|---|---|
objectId | string | Yes | The mainnet object id. |
rpc | string | No | Fullnode to fetch from. Defaults to the fork’s source. |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. The object arrives at its real mainnet version. |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_forkObject",
"params": {
"objectId": "0x6"
}
}'Response
{
"objectId": "0x6",
"type": "0x2::clock::Clock",
"version": 78231445,
"forkedIntoEngine": true
}galene_executeTransactionBlock
Submit a serialized transaction. Galene forks every object it needs, then runs it. See How it works for the full loop.
galene_executeTransactionBlockParameters
| Name | Type | Required | Description |
|---|---|---|---|
txBytes | string | Yes | Base64 BCS TransactionData. The bytes the SDK builds before signing. |
signatures | string[] | No | Empty or absent runs as an unchecked impersonation. A non-empty list is verified per call, like a real node. |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. autoForked lists the objects Galene fetched to run it. |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_executeTransactionBlock",
"params": {
"txBytes": "<base64-bcs>"
}
}'Response
{
"digest": "8Qb...kFa",
"success": true,
"netGasUsed": 1976280,
"created": 1,
"mutated": 2,
"sender": "0xwhale",
"autoForked": ["0xabc...001", "0xabc...002"],
"balanceChanges": [
{ "owner": "0xwhale", "coinType": "0x2::sui::SUI", "amount": "-1976280" }
]
}galene_publishPackage
Deploy a new Move package into the fork, then call it against forked mainnet state. No testnet round-trip. A publish is a real on-fork transaction, so it shows up in history and on the Studio transaction feed.
galene_publishPackageParameters
| Name | Type | Required | Description |
|---|---|---|---|
modules | string[] | object | Yes | Compiled modules as base64: an array, or { "<name>": "<base64>" }. |
deps | string[] | No | Dependency package ids the modules link against. Defaults to the framework (0x1, 0x2). |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. failure is null on success. |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_publishPackage",
"params": {
"modules": ["<base64-module>"]
}
}'Response
{
"packageId": "0x5f2d...a07e",
"modules": ["my_module"],
"digest": "Dk9...3Tu",
"success": true,
"failure": null,
"netGasUsed": 12663200
}galene_snapshot
Capture the current fork state and get an id to roll back to later. Pairs with galene_revert.
galene_snapshotParameters
This method takes no parameters. Send an empty params object.
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. max is the snapshot limit (32). |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_snapshot",
"params": {}
}'Response
{ "snapshotId": 0, "max": 32, "snapshots": [0] }galene_revert
Roll the fork back to a snapshot taken with galene_snapshot. Restores the object store, epoch, clock, sender, and package overrides, and unwinds the engine. This and any later snapshots are invalidated.
galene_revertParameters
| Name | Type | Required | Description |
|---|---|---|---|
snapshotId | number | Yes | The id returned by galene_snapshot. |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_revert",
"params": {
"snapshotId": 0
}
}'Response
{
"reverted": true,
"snapshotId": 0,
"epoch": 42,
"objectsInStore": 12,
"snapshots": []
}galene_reset
Wipe all fork state back to a fresh genesis: objects, package overrides, sender, and the engine. The upstream source and epoch cadence are kept, so the next read re-forks from a clean slate.
galene_resetParameters
This method takes no parameters. Send an empty params object.
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. Returns the counts cleared and the current epoch. |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_reset",
"params": {}
}'Response
{
"reset": true,
"clearedObjects": 12,
"clearedForkedIntoEngine": 8,
"clearedPackageOverrides": 1,
"epoch": 0
}galene_dumpState
Serialize the whole fork (forked, minted, and execution-created objects, package overrides, epoch, and clock) to a portable JSON dump. Save it and reload it later with galene_loadState or galene start --load-state <file>. Anvil-style.
galene_dumpStateParameters
This method takes no parameters. Send an empty params object.
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. The result is the portable JSON dump. |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_dumpState",
"params": {}
}'galene_loadState
Reset the fork and reload a state previously produced by galene_dumpState.
galene_loadStateParameters
| Name | Type | Required | Description |
|---|---|---|---|
state | object | Yes | A dump from galene_dumpState. The params themselves are accepted too. |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK. objects and packages are the counts re-injected. |
Code samples
Request
curl -X POST http://127.0.0.1:9123/ \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "galene_loadState",
"params": {
"state": { "...": "a dump from galene_dumpState" }
}
}'Response
{
"loaded": true,
"objects": 8,
"packages": 2,
"epoch": 42,
"source": "https://fullnode.mainnet.sui.io:443"
}