@artblocks/abx-cli 0.1.0-alpha.4 → 0.1.0-alpha.40
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.
- package/CHANGELOG.md +16 -0
- package/assets/renderer-scaffold/README.md +29 -11
- package/assets/renderer-scaffold/foundry.toml +1 -0
- package/assets/renderer-scaffold/remappings.txt +1 -1
- package/assets/renderer-scaffold/script/DeployHooks.s.sol +24 -0
- package/assets/renderer-scaffold/src/MyHooks.sol +20 -0
- package/assets/renderer-scaffold/src/MyRenderer.sol +4 -4
- package/assets/renderer-scaffold/src/MyTraits.sol +2 -2
- package/assets/renderer-scaffold/test/MyRenderer.t.sol +60 -3
- package/dist/bin.d.ts +26 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +63 -0
- package/dist/bin.js.map +1 -0
- package/dist/capabilities.d.ts +94 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +135 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/commands/auth.d.ts +54 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +447 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/deploy.d.ts +242 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +4763 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/feedback.d.ts +7 -0
- package/dist/commands/feedback.d.ts.map +1 -0
- package/dist/commands/feedback.js +147 -0
- package/dist/commands/feedback.js.map +1 -0
- package/dist/commands/project.d.ts +257 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +1414 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/commands/reads.d.ts +64 -0
- package/dist/commands/reads.d.ts.map +1 -0
- package/dist/commands/reads.js +701 -0
- package/dist/commands/reads.js.map +1 -0
- package/dist/commands/scaffold.d.ts +89 -0
- package/dist/commands/scaffold.d.ts.map +1 -0
- package/dist/commands/scaffold.js +733 -0
- package/dist/commands/scaffold.js.map +1 -0
- package/dist/commands/service.d.ts +67 -0
- package/dist/commands/service.d.ts.map +1 -0
- package/dist/commands/service.js +741 -0
- package/dist/commands/service.js.map +1 -0
- package/dist/commands/storage.d.ts +51 -0
- package/dist/commands/storage.d.ts.map +1 -0
- package/dist/commands/storage.js +370 -0
- package/dist/commands/storage.js.map +1 -0
- package/dist/commands/submit-app.d.ts +59 -0
- package/dist/commands/submit-app.d.ts.map +1 -0
- package/dist/commands/submit-app.js +513 -0
- package/dist/commands/submit-app.js.map +1 -0
- package/dist/config.d.ts +90 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +284 -11
- package/dist/config.js.map +1 -1
- package/dist/conformance.d.ts +31 -0
- package/dist/conformance.d.ts.map +1 -0
- package/dist/conformance.js +390 -0
- package/dist/conformance.js.map +1 -0
- package/dist/contract-read-error.d.ts +5 -0
- package/dist/contract-read-error.d.ts.map +1 -0
- package/dist/contract-read-error.js +37 -0
- package/dist/contract-read-error.js.map +1 -0
- package/dist/deps.d.ts +6 -39
- package/dist/deps.d.ts.map +1 -1
- package/dist/deps.js +4 -68
- package/dist/deps.js.map +1 -1
- package/dist/errors.d.ts +20 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +25 -0
- package/dist/errors.js.map +1 -0
- package/dist/flag-allowlists.d.ts +53 -0
- package/dist/flag-allowlists.d.ts.map +1 -0
- package/dist/flag-allowlists.js +180 -0
- package/dist/flag-allowlists.js.map +1 -0
- package/dist/flags.d.ts +41 -0
- package/dist/flags.d.ts.map +1 -1
- package/dist/flags.js +111 -1
- package/dist/flags.js.map +1 -1
- package/dist/jsonout.d.ts +37 -0
- package/dist/jsonout.d.ts.map +1 -0
- package/dist/jsonout.js +68 -0
- package/dist/jsonout.js.map +1 -0
- package/dist/kind.d.ts +57 -0
- package/dist/kind.d.ts.map +1 -0
- package/dist/kind.js +122 -0
- package/dist/kind.js.map +1 -0
- package/dist/main.js +747 -4838
- package/dist/main.js.map +1 -1
- package/dist/mintpage.d.ts +17 -2
- package/dist/mintpage.d.ts.map +1 -1
- package/dist/mintpage.js +241 -54
- package/dist/mintpage.js.map +1 -1
- package/dist/output.d.ts +179 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +780 -0
- package/dist/output.js.map +1 -0
- package/dist/ownerops.d.ts +312 -57
- package/dist/ownerops.d.ts.map +1 -1
- package/dist/ownerops.js +1808 -357
- package/dist/ownerops.js.map +1 -1
- package/dist/preview.d.ts +23 -5
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +95 -43
- package/dist/preview.js.map +1 -1
- package/dist/prompt.d.ts +17 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +19 -0
- package/dist/prompt.js.map +1 -0
- package/dist/provision.d.ts +3 -13
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.js +19 -21
- package/dist/provision.js.map +1 -1
- package/dist/remote.d.ts +157 -52
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +435 -46
- package/dist/remote.js.map +1 -1
- package/dist/riskgate.d.ts +62 -0
- package/dist/riskgate.d.ts.map +1 -0
- package/dist/riskgate.js +234 -0
- package/dist/riskgate.js.map +1 -0
- package/dist/scaffold.d.ts +12 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +56 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/schema.d.ts +36 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +121 -26
- package/dist/schema.js.map +1 -1
- package/dist/script-chunks.d.ts +8 -0
- package/dist/script-chunks.d.ts.map +1 -0
- package/dist/script-chunks.js +35 -0
- package/dist/script-chunks.js.map +1 -0
- package/dist/served.d.ts +30 -0
- package/dist/served.d.ts.map +1 -0
- package/dist/served.js +112 -0
- package/dist/served.js.map +1 -0
- package/dist/signer.d.ts +13 -0
- package/dist/signer.d.ts.map +1 -1
- package/dist/signer.js +84 -15
- package/dist/signer.js.map +1 -1
- package/dist/update-check.d.ts +86 -5
- package/dist/update-check.d.ts.map +1 -1
- package/dist/update-check.js +161 -20
- package/dist/update-check.js.map +1 -1
- package/package.json +13 -12
- package/skill/SKILL.md +179 -347
- package/skill/agents/openai.yaml +4 -0
- package/skill/reference/capabilities.md +188 -0
- package/skill/reference/code.md +211 -0
- package/skill/reference/creator-token.md +94 -0
- package/skill/reference/deploy.md +167 -0
- package/skill/reference/diagnose.md +165 -0
- package/skill/reference/hosting.md +161 -94
- package/skill/reference/operate.md +181 -0
- package/skill/reference/services.md +121 -0
- package/skill/reference/setup.md +140 -36
- package/assets/renderer-scaffold/src/interfaces/IAbxFieldRenderer.sol +0 -32
- package/assets/renderer-scaffold/src/interfaces/IAbxParams.sol +0 -26
- package/dist/inspect.d.ts +0 -48
- package/dist/inspect.d.ts.map +0 -1
- package/dist/inspect.js +0 -184
- package/dist/inspect.js.map +0 -1
- package/dist/migrate.d.ts +0 -65
- package/dist/migrate.d.ts.map +0 -1
- package/dist/migrate.js +0 -180
- package/dist/migrate.js.map +0 -1
- package/dist/onchain-uri.d.ts +0 -97
- package/dist/onchain-uri.d.ts.map +0 -1
- package/dist/onchain-uri.js +0 -243
- package/dist/onchain-uri.js.map +0 -1
- package/dist/upload.d.ts +0 -28
- package/dist/upload.d.ts.map +0 -1
- package/dist/upload.js +0 -41
- package/dist/upload.js.map +0 -1
- package/skill/reference/code-projects.md +0 -246
- package/skill/reference/operating.md +0 -116
- package/skill/reference/troubleshooting.md +0 -28
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @artblocks/abx-cli
|
|
2
|
+
|
|
3
|
+
## 0.1.0-alpha.40
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 64248d9: Establish the public source baseline and refresh dependency constraints.
|
|
8
|
+
- Updated dependencies [64248d9]
|
|
9
|
+
- @artblocks/abx-indexer@0.1.0-alpha.31
|
|
10
|
+
- @artblocks/abx-sdk@0.1.0-alpha.30
|
|
11
|
+
- @artblocks/abx-storage@0.1.0-alpha.30
|
|
12
|
+
- @artblocks/abx-token-api@0.1.0-alpha.33
|
|
13
|
+
|
|
14
|
+
## Unreleased
|
|
15
|
+
|
|
16
|
+
Public release history begins here.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
# ABX
|
|
1
|
+
# ABX Solidity extension workspace
|
|
2
2
|
|
|
3
|
-
A ready-to-build Foundry project for
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
A ready-to-build Foundry project for ABX's actual Solidity extension surfaces. Each role remains a
|
|
4
|
+
separate deployable contract: image/traits rendering, configure-time validation, transfer lifecycle,
|
|
5
|
+
and read-time augmentation. Use only the roles your project needs. There is intentionally no
|
|
6
|
+
"minter hook": minting is an external-minter capability, while the three PostParam hooks are
|
|
7
|
+
configure, transfer and augment.
|
|
7
8
|
|
|
8
9
|
`abx` does **not** compile or deploy Solidity for you; you build, test, and deploy this project with
|
|
9
10
|
Foundry, then hand the deployed address(es) to `abx deploy-code`, which verifies they have code.
|
|
@@ -11,16 +12,18 @@ Foundry, then hand the deployed address(es) to `abx deploy-code`, which verifies
|
|
|
11
12
|
## What's here
|
|
12
13
|
|
|
13
14
|
- `src/MyRenderer.sol` — the **image** renderer: seed → geometry, a `palette` HexColor PostParam →
|
|
14
|
-
tint. **Fork the geometry/palette math for your own
|
|
15
|
+
tint. **Fork the geometry/palette math for your own work.**
|
|
15
16
|
- `src/MyTraits.sol` — the **attributes** renderer: reads the *same* seed math so traits agree with
|
|
16
17
|
the image by construction.
|
|
17
|
-
- `src/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
- `src/MyHooks.sol` — small wrappers around one reference implementation for each PostParam hook
|
|
19
|
+
role. Fork a role independently; do not merge their authority just because they share a workspace.
|
|
20
|
+
- `abx-contracts~2.0.0` — the exact-pinned canonical interfaces, 721/1155 fixed-price minters,
|
|
21
|
+
reference hooks, token implementations and real-clone test harness. The scaffold carries no
|
|
22
|
+
hand-copied ABX interface.
|
|
21
23
|
- `test/MyRenderer.t.sol` — proves `render()` never reverts (incl. no-seed, no-palette, the
|
|
22
24
|
collection surface, and a fuzz over every seed/tokenId) and that image ↔ traits stay coherent.
|
|
23
|
-
- `script/Deploy.s.sol`
|
|
25
|
+
- `script/Deploy.s.sol` deploys renderers; `script/DeployHooks.s.sol` deploys the three hook examples
|
|
26
|
+
after a token address exists.
|
|
24
27
|
|
|
25
28
|
## Build, test, deploy
|
|
26
29
|
|
|
@@ -31,6 +34,10 @@ forge test # MUST pass — especially the never-revert cases
|
|
|
31
34
|
|
|
32
35
|
# deploy to your testnet, then copy the printed addresses:
|
|
33
36
|
forge script script/Deploy.s.sol --rpc-url <your-rpc-url> --private-key <key> --broadcast
|
|
37
|
+
|
|
38
|
+
# optional PostParam hooks, deployed separately after the token exists:
|
|
39
|
+
forge script script/DeployHooks.s.sol --sig "run(address,uint256)" <token> 1024 \
|
|
40
|
+
--rpc-url <your-rpc-url> --private-key <key> --broadcast
|
|
34
41
|
```
|
|
35
42
|
|
|
36
43
|
## Wire it into a drop
|
|
@@ -44,6 +51,17 @@ abx deploy-code \
|
|
|
44
51
|
--name "Your Collection" --symbol SYM [--max N] --sign --for <your wallet>
|
|
45
52
|
```
|
|
46
53
|
|
|
54
|
+
Then, only if using the hook examples:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
abx set-param-hooks <token> --configure <configure> --augment <augment> --transfer <transfer>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The transfer hook is a veto surface and also runs on mint. The reference counts only real
|
|
61
|
+
non-zero-to-non-zero moves and pins `msg.sender` to the token. On ERC-1155 it counts copies moved per
|
|
62
|
+
id; it never pretends a multi-copy id has one current owner. Freeze the selected hook addresses with
|
|
63
|
+
`abx lock-param-hooks` when the project is ready to make that authority immutable.
|
|
64
|
+
|
|
47
65
|
- `--onchain-uri` (no `--script`/`--code-dir`) is the in-chain lane — a small Solidity SVG is a
|
|
48
66
|
great fit for an on-chain `tokenURI` (unlike a 200KB JS bundle).
|
|
49
67
|
- `--schema palette:HexColor:TokenOwner` declares the collector param your renderer reads. **Omit it
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity 0.8.28;
|
|
3
|
+
|
|
4
|
+
import {Script, console2} from "forge-std/Script.sol";
|
|
5
|
+
import {MyConfigureHook, MyTransferHook, MyAugmentHook} from "../src/MyHooks.sol";
|
|
6
|
+
|
|
7
|
+
/// Deploy only the hook roles this project needs. TOKEN must already be deployed because every
|
|
8
|
+
/// write-time hook is pinned to its caller; this avoids a reusable hook accidentally trusting any
|
|
9
|
+
/// contract that knows its selector.
|
|
10
|
+
contract DeployHooks is Script {
|
|
11
|
+
function run(address token, uint256 maxDataLength) external {
|
|
12
|
+
vm.startBroadcast();
|
|
13
|
+
MyConfigureHook configure = new MyConfigureHook(token, maxDataLength);
|
|
14
|
+
MyTransferHook transfer = new MyTransferHook(token);
|
|
15
|
+
MyAugmentHook augment = new MyAugmentHook(transfer);
|
|
16
|
+
vm.stopBroadcast();
|
|
17
|
+
console2.log("configure hook:", address(configure));
|
|
18
|
+
console2.log("augment hook :", address(augment));
|
|
19
|
+
console2.log("transfer hook :", address(transfer));
|
|
20
|
+
console2.log(
|
|
21
|
+
"Next: abx set-param-hooks <token> --configure <configure> --augment <augment> --transfer <transfer>"
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity 0.8.28;
|
|
3
|
+
|
|
4
|
+
import {MaxDataLengthConfigureHook} from "abx-contracts/src/reference/MaxDataLengthConfigureHook.sol";
|
|
5
|
+
import {TransferCounterHook} from "abx-contracts/src/reference/TransferCounterHook.sol";
|
|
6
|
+
import {TransferCountAugmentHook} from "abx-contracts/src/reference/TransferCountAugmentHook.sol";
|
|
7
|
+
|
|
8
|
+
/// Fork these thin wrappers when your project needs different policy. Keeping each lifecycle role
|
|
9
|
+
/// in its own contract means a project only deploys and grants the authority it actually uses.
|
|
10
|
+
contract MyConfigureHook is MaxDataLengthConfigureHook {
|
|
11
|
+
constructor(address token, uint256 maxDataLength) MaxDataLengthConfigureHook(token, maxDataLength) {}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
contract MyTransferHook is TransferCounterHook {
|
|
15
|
+
constructor(address token) TransferCounterHook(token) {}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
contract MyAugmentHook is TransferCountAugmentHook {
|
|
19
|
+
constructor(TransferCounterHook counter) TransferCountAugmentHook(counter) {}
|
|
20
|
+
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
pragma solidity ^0.8.20;
|
|
3
3
|
|
|
4
4
|
import {LibString} from "solady/utils/LibString.sol";
|
|
5
|
-
import {IAbxFieldRenderer} from "abx/IAbxFieldRenderer.sol";
|
|
6
|
-
import {IAbxParams} from "abx/IAbxParams.sol";
|
|
5
|
+
import {IAbxFieldRenderer} from "abx-contracts/src/uri/IAbxFieldRenderer.sol";
|
|
6
|
+
import {IAbxParams} from "abx-contracts/src/extensions/params/IAbxParams.sol";
|
|
7
7
|
|
|
8
8
|
/// @title MyRenderer — a fully on-chain generative image, tinted by a collector PostParam
|
|
9
9
|
/// @notice FORK THIS. It renders the `image` field as an `image/svg+xml` document computed
|
|
@@ -19,7 +19,7 @@ import {IAbxParams} from "abx/IAbxParams.sol";
|
|
|
19
19
|
/// (declare the `palette` schema, or the param is fixed at the default and collectors
|
|
20
20
|
/// can't set it.) Pair with MyTraits.sol so image AND traits read the SAME seed math.
|
|
21
21
|
///
|
|
22
|
-
/// Swap the geometry/palette math below for your own
|
|
22
|
+
/// Swap the geometry/palette math below for your own work. Keep the FIVE INVARIANTS in
|
|
23
23
|
/// IAbxFieldRenderer — above all, NEVER revert (a revert bricks the whole tokenURI).
|
|
24
24
|
contract MyRenderer is IAbxFieldRenderer {
|
|
25
25
|
using LibString for uint256;
|
|
@@ -53,7 +53,7 @@ contract MyRenderer is IAbxFieldRenderer {
|
|
|
53
53
|
return (CONTENT_TYPE, bytes(_svg(seed, palette)));
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
// ── the
|
|
56
|
+
// ── the work: seed → geometry, palette → tint (replace with your own) ─────────
|
|
57
57
|
|
|
58
58
|
function _svg(bytes32 seed, string memory palette) private pure returns (string memory) {
|
|
59
59
|
uint256 rings = 3 + (uint8(seed[0]) % 6); // 3..8 rings (MUST match MyTraits' math)
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
pragma solidity ^0.8.20;
|
|
3
3
|
|
|
4
4
|
import {LibString} from "solady/utils/LibString.sol";
|
|
5
|
-
import {IAbxFieldRenderer} from "abx/IAbxFieldRenderer.sol";
|
|
6
|
-
import {IAbxParams} from "abx/IAbxParams.sol";
|
|
5
|
+
import {IAbxFieldRenderer} from "abx-contracts/src/uri/IAbxFieldRenderer.sol";
|
|
6
|
+
import {IAbxParams} from "abx-contracts/src/extensions/params/IAbxParams.sol";
|
|
7
7
|
|
|
8
8
|
/// @title MyTraits — on-chain marketplace traits, coherent with MyRenderer
|
|
9
9
|
/// @notice FORK THIS. Renders the `attributes` field as an `application/json` array a marketplace
|
|
@@ -4,7 +4,7 @@ pragma solidity ^0.8.20;
|
|
|
4
4
|
import {Test} from "forge-std/Test.sol";
|
|
5
5
|
import {MyRenderer} from "../src/MyRenderer.sol";
|
|
6
6
|
import {MyTraits} from "../src/MyTraits.sol";
|
|
7
|
-
import {IAbxParams} from "abx/IAbxParams.sol";
|
|
7
|
+
import {IAbxParams} from "abx-contracts/src/extensions/params/IAbxParams.sol";
|
|
8
8
|
|
|
9
9
|
/// A tiny stand-in for the ABX contract's param surface, so the renderers can be tested in
|
|
10
10
|
/// isolation — set a seed / palette (or don't) and assert the renderer behaves.
|
|
@@ -13,16 +13,47 @@ contract MockParams is IAbxParams {
|
|
|
13
13
|
mapping(uint256 => mapping(bytes32 => bool)) private ts;
|
|
14
14
|
mapping(bytes32 => bytes32) private cv;
|
|
15
15
|
mapping(bytes32 => bool) private cs;
|
|
16
|
+
// `Bytes`/`String` params: the bytes32 holds keccak(content), the content lives here.
|
|
17
|
+
mapping(uint256 => mapping(bytes32 => bytes)) private td;
|
|
18
|
+
mapping(bytes32 => bytes) private cd;
|
|
16
19
|
|
|
17
20
|
function setToken(uint256 id, bytes32 key, bytes32 val) external { tv[id][key] = val; ts[id][key] = true; }
|
|
18
21
|
function setContract(bytes32 key, bytes32 val) external { cv[key] = val; cs[key] = true; }
|
|
19
22
|
|
|
23
|
+
/// Set a payload-typed (`Bytes`/`String`) param the way the real contract does: the scalar slot
|
|
24
|
+
/// carries the keccak COMMITMENT and `valueIsHash` is true, so a renderer that reads the bytes32
|
|
25
|
+
/// gets a hash — the data reader is the only way to the content.
|
|
26
|
+
function setTokenData(uint256 id, bytes32 key, bytes memory content) external {
|
|
27
|
+
td[id][key] = content;
|
|
28
|
+
tv[id][key] = keccak256(content);
|
|
29
|
+
ts[id][key] = true;
|
|
30
|
+
}
|
|
31
|
+
function setContractData(bytes32 key, bytes memory content) external {
|
|
32
|
+
cd[key] = content;
|
|
33
|
+
cv[key] = keccak256(content);
|
|
34
|
+
cs[key] = true;
|
|
35
|
+
}
|
|
36
|
+
|
|
20
37
|
function tokenParam(uint256 id, bytes32 key) external view returns (bytes32, bool, bool) {
|
|
21
|
-
return (tv[id][key],
|
|
38
|
+
return (tv[id][key], td[id][key].length > 0, ts[id][key]);
|
|
22
39
|
}
|
|
23
40
|
function contractParam(bytes32 key) external view returns (bytes32, bool, bool) {
|
|
24
|
-
return (cv[key],
|
|
41
|
+
return (cv[key], cd[key].length > 0, cs[key]);
|
|
42
|
+
}
|
|
43
|
+
function tokenParamData(uint256 id, bytes32 key) external view returns (bytes memory) {
|
|
44
|
+
return td[id][key];
|
|
45
|
+
}
|
|
46
|
+
function contractParamData(bytes32 key) external view returns (bytes memory) {
|
|
47
|
+
return cd[key];
|
|
25
48
|
}
|
|
49
|
+
function tokenParamKeys(uint256) external pure returns (bytes32[] memory) { return new bytes32[](0); }
|
|
50
|
+
function tokenParamKeysPaged(uint256, uint256, uint256)
|
|
51
|
+
external pure returns (bytes32[] memory keys, uint256 total)
|
|
52
|
+
{ return (new bytes32[](0), 0); }
|
|
53
|
+
function contractParamKeys() external pure returns (bytes32[] memory) { return new bytes32[](0); }
|
|
54
|
+
function contractParamKeysPaged(uint256, uint256)
|
|
55
|
+
external pure returns (bytes32[] memory keys, uint256 total)
|
|
56
|
+
{ return (new bytes32[](0), 0); }
|
|
26
57
|
}
|
|
27
58
|
|
|
28
59
|
contract MyRendererTest is Test {
|
|
@@ -107,4 +138,30 @@ contract MyRendererTest is Test {
|
|
|
107
138
|
(, bytes memory data) = img.render(address(params), tokenId, IMAGE);
|
|
108
139
|
assertTrue(data.length > 0);
|
|
109
140
|
}
|
|
141
|
+
|
|
142
|
+
/// READING A PAYLOAD PARAM (`Bytes`/`String`) — the pattern for carrying an actual work
|
|
143
|
+
/// payload on-chain. The scalar reader hands you a keccak COMMITMENT with `valueIsHash == true`;
|
|
144
|
+
/// the content only comes from `tokenParamData`. If your renderer reads a `Bytes` param through
|
|
145
|
+
/// `tokenParam` it will draw from a hash and produce garbage, silently — hence this test.
|
|
146
|
+
function test_bytesParam_readViaDataReader() public {
|
|
147
|
+
bytes memory grid = hex"00112233445566778899aabbccddeeff";
|
|
148
|
+
params.setTokenData(0, "grid", grid);
|
|
149
|
+
|
|
150
|
+
// The scalar surface: a commitment, explicitly flagged as one — NOT the content.
|
|
151
|
+
(bytes32 value, bool valueIsHash, bool isSet) = IAbxParams(address(params)).tokenParam(0, "grid");
|
|
152
|
+
assertTrue(isSet);
|
|
153
|
+
assertTrue(valueIsHash, "a Bytes param reports valueIsHash: read the data instead");
|
|
154
|
+
assertEq(value, keccak256(grid));
|
|
155
|
+
|
|
156
|
+
// The data surface: the real bytes, verifiable against that commitment.
|
|
157
|
+
bytes memory got = IAbxParams(address(params)).tokenParamData(0, "grid");
|
|
158
|
+
assertEq(got, grid);
|
|
159
|
+
assertEq(keccak256(got), value, "content must match the on-chain commitment");
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/// An unset payload param returns empty bytes — your "use a default" signal, never a revert.
|
|
163
|
+
function test_bytesParam_unsetIsEmpty() public view {
|
|
164
|
+
assertEq(IAbxParams(address(params)).tokenParamData(0, "grid").length, 0);
|
|
165
|
+
assertEq(IAbxParams(address(params)).contractParamData("grid").length, 0);
|
|
166
|
+
}
|
|
110
167
|
}
|
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* abx — the published binary's entry point, and nothing else.
|
|
4
|
+
*
|
|
5
|
+
* This file exists for one reason: **ESM links the entire static import graph before any module
|
|
6
|
+
* body runs.** `main.ts` reaches `@artblocks/abx-indexer` → `node:sqlite` through `output.ts` and
|
|
7
|
+
* `config.ts`, so on a Node that cannot load `node:sqlite` the process dies during *linking* —
|
|
8
|
+
* before a single line of our code executes. A guard at the top of `main.ts` could never fire. The
|
|
9
|
+
* only place a check can run first is a module that imports nothing statically and reaches the rest
|
|
10
|
+
* of the CLI through a dynamic `import()`.
|
|
11
|
+
*
|
|
12
|
+
* What that bought before this file existed: `npm i -g @artblocks/abx-cli && abx doctor` on Node
|
|
13
|
+
* 22.5 printed a raw `ERR_UNKNOWN_BUILTIN_MODULE: No such built-in module: node:sqlite` stack trace.
|
|
14
|
+
* No mention of abx, Node versions, or what to do — on the first command we tell every user to run.
|
|
15
|
+
*
|
|
16
|
+
* We probe the *capability*, not the version number. `node:sqlite` shipped in v22.5.0 behind
|
|
17
|
+
* `--experimental-sqlite` and lost the flag in v22.13.0 / v23.4.0, so an old Node run with
|
|
18
|
+
* `NODE_OPTIONS=--experimental-sqlite` genuinely works — refusing it on a version comparison would
|
|
19
|
+
* be a false negative on a setup the reporter proved out. `engines` states what we *support*; this
|
|
20
|
+
* guard blocks only what is actually broken.
|
|
21
|
+
*
|
|
22
|
+
* KEEP THIS FILE IMPORT-FREE. A single static `import` of anything in the CLI reintroduces the
|
|
23
|
+
* crash it exists to prevent.
|
|
24
|
+
*/
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=bin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;GAsBG"}
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* abx — the published binary's entry point, and nothing else.
|
|
4
|
+
*
|
|
5
|
+
* This file exists for one reason: **ESM links the entire static import graph before any module
|
|
6
|
+
* body runs.** `main.ts` reaches `@artblocks/abx-indexer` → `node:sqlite` through `output.ts` and
|
|
7
|
+
* `config.ts`, so on a Node that cannot load `node:sqlite` the process dies during *linking* —
|
|
8
|
+
* before a single line of our code executes. A guard at the top of `main.ts` could never fire. The
|
|
9
|
+
* only place a check can run first is a module that imports nothing statically and reaches the rest
|
|
10
|
+
* of the CLI through a dynamic `import()`.
|
|
11
|
+
*
|
|
12
|
+
* What that bought before this file existed: `npm i -g @artblocks/abx-cli && abx doctor` on Node
|
|
13
|
+
* 22.5 printed a raw `ERR_UNKNOWN_BUILTIN_MODULE: No such built-in module: node:sqlite` stack trace.
|
|
14
|
+
* No mention of abx, Node versions, or what to do — on the first command we tell every user to run.
|
|
15
|
+
*
|
|
16
|
+
* We probe the *capability*, not the version number. `node:sqlite` shipped in v22.5.0 behind
|
|
17
|
+
* `--experimental-sqlite` and lost the flag in v22.13.0 / v23.4.0, so an old Node run with
|
|
18
|
+
* `NODE_OPTIONS=--experimental-sqlite` genuinely works — refusing it on a version comparison would
|
|
19
|
+
* be a false negative on a setup the reporter proved out. `engines` states what we *support*; this
|
|
20
|
+
* guard blocks only what is actually broken.
|
|
21
|
+
*
|
|
22
|
+
* KEEP THIS FILE IMPORT-FREE. A single static `import` of anything in the CLI reintroduces the
|
|
23
|
+
* crash it exists to prevent.
|
|
24
|
+
*/
|
|
25
|
+
/** Unflagged `node:sqlite`: v22.13.0 on the 22.x line, v23.4.0 on 23.x (nodejs/node#55890). */
|
|
26
|
+
const NODE_FLOOR = '22.13.0';
|
|
27
|
+
const color = !process.env.NO_COLOR && process.stderr.isTTY;
|
|
28
|
+
const red = (s) => (color ? `\x1b[31m${s}\x1b[0m` : s);
|
|
29
|
+
const dim = (s) => (color ? `\x1b[2m${s}\x1b[0m` : s);
|
|
30
|
+
const green = (s) => (color ? `\x1b[32m${s}\x1b[0m` : s);
|
|
31
|
+
/**
|
|
32
|
+
* True when this Node has `node:sqlite` but only behind `--experimental-sqlite` — i.e. the
|
|
33
|
+
* v22.5.0–v22.12.x window (and v23.0–v23.3, which is EOL and not worth naming). Only then is the
|
|
34
|
+
* NODE_OPTIONS escape hatch real; below v22.5.0 the module does not exist at any flag.
|
|
35
|
+
*/
|
|
36
|
+
function flagWouldWork(version) {
|
|
37
|
+
const [major, minor] = version.split('.').map(Number);
|
|
38
|
+
if (major === 22)
|
|
39
|
+
return minor >= 5 && minor < 13;
|
|
40
|
+
return major === 23;
|
|
41
|
+
}
|
|
42
|
+
function nodeSqliteMessage(version) {
|
|
43
|
+
const escape = flagWouldWork(version)
|
|
44
|
+
? `\n Need to stay on this Node? It has SQLite, just flag-gated — but abx is untested there:\n ${green(`NODE_OPTIONS=--experimental-sqlite abx ${process.argv[2] ?? 'doctor'}`)}\n`
|
|
45
|
+
: '';
|
|
46
|
+
return (`\n${red('✗')} abx needs Node's built-in SQLite (${dim('node:sqlite')}), and this Node can't load it.\n\n` +
|
|
47
|
+
` you have ${red(`v${version}`)}\n` +
|
|
48
|
+
` abx needs ${green(`v${NODE_FLOOR}`)} or newer\n\n` +
|
|
49
|
+
` Upgrade Node, then re-run:\n` +
|
|
50
|
+
` ${green('nvm install 22 && nvm use 22')} ${dim('# or: brew upgrade node')}\n` +
|
|
51
|
+
` ${green('abx doctor')}\n` +
|
|
52
|
+
escape);
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
await import('node:sqlite');
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
process.stderr.write(nodeSqliteMessage(process.versions.node));
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
await import('./main.js');
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,+FAA+F;AAC/F,MAAM,UAAU,GAAG,SAAS,CAAC;AAE7B,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;AAC5D,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/D,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9D,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEjE;;;;GAIG;AACH,SAAS,aAAa,CAAC,OAAe;IACpC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtD,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;IAClD,OAAO,KAAK,KAAK,EAAE,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAe;IACxC,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC;QACnC,CAAC,CAAC,mGAAmG,KAAK,CAAC,0CAA0C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,CAAC,IAAI;QACvL,CAAC,CAAC,EAAE,CAAC;IACP,OAAO,CACL,KAAK,GAAG,CAAC,GAAG,CAAC,sCAAsC,GAAG,CAAC,aAAa,CAAC,qCAAqC;QAC1G,kBAAkB,GAAG,CAAC,IAAI,OAAO,EAAE,CAAC,IAAI;QACxC,kBAAkB,KAAK,CAAC,IAAI,UAAU,EAAE,CAAC,eAAe;QACxD,gCAAgC;QAChC,OAAO,KAAK,CAAC,8BAA8B,CAAC,MAAM,GAAG,CAAC,yBAAyB,CAAC,IAAI;QACpF,OAAO,KAAK,CAAC,YAAY,CAAC,IAAI;QAC9B,MAAM,CACP,CAAC;AACJ,CAAC;AAED,IAAI,CAAC;IACH,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;AAC9B,CAAC;AAAC,MAAM,CAAC;IACP,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { Flags } from './flags.js';
|
|
2
|
+
/**
|
|
3
|
+
* The machine-readable ABX capability contract.
|
|
4
|
+
*
|
|
5
|
+
* Keep this deliberately smaller than command help: it records product boundaries and the
|
|
6
|
+
* supported combinations agents routinely get wrong. Command-specific syntax still belongs to
|
|
7
|
+
* `abx help <command>`, while deploy planning belongs to `<deploy-command> --dry-run --json`.
|
|
8
|
+
* Human help, the shipped skill, and tests consume this object instead of maintaining competing
|
|
9
|
+
* matrices in prose.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ABX_CAPABILITIES: {
|
|
12
|
+
readonly schemaVersion: 1;
|
|
13
|
+
readonly supportedChains: readonly string[];
|
|
14
|
+
readonly deploymentCommands: {
|
|
15
|
+
readonly deploy: {
|
|
16
|
+
readonly artifact: "one static work";
|
|
17
|
+
readonly unique: {
|
|
18
|
+
readonly contract: "OneOfOneImage (ERC-721)";
|
|
19
|
+
readonly inputs: readonly ["--image"];
|
|
20
|
+
};
|
|
21
|
+
readonly edition: {
|
|
22
|
+
readonly contract: "OneOfOneEdition (ERC-1155)";
|
|
23
|
+
readonly selector: "--copies <n|open>";
|
|
24
|
+
readonly summary: "one work × copies; supports on-chain bytes, on-chain JSON with external media, or a resolver";
|
|
25
|
+
readonly supported: readonly ["--onchain-image (hot or wallet signing)", "--onchain-uri", "--backend", "--public-base-url"];
|
|
26
|
+
readonly unsupported: readonly ["--onchain-image with --unsigned"];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
readonly deploySeries: {
|
|
30
|
+
readonly artifact: "a folder of distinct static works";
|
|
31
|
+
readonly unique: {
|
|
32
|
+
readonly contract: "SeriesImage (ERC-721)";
|
|
33
|
+
readonly inputs: readonly ["--dir"];
|
|
34
|
+
};
|
|
35
|
+
readonly edition: {
|
|
36
|
+
readonly contract: "EditionImage (ERC-1155)";
|
|
37
|
+
readonly selector: "--copies <n|open>";
|
|
38
|
+
readonly summary: "N folder items × copies per id; supports on-chain bytes, on-chain JSON with external media, or a resolver";
|
|
39
|
+
readonly supported: readonly ["--onchain-image (hot or wallet signing)", "--onchain-uri", "--backend", "--public-base-url"];
|
|
40
|
+
readonly unsupported: readonly ["--onchain-image with --unsigned"];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
readonly deployCode: {
|
|
44
|
+
readonly artifact: "a program or field renderer whose output depends on token state";
|
|
45
|
+
readonly unique: {
|
|
46
|
+
readonly contract: "SeriesCode (ERC-721)";
|
|
47
|
+
readonly inputs: readonly ["--script", "--code-dir", "--image-renderer", "--attributes-renderer"];
|
|
48
|
+
};
|
|
49
|
+
readonly edition: {
|
|
50
|
+
readonly contract: "EditionCode (ERC-1155)";
|
|
51
|
+
readonly selector: "--copies <n|open>";
|
|
52
|
+
readonly summary: "N generated ids × copies per id; supports scripts, dependencies, and Solidity image/trait renderers";
|
|
53
|
+
readonly supported: readonly ["--script", "--dep", "--dep-registry", "--image-renderer", "--attributes-renderer", "--onchain-uri", "--public-base-url"];
|
|
54
|
+
readonly unsupported: readonly ["--code-dir", "--image-base", "--resume", "--no-delegation"];
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
readonly extensionRoutes: readonly [{
|
|
59
|
+
readonly route: "custom minter";
|
|
60
|
+
readonly command: "abx set-minter";
|
|
61
|
+
readonly availableOn: "Series and editions";
|
|
62
|
+
readonly useFor: readonly ["auctions", "allowlists", "raffles", "free claims", "ERC-20 pricing"];
|
|
63
|
+
}, {
|
|
64
|
+
readonly route: "configure hook";
|
|
65
|
+
readonly command: "abx set-param-hooks --configure";
|
|
66
|
+
readonly availableOn: "SeriesCode and EditionCode";
|
|
67
|
+
readonly useFor: readonly ["validated writes", "monotonic values", "structured collector input"];
|
|
68
|
+
}, {
|
|
69
|
+
readonly route: "transfer hook";
|
|
70
|
+
readonly command: "abx set-param-hooks --transfer";
|
|
71
|
+
readonly availableOn: "SeriesCode and EditionCode";
|
|
72
|
+
readonly useFor: readonly ["transfer restrictions", "soulbinding", "vesting", "redemption", "escrow"];
|
|
73
|
+
}, {
|
|
74
|
+
readonly route: "augment hook";
|
|
75
|
+
readonly command: "abx set-param-hooks --augment";
|
|
76
|
+
readonly availableOn: "SeriesCode and EditionCode";
|
|
77
|
+
readonly useFor: readonly ["live derived data", "oracle-fed state", "read-time metadata"];
|
|
78
|
+
}, {
|
|
79
|
+
readonly route: "field renderer";
|
|
80
|
+
readonly command: "abx deploy-code --image-renderer/--attributes-renderer";
|
|
81
|
+
readonly availableOn: "SeriesCode and EditionCode";
|
|
82
|
+
readonly useFor: readonly ["on-chain SVG images", "on-chain computed traits"];
|
|
83
|
+
}];
|
|
84
|
+
readonly deployTimeChoices: readonly ["contract shape and token standard (--copies)", "code-capable versus static contract type", "burnability (--burnable)", "ERC-721C/ERC-1155C enrollment (--721c)"];
|
|
85
|
+
readonly unsupportedToday: readonly ["mainnet deployment through the toolkit", "unsupported chains", "secondary-market listings or an order book", "compiling or deploying custom Solidity through abx", "replacing a deployed code project script through the CLI", "retrofitting a deploy-time choice on an existing collection"];
|
|
86
|
+
readonly interpretation: {
|
|
87
|
+
readonly native: "A documented command/flag combination performs the request directly.";
|
|
88
|
+
readonly extension: "A canonical extension seam performs it while the token remains a factory clone.";
|
|
89
|
+
readonly unsupported: "The request is listed under unsupportedToday or is blocked by an irreversible choice already made.";
|
|
90
|
+
readonly unknown: "Do not infer support from absence. Inspect command help, contract type, and this contract; report uncertainty if no route is proven.";
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export declare function cmdCapabilities(flags: Flags): void;
|
|
94
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AAEtC;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmGnB,CAAC;AAEX,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAyBlD"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { KNOWN_CHAIN_KEYS } from '@artblocks/abx-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* The machine-readable ABX capability contract.
|
|
4
|
+
*
|
|
5
|
+
* Keep this deliberately smaller than command help: it records product boundaries and the
|
|
6
|
+
* supported combinations agents routinely get wrong. Command-specific syntax still belongs to
|
|
7
|
+
* `abx help <command>`, while deploy planning belongs to `<deploy-command> --dry-run --json`.
|
|
8
|
+
* Human help, the shipped skill, and tests consume this object instead of maintaining competing
|
|
9
|
+
* matrices in prose.
|
|
10
|
+
*/
|
|
11
|
+
export const ABX_CAPABILITIES = {
|
|
12
|
+
schemaVersion: 1,
|
|
13
|
+
supportedChains: [...KNOWN_CHAIN_KEYS],
|
|
14
|
+
deploymentCommands: {
|
|
15
|
+
deploy: {
|
|
16
|
+
artifact: 'one static work',
|
|
17
|
+
unique: {
|
|
18
|
+
contract: 'OneOfOneImage (ERC-721)',
|
|
19
|
+
inputs: ['--image'],
|
|
20
|
+
},
|
|
21
|
+
edition: {
|
|
22
|
+
contract: 'OneOfOneEdition (ERC-1155)',
|
|
23
|
+
selector: '--copies <n|open>',
|
|
24
|
+
summary: 'one work × copies; supports on-chain bytes, on-chain JSON with external media, or a resolver',
|
|
25
|
+
supported: ['--onchain-image (hot or wallet signing)', '--onchain-uri', '--backend', '--public-base-url'],
|
|
26
|
+
unsupported: ['--onchain-image with --unsigned'],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
deploySeries: {
|
|
30
|
+
artifact: 'a folder of distinct static works',
|
|
31
|
+
unique: {
|
|
32
|
+
contract: 'SeriesImage (ERC-721)',
|
|
33
|
+
inputs: ['--dir'],
|
|
34
|
+
},
|
|
35
|
+
edition: {
|
|
36
|
+
contract: 'EditionImage (ERC-1155)',
|
|
37
|
+
selector: '--copies <n|open>',
|
|
38
|
+
summary: 'N folder items × copies per id; supports on-chain bytes, on-chain JSON with external media, or a resolver',
|
|
39
|
+
supported: ['--onchain-image (hot or wallet signing)', '--onchain-uri', '--backend', '--public-base-url'],
|
|
40
|
+
unsupported: ['--onchain-image with --unsigned'],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
deployCode: {
|
|
44
|
+
artifact: 'a program or field renderer whose output depends on token state',
|
|
45
|
+
unique: {
|
|
46
|
+
contract: 'SeriesCode (ERC-721)',
|
|
47
|
+
inputs: ['--script', '--code-dir', '--image-renderer', '--attributes-renderer'],
|
|
48
|
+
},
|
|
49
|
+
edition: {
|
|
50
|
+
contract: 'EditionCode (ERC-1155)',
|
|
51
|
+
selector: '--copies <n|open>',
|
|
52
|
+
summary: 'N generated ids × copies per id; supports scripts, dependencies, and Solidity image/trait renderers',
|
|
53
|
+
supported: ['--script', '--dep', '--dep-registry', '--image-renderer', '--attributes-renderer', '--onchain-uri', '--public-base-url'],
|
|
54
|
+
unsupported: ['--code-dir', '--image-base', '--resume', '--no-delegation'],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
extensionRoutes: [
|
|
59
|
+
{
|
|
60
|
+
route: 'custom minter',
|
|
61
|
+
command: 'abx set-minter',
|
|
62
|
+
availableOn: 'Series and editions',
|
|
63
|
+
useFor: ['auctions', 'allowlists', 'raffles', 'free claims', 'ERC-20 pricing'],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
route: 'configure hook',
|
|
67
|
+
command: 'abx set-param-hooks --configure',
|
|
68
|
+
availableOn: 'SeriesCode and EditionCode',
|
|
69
|
+
useFor: ['validated writes', 'monotonic values', 'structured collector input'],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
route: 'transfer hook',
|
|
73
|
+
command: 'abx set-param-hooks --transfer',
|
|
74
|
+
availableOn: 'SeriesCode and EditionCode',
|
|
75
|
+
useFor: ['transfer restrictions', 'soulbinding', 'vesting', 'redemption', 'escrow'],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
route: 'augment hook',
|
|
79
|
+
command: 'abx set-param-hooks --augment',
|
|
80
|
+
availableOn: 'SeriesCode and EditionCode',
|
|
81
|
+
useFor: ['live derived data', 'oracle-fed state', 'read-time metadata'],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
route: 'field renderer',
|
|
85
|
+
command: 'abx deploy-code --image-renderer/--attributes-renderer',
|
|
86
|
+
availableOn: 'SeriesCode and EditionCode',
|
|
87
|
+
useFor: ['on-chain SVG images', 'on-chain computed traits'],
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
deployTimeChoices: [
|
|
91
|
+
'contract shape and token standard (--copies)',
|
|
92
|
+
'code-capable versus static contract type',
|
|
93
|
+
'burnability (--burnable)',
|
|
94
|
+
'ERC-721C/ERC-1155C enrollment (--721c)',
|
|
95
|
+
],
|
|
96
|
+
unsupportedToday: [
|
|
97
|
+
'mainnet deployment through the toolkit',
|
|
98
|
+
'unsupported chains',
|
|
99
|
+
'secondary-market listings or an order book',
|
|
100
|
+
'compiling or deploying custom Solidity through abx',
|
|
101
|
+
'replacing a deployed code project script through the CLI',
|
|
102
|
+
'retrofitting a deploy-time choice on an existing collection',
|
|
103
|
+
],
|
|
104
|
+
interpretation: {
|
|
105
|
+
native: 'A documented command/flag combination performs the request directly.',
|
|
106
|
+
extension: 'A canonical extension seam performs it while the token remains a factory clone.',
|
|
107
|
+
unsupported: 'The request is listed under unsupportedToday or is blocked by an irreversible choice already made.',
|
|
108
|
+
unknown: 'Do not infer support from absence. Inspect command help, contract type, and this contract; report uncertainty if no route is proven.',
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
export function cmdCapabilities(flags) {
|
|
112
|
+
if (flags.json !== undefined) {
|
|
113
|
+
console.log(JSON.stringify(ABX_CAPABILITIES, null, 2));
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
console.log('ABX capability contract v1\n');
|
|
117
|
+
console.log('Native deployment lanes:');
|
|
118
|
+
for (const [name, lane] of Object.entries(ABX_CAPABILITIES.deploymentCommands)) {
|
|
119
|
+
console.log(` ${name}: ${lane.artifact}`);
|
|
120
|
+
console.log(` unique ${lane.unique.contract} — ${lane.unique.inputs.join(' | ')}`);
|
|
121
|
+
console.log(` edition ${lane.edition.contract} — ${lane.edition.summary}`);
|
|
122
|
+
if (lane.edition.unsupported.length)
|
|
123
|
+
console.log(` limits ${lane.edition.unsupported.join(' · ')}`);
|
|
124
|
+
}
|
|
125
|
+
console.log('\nCanonical extension routes:');
|
|
126
|
+
for (const seam of ABX_CAPABILITIES.extensionRoutes) {
|
|
127
|
+
console.log(` ${seam.route}: ${seam.availableOn} — ${seam.useFor.join(', ')}`);
|
|
128
|
+
}
|
|
129
|
+
console.log('\nUnsupported today:');
|
|
130
|
+
for (const item of ABX_CAPABILITIES.unsupportedToday)
|
|
131
|
+
console.log(` - ${item}`);
|
|
132
|
+
console.log('\nUse `abx capabilities --json` for the stable machine-readable form,');
|
|
133
|
+
console.log('`abx help <command>` for current flags, and `<deploy-command> --dry-run --json` for a concrete plan.');
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAGpD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,aAAa,EAAE,CAAC;IAChB,eAAe,EAAE,CAAC,GAAG,gBAAgB,CAAC;IACtC,kBAAkB,EAAE;QAClB,MAAM,EAAE;YACN,QAAQ,EAAE,iBAAiB;YAC3B,MAAM,EAAE;gBACN,QAAQ,EAAE,yBAAyB;gBACnC,MAAM,EAAE,CAAC,SAAS,CAAC;aACpB;YACD,OAAO,EAAE;gBACP,QAAQ,EAAE,4BAA4B;gBACtC,QAAQ,EAAE,mBAAmB;gBAC7B,OAAO,EAAE,8FAA8F;gBACvG,SAAS,EA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