Safety Rules
- Default to
DRY_RUN=1. Never broadcast unless explicitly instructed.
- Always verify Base mainnet before any action:
~/.foundry/bin/cast chain-id --rpc-url "${BASE_MAINNET_RPC:-https://mainnet.base.org}" must be 8453.
- Always verify key/address alignment before any broadcast:
~/.foundry/bin/cast wallet address --private-key "$PRIVATE_KEY" must equal FROM_ADDRESS.
- Always refetch from subgraph immediately before state-changing simulate/broadcast steps.
- Always revalidate critical values onchain right before
cast send.
- Never print or log
PRIVATE_KEY.
- Treat all user/subgraph values as untrusted shell input.
Shell Input Safety (Avoid RCE)
Rules:
- Never use
eval, bash -c, sh -c with user values.
- Only substitute addresses matching
0x + 40 hex chars.
- Only substitute uint values containing digits only.
- Keep placeholders quoted in commands until validated.
Quick validators:
python3 - <<'PY'
import re
checks = {
"address": ("<ADDRESS>", r"0x[a-fA-F0-9]{40}"),
"uint": ("<UINT>", r"[0-9]+"),
}
for name, (value, pattern) in checks.items():
if not re.fullmatch(pattern, value):
raise SystemExit(f"invalid {name}: {value}")
print("ok")
PY
Required Setup
Required env vars:
PRIVATE_KEY
FROM_ADDRESS
BASE_MAINNET_RPC
DRY_RUN
REALM_DIAMOND
INSTALLATION_DIAMOND
TILE_DIAMOND
AAVEGOTCHI_DIAMOND
FUD, FOMO, ALPHA, KEK, GLTR
GOTCHIVERSE_SUBGRAPH_URL
CORE_SUBGRAPH_URL
Optional env vars:
GOLDSKY_API_KEY for auth header (public endpoints work without it).
Use canonical defaults from references/addresses.md.
Scope
Player operations only:
- Channeling
- Survey + harvest claim
- Craft/claim/reduce queues
- Equip/unequip/move/batch equip
- Installation upgrades (queued + instant)
- Access-right read/write
Out of scope:
- Owner/admin governance functions (pause/freeze/set vars/deprecations/address reconfiguration).
Subgraph-First Workflow
- Discover state via
GOTCHIVERSE_SUBGRAPH_URL and CORE_SUBGRAPH_URL.
- Validate current onchain values with
cast call.
- Simulate with
cast call --from "$FROM_ADDRESS".
- Broadcast with
cast send --private-key "$PRIVATE_KEY" only when explicitly instructed.
Canonical queries and notes: references/subgraph.md.
Runbooks
1) Parcel Discovery + Preflight
Use:
references/subgraph.md for parcel/installations/tiles/access-right discovery.
references/realm-recipes.md preflight checks for:
- parcel owner and access right
- altar presence/level
- gotchi lending/listing/kinship checks
2) Survey + Harvest
Functions:
startSurveying(uint256)
claimAvailableAlchemica(uint256,uint256,bytes)
claimAllAvailableAlchemica(uint256[],uint256,bytes)
Use references/realm-recipes.md for read/simulate/broadcast commands.
3) Channel Alchemica
Function:
channelAlchemica(uint256,uint256,uint256,bytes)
Preflight requirements:
- correct access right
- gotchi not actively listed for lending (unless lent)
- gotchi kinship is sufficient
getLastChanneled(gotchiId) passed as _lastChanneled
- parcel altar equipped and cooldown passed
Use references/realm-recipes.md.
4) Craft Installations + Build on Parcel
Installation craft/queue functions:
craftInstallations(uint16[],uint40[])
batchCraftInstallations((uint16,uint16,uint40)[])
claimInstallations(uint256[])
reduceCraftTime(uint256[],uint40[])
getCraftQueue(address)
Build functions (Realm):
equipInstallation(...)
unequipInstallation(...)
moveInstallation(...)
batchEquip(...)
Use:
references/installation-recipes.md
references/realm-recipes.md
5) Craft Tiles + Build on Parcel
Tile craft/queue functions:
craftTiles(uint16[])
batchCraftTiles((uint16,uint16,uint40)[])
claimTiles(uint256[])
reduceCraftTime(uint256[],uint40[])
getCraftQueue(address)
Build functions (Realm):
equipTile(...)
unequipTile(...)
moveTile(...)
batchEquip(...)
Use:
references/tile-recipes.md
references/realm-recipes.md
6) Upgrade Installations
Functions:
upgradeInstallation((...),uint256,bytes,uint40)
instantUpgrade((...),uint256,uint256,bytes)
reduceUpgradeTime(uint256,uint256,uint40,bytes)
finalizeUpgrades(uint256[])
getParcelUpgradeQueue(uint256)
getUserUpgradeQueueNew(address)
parcelQueueEmpty(uint256)
Use references/installation-recipes.md.
7) Access Rights
Functions:
setParcelsAccessRights(...)
setParcelsAccessRightWithWhitelists(...)
getParcelsAccessRights(...)
getParcelsAccessRightsWhitelistIds(...)
Action rights 0..6 and access modes 0..4 are documented in:
references/access-rights.md
Smoke Tests
Run these before first usage and after env changes:
- Subgraph introspection checks in
references/subgraph.md
- Address/contract checks in
references/addresses.md
- No-op selector checks in:
references/realm-recipes.md
references/installation-recipes.md
references/tile-recipes.md
Failure Modes
Use references/failure-modes.md for:
- access-right reverts
- cooldown/kinship/channeling reverts
- coordinate/grid placement reverts
- queue state reverts
- upgrade hash/queue capacity reverts
- deprecation/GLTR/ownership mismatches
1---
2name: aavegotchi-gotchiverse
3description: >
4 Operate Aavegotchi Gotchiverse player workflows on Base mainnet (8453):
5 alchemica channeling, surveying and harvesting, crafting installations/tiles,
6 building on parcels (equip/unequip/move/batch equip), installation upgrades,
7 craft/upgrade queue management, and parcel access-right management.
8 Use when interacting with Realm/Installation/Tile diamonds via subgraph-first
9 discovery and onchain verification/execution with Foundry cast.
10metadata:
11 source: https://skillmd.com/skills/modbender/aavegotchi-gotchiverse
12 openclaw:
13 requires:
14 bins:
15 - cast
16 - curl
17 - python3
18 env:
19 - FROM_ADDRESS
20 - PRIVATE_KEY
21 - BASE_MAINNET_RPC
22 - DRY_RUN
23 - REALM_DIAMOND
24 - INSTALLATION_DIAMOND
25 - TILE_DIAMOND
26 - AAVEGOTCHI_DIAMOND
27 - FUD
28 - FOMO
29 - ALPHA
30 - KEK
31 - GLTR
32 - GOTCHIVERSE_SUBGRAPH_URL
33 - CORE_SUBGRAPH_URL
34 - GOLDSKY_API_KEY
35 primaryEnv: PRIVATE_KEY
36---
37
38## Safety Rules
39
40- Default to `DRY_RUN=1`. Never broadcast unless explicitly instructed.
41- Always verify Base mainnet before any action:
42 - `~/.foundry/bin/cast chain-id --rpc-url "${BASE_MAINNET_RPC:-https://mainnet.base.org}"` must be `8453`.
43- Always verify key/address alignment before any broadcast:
44 - `~/.foundry/bin/cast wallet address --private-key "$PRIVATE_KEY"` must equal `FROM_ADDRESS`.
45- Always refetch from subgraph immediately before state-changing simulate/broadcast steps.
46- Always revalidate critical values onchain right before `cast send`.
47- Never print or log `PRIVATE_KEY`.
48- Treat all user/subgraph values as untrusted shell input.
49
50## Shell Input Safety (Avoid RCE)
51
52Rules:
53- Never use `eval`, `bash -c`, `sh -c` with user values.
54- Only substitute addresses matching `0x` + 40 hex chars.
55- Only substitute uint values containing digits only.
56- Keep placeholders quoted in commands until validated.
57
58Quick validators:
59```bash
60python3 - <<'PY'
61import re
62
63checks = {
64 "address": ("<ADDRESS>", r"0x[a-fA-F0-9]{40}"),
65 "uint": ("<UINT>", r"[0-9]+"),
66}
67
68for name, (value, pattern) in checks.items():
69 if not re.fullmatch(pattern, value):
70 raise SystemExit(f"invalid {name}: {value}")
71
72print("ok")
73PY
74```
75
76## Required Setup
77
78Required env vars:
79- `PRIVATE_KEY`
80- `FROM_ADDRESS`
81- `BASE_MAINNET_RPC`
82- `DRY_RUN`
83- `REALM_DIAMOND`
84- `INSTALLATION_DIAMOND`
85- `TILE_DIAMOND`
86- `AAVEGOTCHI_DIAMOND`
87- `FUD`, `FOMO`, `ALPHA`, `KEK`, `GLTR`
88- `GOTCHIVERSE_SUBGRAPH_URL`
89- `CORE_SUBGRAPH_URL`
90
91Optional env vars:
92- `GOLDSKY_API_KEY` for auth header (public endpoints work without it).
93
94Use canonical defaults from `references/addresses.md`.
95
96## Scope
97
98Player operations only:
99- Channeling
100- Survey + harvest claim
101- Craft/claim/reduce queues
102- Equip/unequip/move/batch equip
103- Installation upgrades (queued + instant)
104- Access-right read/write
105
106Out of scope:
107- Owner/admin governance functions (pause/freeze/set vars/deprecations/address reconfiguration).
108
109## Subgraph-First Workflow
110
1111. Discover state via `GOTCHIVERSE_SUBGRAPH_URL` and `CORE_SUBGRAPH_URL`.
1122. Validate current onchain values with `cast call`.
1133. Simulate with `cast call --from "$FROM_ADDRESS"`.
1144. Broadcast with `cast send --private-key "$PRIVATE_KEY"` only when explicitly instructed.
115
116Canonical queries and notes: `references/subgraph.md`.
117
118## Runbooks
119
120### 1) Parcel Discovery + Preflight
121
122Use:
123- `references/subgraph.md` for parcel/installations/tiles/access-right discovery.
124- `references/realm-recipes.md` preflight checks for:
125 - parcel owner and access right
126 - altar presence/level
127 - gotchi lending/listing/kinship checks
128
129### 2) Survey + Harvest
130
131Functions:
132- `startSurveying(uint256)`
133- `claimAvailableAlchemica(uint256,uint256,bytes)`
134- `claimAllAvailableAlchemica(uint256[],uint256,bytes)`
135
136Use `references/realm-recipes.md` for read/simulate/broadcast commands.
137
138### 3) Channel Alchemica
139
140Function:
141- `channelAlchemica(uint256,uint256,uint256,bytes)`
142
143Preflight requirements:
144- correct access right
145- gotchi not actively listed for lending (unless lent)
146- gotchi kinship is sufficient
147- `getLastChanneled(gotchiId)` passed as `_lastChanneled`
148- parcel altar equipped and cooldown passed
149
150Use `references/realm-recipes.md`.
151
152### 4) Craft Installations + Build on Parcel
153
154Installation craft/queue functions:
155- `craftInstallations(uint16[],uint40[])`
156- `batchCraftInstallations((uint16,uint16,uint40)[])`
157- `claimInstallations(uint256[])`
158- `reduceCraftTime(uint256[],uint40[])`
159- `getCraftQueue(address)`
160
161Build functions (Realm):
162- `equipInstallation(...)`
163- `unequipInstallation(...)`
164- `moveInstallation(...)`
165- `batchEquip(...)`
166
167Use:
168- `references/installation-recipes.md`
169- `references/realm-recipes.md`
170
171### 5) Craft Tiles + Build on Parcel
172
173Tile craft/queue functions:
174- `craftTiles(uint16[])`
175- `batchCraftTiles((uint16,uint16,uint40)[])`
176- `claimTiles(uint256[])`
177- `reduceCraftTime(uint256[],uint40[])`
178- `getCraftQueue(address)`
179
180Build functions (Realm):
181- `equipTile(...)`
182- `unequipTile(...)`
183- `moveTile(...)`
184- `batchEquip(...)`
185
186Use:
187- `references/tile-recipes.md`
188- `references/realm-recipes.md`
189
190### 6) Upgrade Installations
191
192Functions:
193- `upgradeInstallation((...),uint256,bytes,uint40)`
194- `instantUpgrade((...),uint256,uint256,bytes)`
195- `reduceUpgradeTime(uint256,uint256,uint40,bytes)`
196- `finalizeUpgrades(uint256[])`
197- `getParcelUpgradeQueue(uint256)`
198- `getUserUpgradeQueueNew(address)`
199- `parcelQueueEmpty(uint256)`
200
201Use `references/installation-recipes.md`.
202
203### 7) Access Rights
204
205Functions:
206- `setParcelsAccessRights(...)`
207- `setParcelsAccessRightWithWhitelists(...)`
208- `getParcelsAccessRights(...)`
209- `getParcelsAccessRightsWhitelistIds(...)`
210
211Action rights `0..6` and access modes `0..4` are documented in:
212- `references/access-rights.md`
213
214## Smoke Tests
215
216Run these before first usage and after env changes:
217- Subgraph introspection checks in `references/subgraph.md`
218- Address/contract checks in `references/addresses.md`
219- No-op selector checks in:
220 - `references/realm-recipes.md`
221 - `references/installation-recipes.md`
222 - `references/tile-recipes.md`
223
224## Failure Modes
225
226Use `references/failure-modes.md` for:
227- access-right reverts
228- cooldown/kinship/channeling reverts
229- coordinate/grid placement reverts
230- queue state reverts
231- upgrade hash/queue capacity reverts
232- deprecation/GLTR/ownership mismatches
233