@artblocks/abx-cli 0.1.0-alpha.9 → 0.2.0

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.
Files changed (201) hide show
  1. package/CHANGELOG.md +429 -0
  2. package/assets/renderer-scaffold/README.md +44 -13
  3. package/assets/renderer-scaffold/foundry.toml +5 -0
  4. package/assets/renderer-scaffold/remappings.txt +1 -1
  5. package/assets/renderer-scaffold/script/DeployHooks.s.sol +24 -0
  6. package/assets/renderer-scaffold/script/Preview.s.sol +99 -0
  7. package/assets/renderer-scaffold/src/MyHooks.sol +20 -0
  8. package/assets/renderer-scaffold/src/MyRenderer.sol +4 -4
  9. package/assets/renderer-scaffold/src/MyTraits.sol +2 -2
  10. package/assets/renderer-scaffold/test/MyRenderer.t.sol +60 -3
  11. package/dist/bin.d.ts +26 -0
  12. package/dist/bin.d.ts.map +1 -0
  13. package/dist/bin.js +63 -0
  14. package/dist/bin.js.map +1 -0
  15. package/dist/capabilities.d.ts +132 -0
  16. package/dist/capabilities.d.ts.map +1 -0
  17. package/dist/capabilities.js +175 -0
  18. package/dist/capabilities.js.map +1 -0
  19. package/dist/commands/auth.d.ts +54 -0
  20. package/dist/commands/auth.d.ts.map +1 -0
  21. package/dist/commands/auth.js +483 -0
  22. package/dist/commands/auth.js.map +1 -0
  23. package/dist/commands/contract.d.ts +19 -0
  24. package/dist/commands/contract.d.ts.map +1 -0
  25. package/dist/commands/contract.js +171 -0
  26. package/dist/commands/contract.js.map +1 -0
  27. package/dist/commands/deploy.d.ts +296 -0
  28. package/dist/commands/deploy.d.ts.map +1 -0
  29. package/dist/commands/deploy.js +5756 -0
  30. package/dist/commands/deploy.js.map +1 -0
  31. package/dist/commands/feedback.d.ts +7 -0
  32. package/dist/commands/feedback.d.ts.map +1 -0
  33. package/dist/commands/feedback.js +154 -0
  34. package/dist/commands/feedback.js.map +1 -0
  35. package/dist/commands/maintenance.d.ts +4 -0
  36. package/dist/commands/maintenance.d.ts.map +1 -0
  37. package/dist/commands/maintenance.js +114 -0
  38. package/dist/commands/maintenance.js.map +1 -0
  39. package/dist/commands/project.d.ts +458 -0
  40. package/dist/commands/project.d.ts.map +1 -0
  41. package/dist/commands/project.js +1837 -0
  42. package/dist/commands/project.js.map +1 -0
  43. package/dist/commands/reads.d.ts +85 -0
  44. package/dist/commands/reads.d.ts.map +1 -0
  45. package/dist/commands/reads.js +881 -0
  46. package/dist/commands/reads.js.map +1 -0
  47. package/dist/commands/scaffold.d.ts +89 -0
  48. package/dist/commands/scaffold.d.ts.map +1 -0
  49. package/dist/commands/scaffold.js +741 -0
  50. package/dist/commands/scaffold.js.map +1 -0
  51. package/dist/commands/service.d.ts +67 -0
  52. package/dist/commands/service.d.ts.map +1 -0
  53. package/dist/commands/service.js +761 -0
  54. package/dist/commands/service.js.map +1 -0
  55. package/dist/commands/storage.d.ts +51 -0
  56. package/dist/commands/storage.d.ts.map +1 -0
  57. package/dist/commands/storage.js +399 -0
  58. package/dist/commands/storage.js.map +1 -0
  59. package/dist/commands/submit-app.d.ts +102 -0
  60. package/dist/commands/submit-app.d.ts.map +1 -0
  61. package/dist/commands/submit-app.js +638 -0
  62. package/dist/commands/submit-app.js.map +1 -0
  63. package/dist/config.d.ts +94 -2
  64. package/dist/config.d.ts.map +1 -1
  65. package/dist/config.js +332 -12
  66. package/dist/config.js.map +1 -1
  67. package/dist/conformance.d.ts +31 -0
  68. package/dist/conformance.d.ts.map +1 -0
  69. package/dist/conformance.js +400 -0
  70. package/dist/conformance.js.map +1 -0
  71. package/dist/contract-read-error.d.ts +5 -0
  72. package/dist/contract-read-error.d.ts.map +1 -0
  73. package/dist/contract-read-error.js +37 -0
  74. package/dist/contract-read-error.js.map +1 -0
  75. package/dist/creator-agent.d.ts +49 -0
  76. package/dist/creator-agent.d.ts.map +1 -0
  77. package/dist/creator-agent.js +363 -0
  78. package/dist/creator-agent.js.map +1 -0
  79. package/dist/creator-keyring.d.ts +26 -0
  80. package/dist/creator-keyring.d.ts.map +1 -0
  81. package/dist/creator-keyring.js +57 -0
  82. package/dist/creator-keyring.js.map +1 -0
  83. package/dist/creator-signer.d.ts +52 -0
  84. package/dist/creator-signer.d.ts.map +1 -0
  85. package/dist/creator-signer.js +267 -0
  86. package/dist/creator-signer.js.map +1 -0
  87. package/dist/deploy-plan.d.ts +218 -0
  88. package/dist/deploy-plan.d.ts.map +1 -0
  89. package/dist/deploy-plan.js +20 -0
  90. package/dist/deploy-plan.js.map +1 -0
  91. package/dist/deps.d.ts +6 -39
  92. package/dist/deps.d.ts.map +1 -1
  93. package/dist/deps.js +4 -68
  94. package/dist/deps.js.map +1 -1
  95. package/dist/errors.d.ts +22 -0
  96. package/dist/errors.d.ts.map +1 -0
  97. package/dist/errors.js +32 -0
  98. package/dist/errors.js.map +1 -0
  99. package/dist/flag-allowlists.d.ts +53 -0
  100. package/dist/flag-allowlists.d.ts.map +1 -0
  101. package/dist/flag-allowlists.js +188 -0
  102. package/dist/flag-allowlists.js.map +1 -0
  103. package/dist/flags.d.ts +53 -0
  104. package/dist/flags.d.ts.map +1 -1
  105. package/dist/flags.js +151 -1
  106. package/dist/flags.js.map +1 -1
  107. package/dist/jsonout.d.ts +37 -0
  108. package/dist/jsonout.d.ts.map +1 -0
  109. package/dist/jsonout.js +79 -0
  110. package/dist/jsonout.js.map +1 -0
  111. package/dist/kind.d.ts +57 -0
  112. package/dist/kind.d.ts.map +1 -0
  113. package/dist/kind.js +122 -0
  114. package/dist/kind.js.map +1 -0
  115. package/dist/main.js +859 -5374
  116. package/dist/main.js.map +1 -1
  117. package/dist/mintpage.d.ts +17 -2
  118. package/dist/mintpage.d.ts.map +1 -1
  119. package/dist/mintpage.js +241 -54
  120. package/dist/mintpage.js.map +1 -1
  121. package/dist/output.d.ts +184 -0
  122. package/dist/output.d.ts.map +1 -0
  123. package/dist/output.js +774 -0
  124. package/dist/output.js.map +1 -0
  125. package/dist/ownerops.d.ts +463 -59
  126. package/dist/ownerops.d.ts.map +1 -1
  127. package/dist/ownerops.js +2329 -366
  128. package/dist/ownerops.js.map +1 -1
  129. package/dist/preview.d.ts +23 -5
  130. package/dist/preview.d.ts.map +1 -1
  131. package/dist/preview.js +95 -43
  132. package/dist/preview.js.map +1 -1
  133. package/dist/provision.d.ts +3 -13
  134. package/dist/provision.d.ts.map +1 -1
  135. package/dist/provision.js +19 -21
  136. package/dist/provision.js.map +1 -1
  137. package/dist/remote.d.ts +116 -9
  138. package/dist/remote.d.ts.map +1 -1
  139. package/dist/remote.js +371 -14
  140. package/dist/remote.js.map +1 -1
  141. package/dist/riskgate.d.ts +101 -0
  142. package/dist/riskgate.d.ts.map +1 -0
  143. package/dist/riskgate.js +343 -0
  144. package/dist/riskgate.js.map +1 -0
  145. package/dist/scaffold.d.ts +12 -0
  146. package/dist/scaffold.d.ts.map +1 -0
  147. package/dist/scaffold.js +56 -0
  148. package/dist/scaffold.js.map +1 -0
  149. package/dist/schema.d.ts +36 -1
  150. package/dist/schema.d.ts.map +1 -1
  151. package/dist/schema.js +121 -26
  152. package/dist/schema.js.map +1 -1
  153. package/dist/script-chunks.d.ts +8 -0
  154. package/dist/script-chunks.d.ts.map +1 -0
  155. package/dist/script-chunks.js +35 -0
  156. package/dist/script-chunks.js.map +1 -0
  157. package/dist/served.d.ts +30 -0
  158. package/dist/served.d.ts.map +1 -0
  159. package/dist/served.js +112 -0
  160. package/dist/served.js.map +1 -0
  161. package/dist/signer.d.ts +20 -1
  162. package/dist/signer.d.ts.map +1 -1
  163. package/dist/signer.js +110 -18
  164. package/dist/signer.js.map +1 -1
  165. package/dist/update-check.d.ts +60 -9
  166. package/dist/update-check.d.ts.map +1 -1
  167. package/dist/update-check.js +105 -18
  168. package/dist/update-check.js.map +1 -1
  169. package/package.json +17 -12
  170. package/skill/SKILL.md +213 -354
  171. package/skill/agents/openai.yaml +4 -0
  172. package/skill/reference/capabilities.md +195 -0
  173. package/skill/reference/code.md +236 -0
  174. package/skill/reference/creator-token.md +94 -0
  175. package/skill/reference/deploy.md +191 -0
  176. package/skill/reference/diagnose.md +178 -0
  177. package/skill/reference/hosting.md +191 -102
  178. package/skill/reference/operate.md +237 -0
  179. package/skill/reference/services.md +173 -0
  180. package/skill/reference/setup.md +221 -42
  181. package/assets/renderer-scaffold/src/interfaces/IAbxFieldRenderer.sol +0 -32
  182. package/assets/renderer-scaffold/src/interfaces/IAbxParams.sol +0 -26
  183. package/dist/inspect.d.ts +0 -48
  184. package/dist/inspect.d.ts.map +0 -1
  185. package/dist/inspect.js +0 -184
  186. package/dist/inspect.js.map +0 -1
  187. package/dist/migrate.d.ts +0 -65
  188. package/dist/migrate.d.ts.map +0 -1
  189. package/dist/migrate.js +0 -180
  190. package/dist/migrate.js.map +0 -1
  191. package/dist/onchain-uri.d.ts +0 -97
  192. package/dist/onchain-uri.d.ts.map +0 -1
  193. package/dist/onchain-uri.js +0 -243
  194. package/dist/onchain-uri.js.map +0 -1
  195. package/dist/upload.d.ts +0 -28
  196. package/dist/upload.d.ts.map +0 -1
  197. package/dist/upload.js +0 -41
  198. package/dist/upload.js.map +0 -1
  199. package/skill/reference/code-projects.md +0 -246
  200. package/skill/reference/operating.md +0 -118
  201. package/skill/reference/troubleshooting.md +0 -28
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "ABX"
3
+ short_description: "Launch, host, and operate ABX NFT projects"
4
+ default_prompt: "Use $abx to plan and safely execute this ABX project workflow."
@@ -0,0 +1,195 @@
1
+ # Capability questions and extension seams
2
+
3
+ Use this reference before answering whether ABX can support an unusual mechanic. The goal is neither
4
+ automatic optimism nor reflexive refusal; it is a proven route with explicit cost and limits.
5
+
6
+ ## Contents
7
+
8
+ - [Use the four-way classification](#use-the-four-way-classification)
9
+ - [Inspect the machine-readable contract](#inspect-the-machine-readable-contract)
10
+ - [Use canonical extension seams](#use-canonical-extension-seams)
11
+ - [Map mechanics to seams](#map-mechanics-to-seams)
12
+ - [Respect deploy-time prerequisites](#respect-deploy-time-prerequisites)
13
+ - [Know the supported boundary](#know-the-supported-boundary)
14
+
15
+ ## Use the four-way classification
16
+
17
+ Classify the request as one of:
18
+
19
+ 1. **Native** — a current CLI command/flag combination performs it directly.
20
+ 2. **Extension** — a custom minter, hook, field renderer, seed source, or transfer validator performs
21
+ it while the token remains a canonical factory clone.
22
+ 3. **Unsupported/foreclosed** — the capability contract lists it as unsupported, or the existing
23
+ contract's immutable type/options exclude the prerequisite.
24
+ 4. **Unknown** — no supported route has been demonstrated. Inspect help, implementation/contracts,
25
+ and state; report uncertainty if it remains unproven.
26
+
27
+ Never infer “unsupported” from the absence of a flag. Never infer “possible” merely because an item is
28
+ absent from a short no-list. A capability claim needs a native lane or an exact extension seam.
29
+
30
+ Give the creator the route, engineering required, authority model, gas/hosting/reach tradeoff,
31
+ irreversible prerequisites, and verification plan. “Possible” without those qualifiers is not useful.
32
+
33
+ ## Inspect the machine-readable contract
34
+
35
+ Run:
36
+
37
+ ```bash
38
+ abx capabilities --json
39
+ abx help <relevant-command>
40
+ ```
41
+
42
+ The capability contract reports native deployment lanes, EditionCode/static edition differences,
43
+ extension seams, deploy-time choices, and currently unsupported product boundaries. For an existing
44
+ collection, also run `abx state`; capability depends on the contract already deployed, not only on
45
+ what the newest CLI could deploy today.
46
+
47
+ Use a deploy command's `--dry-run --json` for a concrete plan. It is the source of truth for the
48
+ active chain, artifacts, signer, storage, addresses, transaction count, and measured warnings.
49
+
50
+ ## Use canonical extension seams
51
+
52
+ A custom mechanic normally lives beside a canonical token rather than replacing it.
53
+
54
+ | Seam | Wired with | Runs | Can veto? |
55
+ |---|---|---|---|
56
+ | Custom minter | `abx set-minter --minter 0x…` | before/calling issuance | it controls whether it calls mint |
57
+ | Configure hook | `abx set-param-hooks --configure 0x…` | before a governed parameter write persists | yes |
58
+ | Transfer hook | `abx set-param-hooks --transfer 0x…` | on mint, transfer, and burn | yes |
59
+ | Augment hook | `abx set-param-hooks --augment 0x…` | while token data is assembled | no; computes/adds/overrides data |
60
+ | Image/traits renderer | deploy-code renderer flags | while on-chain metadata fields render | a revert can break that read; design never-revert |
61
+ | Seed source | `abx set-seed-source` | future code-token mints | supplies mint-time seed input |
62
+ | Transfer validator | `--721c` then `set-transfer-validator` | standards-track transfer validation | yes, according to validator |
63
+
64
+ One external contract may implement several hook/minter roles. Test it against a real deployed clone,
65
+ not a mock that approximates ABX callbacks.
66
+
67
+ ABX scaffolds a Foundry renderer project but does not compile, link, or audit custom Solidity.
68
+ `abx deploy-contract` can send exact compiled creation bytecode through any signing lane. The
69
+ sponsored lane calls the keyless CREATE2 proxy, so the constructor caller is that proxy; use explicit
70
+ constructor arguments for ownership. Hot, wallet, and unsigned lanes retain direct CREATE. The
71
+ creator or their contract engineer owns code review, verification, upgrade policy, and audits.
72
+
73
+ ### Custom minter
74
+
75
+ Series and editions can authorize one minter contract. Use it for pricing/allocation rules that do not
76
+ fit the shared fixed-price minter: auctions, allowlists, raffles, free claims, ERC-20 payment, escrowed
77
+ issuance, or other pre-mint logic. The minter eventually calls the token's canonical mint entry point.
78
+
79
+ A plain 1/1 has no Series minter seam. Decide whether the requested issuance model actually requires
80
+ a Series/edition before deploying.
81
+
82
+ ### Configure hook
83
+
84
+ The configure hook receives the proposed typed parameter write before it persists. Its revert rejects
85
+ the write. It can enforce monotonicity, one-time writes, cross-contract authorization, payload shape,
86
+ or size bounds. For blob-backed strings/bytes, validate length before reading large data and read the
87
+ provided data pointer using the documented SSTORE2 convention.
88
+
89
+ The previously stored value remains visible during validation, enabling comparisons. A rejected
90
+ write may still have paid for preparatory blob storage; front ends should simulate before asking for a
91
+ signature.
92
+
93
+ ### Transfer hook
94
+
95
+ The transfer hook runs for mints (`from == 0`), ordinary transfers, and burns (`to == 0`). Reverting
96
+ vetoes the entire operation. It can implement vesting, soulbinding, redemption, escrow settlement,
97
+ provenance counters, and lifecycle rules.
98
+
99
+ On ERC-721 projects it also receives self-transfers (`from == to`) because those emit `Transfer`.
100
+ That is intentional; a hook concerned only with ownership-set changes should ignore the case itself.
101
+ ERC-1155 projects skip self-transfers and zero-amount entries before invoking the hook.
102
+
103
+ It cannot initiate a transfer; it only observes or rejects one. Burn-based mechanics require the
104
+ collection to have been deployed burnable. On editions, ids may have many holders, so shared per-id
105
+ state cannot model a single current owner.
106
+
107
+ ### Augment hook
108
+
109
+ The augment hook is a read-time view seam. It may read other contracts, an oracle, block state, or
110
+ stored params and return final token-data strings. Use it for live/derived state or computed data that
111
+ should not be stored.
112
+
113
+ Volatile augmentation makes the live view change without an event or stored write. A marketplace still
114
+ remains a snapshot until it is rendered again. If a custom Solidity field renderer needs augmented
115
+ state, it must read/call the relevant hook/state itself; field-renderer calls do not receive a prepared
116
+ token-data object.
117
+
118
+ ## Map mechanics to seams
119
+
120
+ | Request | Primary route | Prerequisites/limits |
121
+ |---|---|---|
122
+ | Auction, allowlist, raffle, free claim | custom minter | Series or edition mint authority |
123
+ | ERC-20 priced mint | custom minter | payment logic/audit outside ABX |
124
+ | Soulbound or timed transfer lock | transfer hook | deploy-code; hook also sees mint |
125
+ | Burn-to-redeem/combine | external controller/minter + burnable; optional transfer/augment hooks | ABX provides seams, not the atomic combine implementation |
126
+ | Escrow tied to token lifecycle | minter + transfer hook | external value-holding contract |
127
+ | Monotonic level/high-water mark | governed param + configure hook | schema and old-value comparison |
128
+ | Structured collector configuration | governed param + configure hook | typed payload and bounded size |
129
+ | Holder of another token may configure | schema address auth or configure hook | cross-contract read |
130
+ | Art reacts to oracle/block/other contract | augment hook or renderer direct read | disclose live/non-deterministic behavior |
131
+ | Timed reveal | augment hook or renderer logic | live view versus still refresh distinction |
132
+ | On-chain SVG and coherent traits | image + attributes renderers | never-revert Solidity implementations |
133
+ | Small inline SVG/text, one deployment transaction | bare `--onchain-uri` | only when the dry run confirms inline custody and one transaction |
134
+ | Large media stored on-chain | `--onchain-image` | staged before deployment: at least two transactions; measured write cost and endpoint-dependent read reach |
135
+ | One program, each token carries its own data | `deploy-code --script` + `<key>:Bytes:Creator` | mint, then set the creator payload with `configure-param --file`; no on-chain size budget on the param itself |
136
+ | Royalty-aware transfer validation | ERC-721C/ERC-1155C validator | opt-in at deploy; marketplace compatibility varies |
137
+
138
+ When several routes work, prefer the smallest authority surface. Use the stock fixed-price minter
139
+ instead of custom Solidity for an ordinary sale; use a schema without a hook when static authorization
140
+ is sufficient; use an on-chain renderer only when its durability/reach/cost trade is desired.
141
+
142
+ A transfer hook only observes or vetoes a burn; it does not initiate two burns or mint a replacement.
143
+ For combine mechanics, prove the controller's burn authorization and canonical mint call against a
144
+ real clone, make the transition atomic and replay-safe, and define pair/history storage. On ERC-721,
145
+ `--max` is a lifetime id cap and burns do not reopen slots, so reserve replacement-id headroom or use
146
+ a supply policy that does not require new ids. On a burnable edition, a burn frees live per-id supply,
147
+ but every copy of an id shares its id-level seed and PostParams.
148
+
149
+ ## Respect deploy-time prerequisites
150
+
151
+ Ask about mechanics before deployment. These decisions cannot be retrofitted:
152
+
153
+ - static versus code-capable contract type; hooks/PostParams require SeriesCode or EditionCode;
154
+ - ERC-721 versus ERC-1155 edition shape through `--copies`;
155
+ - burnability;
156
+ - ERC-721C/ERC-1155C enrollment.
157
+
158
+ Other choices may be mutable but become irreversible when locked: URI configuration, fields, script,
159
+ dependencies, hooks, governed values/schema, royalty ceiling, and owner authority. An existing project
160
+ may therefore be capable in protocol terms but foreclosed by its current type or locks. Say that
161
+ specifically instead of saying ABX as a whole cannot do it.
162
+
163
+ Use `abx predict` to break address cycles where an external controller needs the token address at its
164
+ own construction and the token must reference the controller during deployment. Confirm the guarded
165
+ salt/deployer and predicted address before deploying either side.
166
+
167
+ ## Know the supported boundary
168
+
169
+ The toolkit currently does not provide:
170
+
171
+ - operation on a chain whose capability entry is `disabled`;
172
+ - a secondary-market listing/order-book feature;
173
+ - Solidity compilation through `abx`;
174
+ - retrofitting a deploy-time contract type, burnability, token standard, or creator-token enrollment.
175
+
176
+ Do not recommend another protocol automatically when one of these applies. State the boundary and
177
+ stop unless the creator asks for alternatives.
178
+
179
+ Also distinguish unsupported tooling from possible external engineering. For example, ABX does not
180
+ compile a custom hook, but a hook is an intentional supported seam once independently built and
181
+ deployed (including from exact initcode via `abx deploy-contract`). Conversely, “arbitrary Solidity exists” is not proof that every behavior is safe or
182
+ compatible: analyze callback timing, authority, reverts, reentrancy, shared edition state, gas, and
183
+ upgradeability.
184
+
185
+ Before finalizing a custom mechanic, document:
186
+
187
+ 1. canonical token family and deploy-time prerequisites;
188
+ 2. external contracts and their roles/owners/upgrade paths;
189
+ 3. callback inputs, state transitions, and every veto path;
190
+ 4. mint/transfer/burn behavior including editions;
191
+ 5. parameter schema and authorization;
192
+ 6. live versus settled/rendered state;
193
+ 7. locks and the exact guarantee they create;
194
+ 8. unit, fork, and end-to-end test plan;
195
+ 9. collector-facing disclosure of remaining powers.
@@ -0,0 +1,236 @@
1
+ # Code projects, renderers, and PostParams
2
+
3
+ Use this reference for `preview`, `inspect`, `deploy-code`, JavaScript/build projects, Solidity field
4
+ renderers, marketplace stills and traits, seeds, dependencies, parameters, and code-project locks.
5
+
6
+ ## Contents
7
+
8
+ - [Choose the runtime lane](#choose-the-runtime-lane)
9
+ - [Design every public surface](#design-every-public-surface)
10
+ - [Preview and inspect honestly](#preview-and-inspect-honestly)
11
+ - [Plan JavaScript projects](#plan-javascript-projects)
12
+ - [Plan Solidity field renderers](#plan-solidity-field-renderers)
13
+ - [Use PostParams and hooks](#use-postparams-and-hooks)
14
+ - [Handle seeds and dependencies](#handle-seeds-and-dependencies)
15
+ - [Verify and freeze](#verify-and-freeze)
16
+
17
+ ## Choose the runtime lane
18
+
19
+ `deploy-code` selects a code-capable canonical contract. It supports four useful input shapes:
20
+
21
+ | Shape | Core flags | Typical surfaces |
22
+ |---|---|---|
23
+ | On-chain JavaScript template | `--script <file>` | on-chain program; hosted or on-chain assembled live document |
24
+ | Shared program + per-token payload | `--script` + `--schema <key>:Bytes:Creator` | one chunked engine; after mint, set each token's `Bytes` PostParam with `configure-param --file` |
25
+ | Build directory | `--code-dir <dir>` | uploaded application bundle; resolver/live view |
26
+ | Solidity-computed fields | `--image-renderer` and/or `--attributes-renderer` | on-chain SVG image and/or traits |
27
+ | Hybrid | script plus field renderers | program animation plus Solidity image/traits |
28
+
29
+ `--script` splits the source into on-chain chunks automatically (default ~22 KB per chunk, the
30
+ practical SSTORE2/EIP-170 limit). Pass `--chunk-size <bytes>` to override the split size — smaller
31
+ values force a multi-chunk program cheaply, which is the fast way to exercise multi-chunk behavior on
32
+ a tiny test script rather than needing a large real one. `abx replace-script`
33
+ ([operate.md](operate.md#replacing-an-unlocked-script)) accepts the same flag.
34
+
35
+ There is no fixed supported script-size ceiling. Post-deploy setup (chunks, PostParam schemas,
36
+ dependency declarations, on-chain-URI legs, reserve mints) rides one combined transaction when it
37
+ fits; a large script splits it into several gas-bounded transactions instead — chunks first, then the
38
+ remaining config, mints strictly last. The dry run's `transactions`/`approvals` reports the real
39
+ count for the whole plan; if any single one is interrupted mid-sequence, `--resume` finishes it (see
40
+ [diagnose.md](diagnose.md#incomplete-deployments)) — every non-mint leg is idempotent, so re-running
41
+ resume is always safe.
42
+
43
+ Without `--copies`, the contract is SeriesCode (ERC-721). With `--copies <n|open>`, it is EditionCode
44
+ (ERC-1155): N generated ids, each with multiple copies. EditionCode currently supports scripts,
45
+ directory builds (`--code-dir`), dependencies, field renderers, deterministic per-id off-chain stills
46
+ (`--image-base`), and `--resume` for an incomplete deployment (see
47
+ [diagnose.md](diagnose.md#incomplete-deployments) — the mint leg diffs per id, with a new
48
+ `--mint-amount` naming each premint id's intended copy count). Run `abx capabilities --json`
49
+ immediately before planning.
50
+
51
+ For one generated work with 100 copies, use `--max 1 --copies 100`. Omitting `--max 1` leaves the
52
+ default multi-id space, producing multiple generated ids with 100 copies available for each id.
53
+
54
+ A creator who needs parameters or hooks must use a code-capable contract even if the output is a
55
+ static-looking SVG or image. This is a deploy-time type decision.
56
+
57
+ ## Design every public surface
58
+
59
+ A code project is not one URL. Decide each surface separately:
60
+
61
+ - **Program/animation** — the live JavaScript document or absence of one.
62
+ - **Marketplace image** — a rendered still, a deterministic image URL, an on-chain Solidity SVG, or
63
+ an explicit placeholder during development.
64
+ - **Marketplace traits** — renderer-computed JSON, resolver/effects output, or intentionally omitted.
65
+ - **PostParams** — canonical typed state on the token contract, consumed by the program/renderers.
66
+ - **Attachments** — named files served through a resolver's artifacts/data surface.
67
+
68
+ “The program is on-chain” does not prove that image and traits are on-chain. “The animation works”
69
+ does not prove a marketplace thumbnail exists. Write a surface matrix before deployment and verify
70
+ each row after minting.
71
+
72
+ ## Preview and inspect honestly
73
+
74
+ Use `abx preview` while authoring and `abx inspect` before choosing a deployment lane.
75
+
76
+ Preview uses the canonical runtime envelope, dependency order, and token-data shape with synthetic
77
+ inputs. It is a high-fidelity authoring preview, not an end-to-end deployment proof. It does not prove:
78
+
79
+ - that a chosen dependency resolves on the target chain;
80
+ - that the deployed generator or renderer fits an RPC's read allowance;
81
+ - that real minted seeds and PostParams are consumed correctly in every state;
82
+ - that marketplace metadata contains image and attributes;
83
+ - that a hosted resolver/effects/storage path is reachable.
84
+
85
+ Use `--shoot` for representative frames. Exercise more than the default seed and every user-facing
86
+ parameter. Then run `abx inspect` to analyze dependencies, deterministic seed usage, declared traits,
87
+ document size, and lane fit. Treat findings as evidence and the deploy dry run/testnet verification as
88
+ the final proof.
89
+
90
+ Avoid unseeded randomness, wall-clock dependence, environment-only assets, and network fetches when
91
+ claiming reproducibility. A live-data design is valid; label it live rather than deterministic.
92
+
93
+ ## Plan JavaScript projects
94
+
95
+ ### On-chain program, hosted resolution
96
+
97
+ Use `--script` with `--public-base-url` when a resolver should assemble the live document and expose
98
+ mutable metadata/render surfaces. The script remains on-chain; the public metadata path is HTTP.
99
+ This is normally the most interoperable lane for a sale where thumbnails must update continuously.
100
+
101
+ Run an effects service for derived stills and traits:
102
+
103
+ - `abx effects` runs locally and blocks; use it for development or a co-located operator.
104
+ - `abx deploy-effects --resolver-url <url>` scaffolds a continuously running service.
105
+ - `abx render <addr> [ids] --remote <resolver>` performs a one-shot/backfill render.
106
+
107
+ The renderer must store its bytes in a backend the resolver can retrieve. A hosted resolver cannot
108
+ read a laptop-local `fs` store. Managed providers may advertise managed rendering; confirm with
109
+ `abx remote <name>` rather than assuming it.
110
+
111
+ ### On-chain program and on-chain live document
112
+
113
+ Use `--script --onchain-uri` when the generator can assemble the animation document entirely from
114
+ on-chain program/dependency bytes. This can remove an always-on resolver for the live program.
115
+
116
+ Check the deploy dependency report and `abx verify` before calling it chain-complete: a registry
117
+ dependency may resolve through a CDN instead of on-chain bytes. Large assembled documents may exceed
118
+ some endpoints' `eth_call` allowance; report the measured reach, not “any RPC forever.”
119
+
120
+ For a JavaScript lane, the marketplace image remains a separate decision. With no resolver watcher,
121
+ a still published to a deterministic public `--image-base` is a manual/backfill surface: rerun render
122
+ after relevant parameter changes. An on-chain animation plus automatically updating off-chain still
123
+ requires an operator watching state.
124
+
125
+ EditionCode now accepts `--image-base` too: the same `{base}/{id}.png` url-template, one id space
126
+ finer — `{id}` is the EditionCode id, and every copy of that id shares the one image (there is no
127
+ per-copy addressing). The effect runner never renders an id with zero live copies (no mint-time seed
128
+ has been drawn yet for it), so an unminted premint id is skipped, not errored — it renders once the
129
+ first copy mints. `--image-base` stays mutually exclusive with `--image-renderer` on both lanes.
130
+
131
+ ### Build directory
132
+
133
+ Use `--code-dir` for an application bundle whose files are uploaded and addressed as a code artifact.
134
+ It requires external storage and public resolution — a backend without directory upload (`fs`, the
135
+ local default) is refused; pick `--backend ipfs` or `--backend arweave`. Inspect the built output, not
136
+ only the source tree, and verify that every referenced asset is included. The live view 302s through
137
+ the gateway, so the gateway must serve HTML (the shared Pinata public gateway does not — use a
138
+ dedicated gateway or Arweave). `--code-dir` works with `--copies` too (EditionCode): the same upload,
139
+ the same on-chain `code` field, the same gateway rules — `--script` and `--code-dir` remain mutually
140
+ exclusive on both lanes.
141
+
142
+ ## Plan Solidity field renderers
143
+
144
+ `--image-renderer <address>` stores an `IAbxFieldRenderer` pointer for the metadata image field;
145
+ `--attributes-renderer <address>` does the same for traits. With `--onchain-uri`, the canonical
146
+ metadata renderer calls them on-chain. A renderer-only project needs no JavaScript program and no
147
+ effects runner.
148
+
149
+ Start with `abx scaffold-renderer`, then build and test the Solidity project using Foundry. Deploy
150
+ with Foundry or send the exact compiled initcode through `abx deploy-contract`; ABX does not compile,
151
+ link, audit, or infer constructor types. With `--sponsor`, use explicit constructor arguments for
152
+ ownership because the keyless CREATE2 proxy—not the creator wallet—is the constructor caller. A real
153
+ collection deploy refuses a renderer address with no code.
154
+
155
+ Enforce these invariants in renderer tests:
156
+
157
+ - `render(token, tokenId, field)` must not revert for unminted ids, missing params, boundary values,
158
+ unexpected callers, or retired schema state.
159
+ - Return the correct media type and valid complete content: SVG for image, JSON attributes array for
160
+ traits.
161
+ - Derive image and traits from the same seed/state model.
162
+ - Bound loops and output. Test realistic worst cases through an RPC call, not only local unit gas.
163
+ - Treat a renderer or hook address lock as a pointer lock. Use immutable deployments for stronger
164
+ permanence claims; an upgradeable proxy can change behavior behind a locked address.
165
+
166
+ Solidity image/attributes renderers work on both SeriesCode and EditionCode, including renderer-only
167
+ editions. They eliminate off-chain stills only for the fields they compute; a separate JavaScript
168
+ animation may still exist.
169
+
170
+ ## Use PostParams and hooks
171
+
172
+ PostParams are typed, schema-governed state stored on-chain. Use `--schema` at deployment or
173
+ `abx set-schema` later, then `abx configure-param` through the governed path. Inspect current type,
174
+ authorization, and lock grammar with command help instead of memorizing it.
175
+
176
+ Model parameters deliberately:
177
+
178
+ - Define a stable key and type; do not change a key's meaning across versions.
179
+ - Choose creator, token-owner/holder, or address authorization to match the actual state model.
180
+ - Validate input in the UI and again in a configure hook when the rule must be enforced on-chain.
181
+ - Treat string/bytes values as potentially large and price/limit them appropriately.
182
+ - Retire or weld a governed parameter only after the current value and defaults are verified.
183
+
184
+ ### Edition shared state
185
+
186
+ On EditionCode, parameters belong to an **id**, not an individual physical copy. If token id 3 has
187
+ 100 holders, they all read the same value for id 3. With holder authorization any holder may write it;
188
+ the last valid writer wins. This is good for communal state and wrong for “name my personal copy.”
189
+ Use one id per personalized work when per-holder state is required.
190
+
191
+ A holder-writable large string/bytes parameter can also expand the shared id's metadata beyond common
192
+ RPC read reach. State this before deployment and use schema validation/hooks to bound it when needed.
193
+
194
+ ### Hooks
195
+
196
+ SeriesCode and EditionCode expose three configurable hook addresses:
197
+
198
+ - configure hook: validates/vetoes governed writes before they persist;
199
+ - transfer hook: observes every mint, transfer, and burn and may veto the operation;
200
+ - augment hook: computes additional/overriding token data during reads.
201
+
202
+ Hooks are extension seams, not ordinary CLI flags. Build and deploy them outside ABX, wire them with
203
+ `abx set-param-hooks`, test against a real clone, and read [capabilities.md](capabilities.md). A
204
+ transfer-hook revert fails mints as well as secondary transfers. Freeze the addresses with
205
+ `abx lock-param-hooks` only after testing every lifecycle transition.
206
+
207
+ ## Handle seeds and dependencies
208
+
209
+ Seeds are generated at mint and drive reproducible variation. `abx inspect` identifies common seed
210
+ misuse, but test multiple real token-data fixtures. A custom seed source affects future mints and is
211
+ an external contract pointer; verify its code/interface and disclose who can change its behavior.
212
+
213
+ Dependencies are ordered; index 0 is the runtime. A `name@version` reference resolves through the
214
+ collection's dependency-registry pointer, while a `0x…` reference reads a data contract directly.
215
+ Registry availability is chain-specific. Read the deploy dependency report: a named dependency can
216
+ be valid yet served from a CDN, which means the document is not chain-complete.
217
+
218
+ `lock-dependencies` freezes the reference list and registry pointer, not necessarily the bytes a live
219
+ registry entry returns. Use immutable on-chain data contracts for a stronger frozen-dependency claim.
220
+
221
+ ## Verify and freeze
222
+
223
+ After deploying and minting representative ids:
224
+
225
+ 1. Read `abx state`, `abx tokens --json`, and `abx tokenuri`.
226
+ 2. Open the animation/live view using actual minted token data.
227
+ 3. Fetch the marketplace image and inspect `attributes` from token metadata.
228
+ 4. Run `abx verify` and resolve placeholder, chain-complete, dependency, or render warnings.
229
+ 5. Change every intended parameter through its authorized path; confirm still refresh behavior.
230
+ 6. Exercise mint, transfer, and burn paths if hooks or burnability are involved.
231
+ 7. Verify dependency and renderer addresses and whether their code is upgradeable.
232
+ 8. Lock only the surfaces the creator has explicitly chosen to freeze.
233
+
234
+ A fully frozen code-project posture may involve URI/field locks, `lock-script`,
235
+ `lock-dependencies`, `lock-param-hooks`, and governed parameter locks. Those locks cover different
236
+ state. Describe exactly what each freezes; never summarize them as “the output can never change.”
@@ -0,0 +1,94 @@
1
+ # ERC-721C / ERC-1155C transfer validation
2
+
3
+ Use this reference only when the creator asks about creator-token standards, transfer validation,
4
+ royalty-enforcement compatibility, validator selection, or changing/suspending validation.
5
+
6
+ ## Separate three mechanisms
7
+
8
+ - **Royalties** declare a receiver and basis points through the token's royalty interface. They do
9
+ not force a marketplace to pay.
10
+ - **Creator-token enrollment** opts the collection into ERC-721C or ERC-1155C validation at deploy.
11
+ Transfers consult a validator selected by the owner.
12
+ - **ABX transfer hooks** are code-project extension callbacks and may implement arbitrary project
13
+ lifecycle rules. They are not creator-token validators.
14
+
15
+ These mechanisms can coexist and may each reject a transfer for a different reason. Diagnose the
16
+ actual contract state and revert path.
17
+
18
+ ## Enrollment is deploy-time
19
+
20
+ Pass `--721c recommended|0x…` on the selected deploy command to create the creator-token variant. The
21
+ same flag chooses the ERC-1155C twin when `--copies` selects an edition. Absence creates the ordinary
22
+ ERC-721/ERC-1155 family.
23
+
24
+ Enrollment cannot be added or removed after deployment. Ask before spending:
25
+
26
+ - Does the creator actually want standards-track transfer validation?
27
+ - Which validator and security policy should govern transfers?
28
+ - Is the intended marketplace/wallet flow compatible on the target chain today?
29
+ - Who may later change or suspend the validator?
30
+ - Is the stronger restriction worth the interoperability and owner-power tradeoff?
31
+
32
+ Do not default into enrollment merely because the creator set a royalty. Do not present it as a
33
+ guarantee of payment across all marketplaces.
34
+
35
+ ## Select and validate the validator
36
+
37
+ `recommended` resolves the toolkit's current recommended creator-fee validator for the active chain.
38
+ An explicit address must be a deployed validator contract that actually implements the expected
39
+ interface and rejects unsupported calls. A Safe, EOA, empty proxy, or permissive fallback is not an
40
+ enforcement policy even if it has code.
41
+
42
+ Let the CLI probe the address. Do not bypass a refusal with a raw transaction. For a custom validator,
43
+ review and test:
44
+
45
+ - transfer behavior for owner, approved operator, marketplace conduit, and ordinary recipient;
46
+ - mint and burn behavior where the standard invokes validation;
47
+ - upgrade/administration powers and who controls them;
48
+ - failure behavior when external registries are unavailable;
49
+ - ERC-721 versus ERC-1155 amount/batch semantics;
50
+ - interaction with an ABX transfer hook.
51
+
52
+ Marketplace allowlists, registry addresses, and supported flows change. Use current command output,
53
+ the validator's primary documentation, and a testnet transaction rather than a dated compatibility
54
+ table in this skill.
55
+
56
+ ## Operate an enrolled collection
57
+
58
+ Read current enrollment and validator state with `abx state`. Use:
59
+
60
+ ```bash
61
+ abx set-transfer-validator <address> recommended
62
+ abx set-transfer-validator <address> 0x...
63
+ abx set-transfer-validator <address> none
64
+ ```
65
+
66
+ Run command help for current syntax and a dry run before writing. Setting `none` suspends the active
67
+ validator where supported; it does not convert the contract back to a plain non-C token. Enrollment
68
+ and the associated owner power remain part of the contract's permanent type.
69
+
70
+ Before changing the validator:
71
+
72
+ 1. Read the current validator, owner, royalty, minter, and transfer-hook state.
73
+ 2. Explain whether the change tightens, loosens, or suspends transfer policy.
74
+ 3. Test representative transfers using the intended marketplace/operator on testnet.
75
+ 4. Receive exact human confirmation.
76
+ 5. Execute once and re-read state.
77
+
78
+ If a transfer fails, do not clear the validator as a generic repair. Determine whether the failure
79
+ comes from the creator-token validator, an ABX transfer hook, token ownership/approval, pause/mint
80
+ rules, or the receiving contract. Changing enforcement is a policy decision, not troubleshooting.
81
+
82
+ ## Disclose owner powers precisely
83
+
84
+ Collectors should know:
85
+
86
+ - the collection is permanently enrolled in the creator-token variant;
87
+ - the current validator address and whether it is upgradeable;
88
+ - who can change or suspend that validator;
89
+ - whether a separate ABX transfer hook can veto transfers/mints;
90
+ - whether hook addresses are locked;
91
+ - the royalty rate, receiver, and permanent ceiling.
92
+
93
+ A locked ABX hook set does not lock the creator-token validator, and creator-token enrollment does not
94
+ freeze royalties. List each power separately.