@oracle-agent/oracle 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,300 +0,0 @@
1
- ---
2
- name: oracle-multichain-token-launch
3
- description: Use when planning, building, reviewing, or preparing a fungible token launch on EVM, Solana, Bitcoin Runes, Cosmos, Move, Hyperliquid, or another chain family. Fail closed on unsupported adapters; prepare and simulate only; the user signs each side effect.
4
- ---
5
-
6
- # Multichain token launch
7
-
8
- ## Contract
9
-
10
- Use this skill for fungible asset creation, initial distribution, public sale setup,
11
- and liquidity bootstrap preparation.
12
-
13
- "Every chain" means route the request to a verified chain-family path. It does not
14
- mean one bytecode artifact or one transaction encoder works everywhere. Never call
15
- a chain launch-ready because its RPC responds.
16
-
17
- Oracle researches, scaffolds, validates, simulates, and prepares unsigned actions.
18
- The user signs deployment, mint, metadata, authority, liquidity, and verification
19
- actions separately. Never broadcast from this skill.
20
-
21
- When loaded by the `oracle` router, use this skill to classify the request, then
22
- route chain research to the relevant specialist and build/prepare work to
23
- `protocol-builder`. The router remains read and simulate only.
24
-
25
- ## Support status language
26
-
27
- Use exactly one status before building:
28
-
29
- | Status | Meaning |
30
- |---|---|
31
- | `TEMPLATE_READY` | Oracle ships a gated template and unsigned prepare path for this exact standard. |
32
- | `ADAPTER_READY` | A chain-specific encoder exists and passed live simulation or testnet verification. |
33
- | `GUIDED_BUILD` | Oracle can scaffold and test it, but no generic transaction adapter is shipped. |
34
- | `RESEARCH_ONLY` | Oracle can verify chain mechanics and produce a launch plan, not a deployable bundle. |
35
- | `UNSUPPORTED` | Required chain primitives or trustworthy tooling cannot be verified. Stop. |
36
-
37
- Do not upgrade a status without evidence. A compiler pass alone is not
38
- `ADAPTER_READY`. A mainnet-ready claim needs exact chain identity, final artifacts,
39
- simulation, fee estimate, and source/program verification path.
40
-
41
- ## Current family matrix
42
-
43
- | Family | Common standards | Default status | Required path |
44
- |---|---|---|---|
45
- | EVM | ERC-20 | `TEMPLATE_READY` only for Oracle `safe-erc20`; custom tax, mint, proxy, or hook designs are `GUIDED_BUILD` | Foundry gate, chain-id proof, unsigned deploy, source verification |
46
- | Solana | SPL Token, Token-2022 | `GUIDED_BUILD` | Select extensions explicitly, construct unsigned transactions, simulate, user wallet signs |
47
- | Bitcoin | Runes | `RESEARCH_ONLY` until an etch adapter is present | Commit/reveal plan, UTXO and fee model, exact terms review |
48
- | Cosmos | tokenfactory, CW20 | `RESEARCH_ONLY` by default | Resolve the chain's module or CosmWasm messages; EVM-enabled Cosmos chains use the EVM path only when verified |
49
- | Sui | Coin, regulated coin primitives | `RESEARCH_ONLY` by default | Move package, treasury capability model, devnet/testnet publish first |
50
- | Aptos | Coin, Fungible Asset | `RESEARCH_ONLY` by default | Move module/object model, upgrade policy, testnet publish first |
51
- | Hyperliquid L1 | spot asset deployment | `RESEARCH_ONLY` | Verify current native deployment/auction process; HIP-3 is a market deployment, not a generic token contract |
52
- | HyperEVM | ERC-20 | EVM status | Use the exact HyperEVM chain id and verified gas/DEX addresses |
53
- | Other | chain-native | `UNSUPPORTED` until classified | Add and verify a dedicated adapter before preparing transactions |
54
-
55
- This matrix is the minimum truth bar, not a marketing ceiling. If a verified adapter
56
- lands later, update its status with tests and evidence.
57
-
58
- ## 1. Build the launch manifest
59
-
60
- Do not write code until all required fields are known:
61
-
62
- ```yaml
63
- asset:
64
- name: ""
65
- symbol: ""
66
- chain_family: ""
67
- chain_name: ""
68
- chain_id_or_genesis: ""
69
- network: mainnet|testnet|devnet|local
70
- standard: ""
71
- decimals: null
72
- max_supply: ""
73
- initial_supply: ""
74
- allocation:
75
- treasury: ""
76
- public: ""
77
- liquidity: ""
78
- team: ""
79
- community: ""
80
- authorities:
81
- mint: none|wallet|multisig|timelock|program
82
- freeze: none|wallet|multisig|timelock|program
83
- pause: none|wallet|multisig|timelock
84
- upgrade: none|wallet|multisig|timelock
85
- metadata: immutable|wallet|multisig|timelock
86
- mechanics:
87
- transfer_tax_bps: 0
88
- blacklist: false
89
- transfer_hook: none
90
- sale: none
91
- liquidity: none
92
- verification:
93
- source: required
94
- simulation: required
95
- firm_audit: false
96
- ```
97
-
98
- Reject ambiguous supply units. Record raw base units and human-readable units.
99
- Percent allocations must total 100 percent before deploy preparation.
100
-
101
- ## 2. Verify the chain, standard, and tooling
102
-
103
- 1. Resolve the exact chain identity from a live RPC or official client.
104
- 2. Verify native gas asset, address format, finality model, fee fields, explorer,
105
- compiler/toolchain version, and source/program verification mechanism.
106
- 3. Verify the intended standard from official chain or standards documentation.
107
- 4. Prefer a boring official or widely reviewed implementation.
108
- 5. Record every external factory, router, program, module, and metadata endpoint.
109
- 6. Mark unverified addresses and deprecated tooling `UNSUPPORTED`, not best effort.
110
-
111
- Chain names are not identities. `mainnet`, `testnet`, and forks must carry distinct
112
- IDs and RPC evidence.
113
-
114
- ## 3. Force an authority decision
115
-
116
- Before generating transactions, print a table for:
117
-
118
- - mint or treasury capability
119
- - freeze or deny-list capability
120
- - pause capability
121
- - upgrade authority
122
- - metadata authority
123
- - fee/tax setter
124
- - transfer-hook owner
125
- - sale contract owner
126
- - liquidity position owner
127
- - treasury and royalty recipients
128
-
129
- For each authority, state who holds it at creation, whether it can change, the
130
- transfer/revoke transaction, and what breaks if revoked.
131
-
132
- Defaults:
133
-
134
- - fixed supply when future minting is not a product requirement
135
- - no transfer tax
136
- - no blacklist
137
- - no proxy upgradeability
138
- - no hidden owner balance changes
139
- - multisig or timelock for powers that must remain
140
- - revoke only after verification and launch operations that need the authority
141
-
142
- Never claim "renounced" until independent on-chain read-back proves it.
143
-
144
- ## 4. Family-specific build paths
145
-
146
- ### EVM
147
-
148
- For a plain fixed-supply token, use Oracle's gated template:
149
-
150
- ```js
151
- data.call("protocol-templates", "gate", { templateId: "safe-erc20" })
152
- data.call("protocol-templates", "prepareDeploy", {
153
- templateId: "safe-erc20",
154
- chainId,
155
- args: [name, symbol, supply, initialHolder, initialOwner],
156
- })
157
- ```
158
-
159
- Required gates:
160
-
161
- 1. Verify chain id and RPC reality.
162
- 2. `forge test` passes.
163
- 3. Static analysis runs when available.
164
- 4. Constructor units and addresses decode back exactly.
165
- 5. Dry-run deployment succeeds on the target chain fork when archive state exists.
166
- 6. Unsigned deploy is stamped; source verification input is prepared separately.
167
- 7. Liquidity and ownership changes remain separate unsigned actions.
168
-
169
- Any custom minting, tax, blacklist, transfer hook, proxy, permit, votes, vesting, or
170
- cross-chain bridge logic leaves `safe-erc20` and becomes a custom `GUIDED_BUILD`.
171
- Do not silently bolt features onto the reviewed template.
172
-
173
- ### Solana
174
-
175
- Choose standard SPL Token unless a specific Token-2022 extension is required.
176
- For Token-2022, enumerate every selected extension and its authority, including
177
- transfer fees, permanent delegate, transfer hook, default account state, metadata
178
- pointer, interest bearing, confidential transfer, and non-transferable behavior.
179
-
180
- Prepare distinct unsigned transactions for:
181
-
182
- 1. create mint account and initialize mint
183
- 2. create metadata when used
184
- 3. create distribution token accounts
185
- 4. mint initial supply
186
- 5. transfer or revoke mint authority
187
- 6. transfer or revoke freeze authority
188
- 7. create sale or liquidity positions, only if separately approved
189
-
190
- Simulate each transaction against the intended cluster. A blockhash-expired result
191
- must be rebuilt, never manually edited.
192
-
193
- ### Bitcoin Runes
194
-
195
- A Rune launch is an etching, not a smart-contract deployment. Collect and print:
196
-
197
- - rune name and spacers
198
- - divisibility and symbol
199
- - premine
200
- - mint amount and cap
201
- - start and end heights or offsets
202
- - turbo flag
203
- - commit UTXO, reveal destination, fee rate, and expected total fees
204
-
205
- Prepare commit/reveal artifacts only through a verified adapter. Protect the commit
206
- UTXO from accidental spend, account for the reveal window and reorg risk, and never
207
- promise an indexer ticker reservation before the etching confirms. Without an
208
- adapter, status stays `RESEARCH_ONLY`.
209
-
210
- ### Cosmos
211
-
212
- First determine whether the target uses a native tokenfactory module, CosmWasm
213
- CW20, or an EVM runtime. These are different launch paths.
214
-
215
- - tokenfactory: verify denom creation, mint, burn, admin-change, and metadata message
216
- types from that chain's running version
217
- - CW20: compile and test the exact contract artifact, instantiate message, minter
218
- model, marketing info, and migration admin
219
- - EVM runtime: use the EVM path only after proving chain id and JSON-RPC behavior
220
-
221
- Never transplant Osmosis, Injective, Sei, or another chain's message type by name.
222
-
223
- ### Sui and Aptos
224
-
225
- Sui and Aptos need separate Move packages and authority models. Do not share source
226
- because both languages are called Move.
227
-
228
- - Sui: identify one-time witness, treasury capability, metadata/display objects,
229
- deny-list or regulated-coin powers, package upgrade policy, and object ownership
230
- - Aptos: choose Coin or Fungible Asset, define mint/burn/freeze capability objects,
231
- metadata object, store model, and module upgrade policy
232
-
233
- Publish and exercise the full lifecycle on devnet/testnet first. Mainnet remains
234
- `RESEARCH_ONLY` until the exact package and publish transaction pass review.
235
-
236
- ### Hyperliquid
237
-
238
- Do not conflate HIP-3 builder-deployed perp markets, HIP-1 or native spot assets,
239
- HyperEVM ERC-20s, and HIP-4 outcomes. Route HyperEVM assets to EVM. For Hyperliquid
240
- L1 native assets, verify current official deployment, auction, genesis allocation,
241
- and deployer requirements before naming a prepare path. Without a dedicated native
242
- adapter, status is `RESEARCH_ONLY`.
243
-
244
- ## 5. Distribution, sale, and liquidity are separate actions
245
-
246
- Token creation does not authorize a sale or pool. For each follow-on action, show:
247
-
248
- - destination contract/program/module
249
- - token and quote amounts
250
- - opening price and implied fully diluted value
251
- - slippage and deadline
252
- - LP ownership, lock, burn, or withdrawal rights
253
- - treasury recipient
254
- - vesting terms and clawback/admin powers
255
- - simulation and fee estimate
256
-
257
- Verify DEX factories and routers on the exact chain. A canonical address on Ethereum
258
- is not canonical on a sibling EVM chain.
259
-
260
- Never auto-create liquidity after deployment. Never auto-revoke authority before
261
- metadata, distribution, or verification actions that need it are complete.
262
-
263
- ## 6. Required artifacts
264
-
265
- A completed prepare run returns:
266
-
267
- 1. `launch-manifest.yaml` with exact units and chain identity
268
- 2. authority and mutability table
269
- 3. source/package hash and dependency lock
270
- 4. test and static-analysis results
271
- 5. target-chain simulation or an explicit reason it is unavailable
272
- 6. fee and balance estimate
273
- 7. ordered unsigned transaction bundle with hashes
274
- 8. source/program verification payload
275
- 9. separate liquidity/distribution bundle when requested
276
- 10. a final user approval checklist, one side effect per line
277
-
278
- Do not emit a signed payload, private key request, seed phrase request, or broadcast
279
- command with signing enabled.
280
-
281
- ## Refusals
282
-
283
- Refuse hidden minting, honeypots, selective sell blocks, fake renouncement, covert
284
- taxes, wash liquidity, fake volume, stolen upgrade keys, undisclosed permanent
285
- delegates, and misleading supply claims.
286
-
287
- ## Completion gate
288
-
289
- A launch is only `PREPARED` when:
290
-
291
- - chain and standard are exact
292
- - support status is honest
293
- - supply and allocation reconcile
294
- - all authorities are disclosed
295
- - tests pass
296
- - simulation passes or the missing capability is explicit
297
- - every destination and payload hash is recorded
298
- - no signing or broadcast occurred
299
-
300
- Anything less is `DRAFT`, `RESEARCH_ONLY`, or `UNSUPPORTED`.
@@ -1,163 +0,0 @@
1
- // Raster-only NFT contact sheets returned as SVG image content.
2
-
3
- import { timed } from "../http.mjs";
4
-
5
- const ALLOWED_IMAGE_HOSTS = Object.freeze([
6
- "i.seadn.io",
7
- "openseauserdata.com",
8
- "arweave.net",
9
- "ipfs.io",
10
- "nftstorage.link",
11
- "dweb.link",
12
- "cloudflare-ipfs.com",
13
- "ordinals.com",
14
- "ordinals.g.com",
15
- "cdn.helius-rpc.com",
16
- "shdw-drive.genesysgo.net",
17
- ]);
18
-
19
- const RASTER_MIME = new Set(["image/jpeg", "image/png", "image/webp"]);
20
-
21
- function allowedHost(hostname) {
22
- const host = String(hostname || "").toLowerCase();
23
- return ALLOWED_IMAGE_HOSTS.some((allowed) => host === allowed || host.endsWith(`.${allowed}`));
24
- }
25
-
26
- function gatewayUrl(value) {
27
- const text = String(value || "").trim();
28
- if (text.startsWith("ipfs://")) return `https://ipfs.io/ipfs/${text.slice(7).replace(/^ipfs\//, "")}`;
29
- if (text.startsWith("ar://")) return `https://arweave.net/${text.slice(5)}`;
30
- return text;
31
- }
32
-
33
- function safeImageUrl(value) {
34
- const text = gatewayUrl(value);
35
- let url;
36
- try {
37
- url = new URL(text);
38
- } catch {
39
- return null;
40
- }
41
- if (url.protocol !== "https:" || url.username || url.password || !allowedHost(url.hostname)) return null;
42
- return url;
43
- }
44
-
45
- async function fetchRaster(value, opts = {}) {
46
- const fetchImpl = opts.fetchImpl || globalThis.fetch;
47
- if (typeof fetchImpl !== "function") throw new Error("gallery fetch unavailable");
48
- let url = safeImageUrl(value);
49
- if (!url) throw new Error("image host is not on the raster gallery allowlist");
50
- const maxBytes = Math.min(Math.max(Number(opts.maxImageBytes ?? 1_500_000), 50_000), 4_000_000);
51
-
52
- for (let redirect = 0; redirect <= 3; redirect += 1) {
53
- const attempt = await timed(() => fetchImpl(url.toString(), {
54
- method: "GET",
55
- redirect: "manual",
56
- headers: { accept: "image/jpeg,image/png,image/webp" },
57
- signal: AbortSignal.timeout(opts.timeoutMs ?? 12_000),
58
- }));
59
- if (!attempt.ok) throw new Error(attempt.error);
60
- const response = attempt.data;
61
- if (response.status >= 300 && response.status < 400) {
62
- const location = response.headers?.get?.("location");
63
- if (!location) throw new Error("image redirect missing location");
64
- const next = safeImageUrl(new URL(location, url).toString());
65
- if (!next) throw new Error("image redirect left the host allowlist");
66
- url = next;
67
- continue;
68
- }
69
- if (!response.ok) throw new Error(`image HTTP ${response.status}`);
70
- const mimeType = String(response.headers?.get?.("content-type") || "").split(";", 1)[0].toLowerCase();
71
- if (!RASTER_MIME.has(mimeType)) throw new Error(`unsafe or unsupported image type ${mimeType || "unknown"}`);
72
- const length = Number(response.headers?.get?.("content-length") || 0);
73
- if (length > maxBytes) throw new Error("image exceeds gallery byte cap");
74
- const bytes = Buffer.from(await response.arrayBuffer());
75
- if (!bytes.length || bytes.length > maxBytes) throw new Error("image exceeds gallery byte cap");
76
- return { mimeType, data: bytes.toString("base64"), sourceUrl: url.toString(), bytes: bytes.length };
77
- }
78
- throw new Error("too many image redirects");
79
- }
80
-
81
- function xml(value) {
82
- return String(value ?? "")
83
- .replaceAll("&", "&amp;")
84
- .replaceAll("<", "&lt;")
85
- .replaceAll(">", "&gt;")
86
- .replaceAll('"', "&quot;")
87
- .replaceAll("'", "&apos;");
88
- }
89
-
90
- function label(item, index) {
91
- return item.name || item.collection || item.tokenId || `NFT ${index + 1}`;
92
- }
93
-
94
- export async function nftGallery(args = {}, opts = {}) {
95
- const allItems = Array.isArray(args.items) ? args.items : [];
96
- if (!allItems.length) throw new Error("nft gallery requires inventory items");
97
- const pageSize = Math.min(Math.max(Number(args.pageSize ?? 12) || 12, 1), 12);
98
- const page = Math.max(Number(args.page ?? 1) || 1, 1);
99
- const totalPages = Math.max(Math.ceil(allItems.length / pageSize), 1);
100
- if (page > totalPages) throw new Error(`nft gallery page ${page} exceeds ${totalPages}`);
101
- const items = allItems.slice((page - 1) * pageSize, page * pageSize);
102
- const loaded = [];
103
- let totalBytes = 0;
104
- const maxTotalBytes = Math.min(Math.max(Number(args.maxTotalBytes ?? 8_000_000), 250_000), 12_000_000);
105
-
106
- for (const item of items) {
107
- if (totalBytes >= maxTotalBytes) {
108
- loaded.push({ item, image: null, error: "gallery page byte cap reached" });
109
- continue;
110
- }
111
- try {
112
- const image = await fetchRaster(item.imageUrl || item.originalImageUrl, {
113
- ...opts,
114
- maxImageBytes: Math.min(Number(args.maxImageBytes ?? 1_500_000), maxTotalBytes - totalBytes),
115
- });
116
- totalBytes += image.bytes;
117
- loaded.push({ item, image, error: null });
118
- } catch (error) {
119
- loaded.push({ item, image: null, error: String(error?.message || error).slice(0, 180) });
120
- }
121
- }
122
-
123
- const columns = 3;
124
- const tileWidth = 340;
125
- const tileHeight = 400;
126
- const headerHeight = 76;
127
- const rows = Math.ceil(items.length / columns);
128
- const width = columns * tileWidth;
129
- const height = headerHeight + rows * tileHeight;
130
- const body = loaded.map(({ item, image, error }, index) => {
131
- const column = index % columns;
132
- const row = Math.floor(index / columns);
133
- const x = column * tileWidth;
134
- const y = headerHeight + row * tileHeight;
135
- const art = image
136
- ? `<image x="${x + 14}" y="${y + 14}" width="312" height="312" preserveAspectRatio="xMidYMid slice" href="data:${image.mimeType};base64,${image.data}"/>`
137
- : `<rect x="${x + 14}" y="${y + 14}" width="312" height="312" rx="14" fill="#151820"/><text x="${x + 170}" y="${y + 165}" text-anchor="middle" fill="#76808f" font-size="16">image unavailable</text>`;
138
- const title = xml(label(item, index).slice(0, 34));
139
- const chain = xml(item.chain || "unknown chain");
140
- return `${art}<text x="${x + 16}" y="${y + 350}" fill="#f3f5f7" font-size="17" font-weight="600">${title}</text><text x="${x + 16}" y="${y + 376}" fill="#8d98a8" font-size="13">${chain}${error ? " · placeholder" : ""}</text>`;
141
- }).join("");
142
- const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}"><rect width="100%" height="100%" fill="#090b10"/><text x="24" y="34" fill="#ffffff" font-size="24" font-weight="700">NFT INVENTORY</text><text x="24" y="58" fill="#8d98a8" font-size="14">page ${page} of ${totalPages} · ${allItems.length} assets · generated ${xml(new Date().toISOString())}</text>${body}</svg>`;
143
-
144
- return {
145
- provider: "nft-portfolio",
146
- operation: "gallery",
147
- mimeType: "image/svg+xml",
148
- dataBase64: Buffer.from(svg).toString("base64"),
149
- page,
150
- pageSize,
151
- totalPages,
152
- totalItems: allItems.length,
153
- renderedItems: loaded.filter((row) => row.image).length,
154
- placeholders: loaded.filter((row) => !row.image).map((row) => ({
155
- assetKey: row.item.assetKey || null,
156
- name: row.item.name || null,
157
- sourceUrl: row.item.imageUrl || null,
158
- error: row.error,
159
- })),
160
- rasterOnly: true,
161
- externalScripts: false,
162
- };
163
- }