@easy1staking/cip113-sdk-ts 0.7.0 → 0.9.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 (35) hide show
  1. package/README.md +72 -2
  2. package/blueprints/standard/v0.5.0-alpha.3/UPSTREAM_PIN.json +35 -0
  3. package/blueprints/standard/v0.5.0-alpha.3/plutus.json +1126 -0
  4. package/blueprints/standard/v0.5.0-alpha.4/UPSTREAM_PIN.json +36 -0
  5. package/blueprints/standard/v0.5.0-alpha.4/plutus.json +1434 -0
  6. package/dist/core/evo-utils.d.ts +357 -39
  7. package/dist/core/evo-utils.d.ts.map +1 -1
  8. package/dist/core/evo-utils.js +513 -27
  9. package/dist/core/evo-utils.js.map +1 -1
  10. package/dist/core/ledger-order.d.ts +204 -18
  11. package/dist/core/ledger-order.d.ts.map +1 -1
  12. package/dist/core/ledger-order.js +385 -28
  13. package/dist/core/ledger-order.js.map +1 -1
  14. package/dist/index.d.ts +5 -5
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +8 -3
  17. package/dist/index.js.map +1 -1
  18. package/dist/standard/blueprint.d.ts +128 -29
  19. package/dist/standard/blueprint.d.ts.map +1 -1
  20. package/dist/standard/blueprint.js +244 -47
  21. package/dist/standard/blueprint.js.map +1 -1
  22. package/dist/standard/scripts.d.ts +143 -75
  23. package/dist/standard/scripts.d.ts.map +1 -1
  24. package/dist/standard/scripts.js +211 -116
  25. package/dist/standard/scripts.js.map +1 -1
  26. package/dist/substandards/dummy/index.d.ts +19 -0
  27. package/dist/substandards/dummy/index.d.ts.map +1 -1
  28. package/dist/substandards/dummy/index.js +322 -73
  29. package/dist/substandards/dummy/index.js.map +1 -1
  30. package/dist/substandards/freeze-and-seize/index.d.ts.map +1 -1
  31. package/dist/substandards/freeze-and-seize/index.js +455 -117
  32. package/dist/substandards/freeze-and-seize/index.js.map +1 -1
  33. package/dist/types.d.ts +131 -48
  34. package/dist/types.d.ts.map +1 -1
  35. package/package.json +2 -1
@@ -1,34 +1,47 @@
1
1
  /**
2
- * Standard script parameterization — CIP-113 0.5.0-alpha.2 (upstream 9db7e06).
2
+ * Standard script parameterization — CIP-113 0.5.0-alpha.4 (upstream 7e8a631).
3
3
  *
4
4
  * Uses Evolution SDK directly for UPLC.applyParamsToScript and ScriptHash.
5
5
  *
6
- * Dependency graph. Note it is NO LONGER a single chain: upstream #110 removed
7
- * programmable_logic_global, and PLB is now parameterised by the params-NFT
8
- * policy rather than by PLG's credential, so everything downstream hangs off
9
- * `params_policy` in parallel instead of in series.
6
+ * Dependency graph. It is NOT a single chain: `programmable_logic_base` hangs
7
+ * off the params-NFT policy, so everything downstream of it fans out in
8
+ * parallel rather than in series.
10
9
  *
11
- * always_fail(nonce) -> hash (issuance side only now)
12
- * coordination_spend(nonce) -> hash NEW: the lock target
13
- * protocol_params_mint(utxo_ref, coord_hash) -> policy == params_policy
10
+ * always_fail(nonce) -> hash (issuance side only)
11
+ * protocol_params(utxo_ref) -> policy == params_policy
14
12
  * |
15
- * +-- programmable_logic_base(params_policy) -> hash
16
- * +-- transfer(params_policy) -> hash (PLG's transfer arm, renamed)
17
- * +-- third_party(params_policy) -> hash NEW: seize / clawback
18
- * +-- unfracking(params_policy) -> hash
19
- * +-- registry_spend(params_policy) -> hash
13
+ * +-- programmable_logic_base(params_policy) -> hash == plb
14
+ * | |
15
+ * | +-- transfer(Script(plb), registry_node_cs, max_inline) -> hash
16
+ * | +-- third_party(Script(plb), registry_node_cs, max_inline) -> hash
17
+ * | +-- unfracking(Script(plb), registry_node_cs, max_inline) -> hash
18
+ * | +-- issuance_logic(Script(plb), registry_node_cs,
19
+ * | params_policy, max_inline) -> hash NEW in alpha.4
20
+ * |
21
+ * +-- issuance_mint(Script(minting_logic), params_policy) -> policy
22
+ *
23
+ * programmable_logic_global(transfer_hash, third_party_hash, unfracking_hash)
24
+ * -> hash (built LAST)
25
+ *
26
+ * issuance_cbor_hex_mint(utxo_ref, always_fail_hash) -> policy
27
+ * registry(utxo_ref, issuance_cbor_hex_cs) -> policy
20
28
  *
21
- * issuance_cbor_hex_mint(utxo_ref, always_fail_hash) -> policy
22
- * registry_mint(utxo_ref, issuance_cbor_hex_cs, registry_spend_cred) -> policy
23
- * issuance_mint(PLB_cred, registry_node_cs, minting_logic_cred, params_policy)
24
- * upgrade_multisig(signers, threshold) -> hash (independent)
29
+ * upgrade_multisig(utxo_ref) -> hash (independent one-shot)
25
30
  *
26
31
  * ⚠ PARAMETER TYPES ARE NOT INTERCHANGEABLE and TypeScript cannot tell them
27
32
  * apart — every one of these is a hex string at the call site. `params_policy`
28
- * is a PolicyId (a bare ByteArray); `minting_logic_cred` and friends are
29
- * Credentials (a constructor-wrapped Script/VerificationKey). Passing a policy
30
- * where a credential belongs produces a valid script with the wrong hash. The
31
- * types below come from the blueprint's own parameter schemas, not from
33
+ * and `registry_node_cs` are PolicyIds (bare ByteArrays); `minting_logic_cred`
34
+ * and `programmable_logic_base` are Credentials (constructor-wrapped
35
+ * Script/VerificationKey). `scriptCredential()` wraps; `Data.bytearray()` does
36
+ * not. Passing a policy where a credential belongs produces a valid script with
37
+ * the wrong hash.
38
+ *
39
+ * ⛔ alpha.4 makes that sharper: `issuance_logic` takes TWO ADJACENT PolicyId
40
+ * parameters — `registry_node_cs` then `params_policy`. They are the same type,
41
+ * the same length, and both are `string` here. Swapping them yields a script
42
+ * that builds, hashes and deploys, and nothing before the ledger will say so.
43
+ *
44
+ * The types below come from the blueprint's own parameter schemas, not from
32
45
  * upstream's prose docs — see the hazard note in blueprint.ts.
33
46
  */
34
47
  import { Data } from "@evolution-sdk/evolution";
@@ -55,14 +68,8 @@ export function createStandardScripts(blueprint, onParameterize) {
55
68
  alwaysFail(nonce) {
56
69
  return parameterize(STANDARD_VALIDATORS.ALWAYS_FAIL, [Data.bytearray(nonce)]);
57
70
  },
58
- coordinationSpend(nonce) {
59
- return parameterize(STANDARD_VALIDATORS.COORDINATION_SPEND, [Data.bytearray(nonce)]);
60
- },
61
- protocolParamsMint(utxoRef, coordinationHash) {
62
- return parameterize(STANDARD_VALIDATORS.PROTOCOL_PARAMS_MINT, [
63
- outputReference(utxoRef),
64
- Data.bytearray(coordinationHash),
65
- ]);
71
+ protocolParams(utxoRef) {
72
+ return parameterize(STANDARD_VALIDATORS.PROTOCOL_PARAMS, [outputReference(utxoRef)]);
66
73
  },
67
74
  programmableLogicBase(paramsPolicy) {
68
75
  // PolicyId — a bare ByteArray. It was scriptCredential(plgHash) before #110.
@@ -70,47 +77,70 @@ export function createStandardScripts(blueprint, onParameterize) {
70
77
  Data.bytearray(paramsPolicy),
71
78
  ]);
72
79
  },
73
- transfer(paramsPolicy) {
74
- return parameterize(STANDARD_VALIDATORS.TRANSFER, [Data.bytearray(paramsPolicy)]);
75
- },
76
- thirdParty(paramsPolicy) {
77
- return parameterize(STANDARD_VALIDATORS.THIRD_PARTY, [Data.bytearray(paramsPolicy)]);
80
+ transfer(progLogicCred, registryPolicy, maxInlineDatumBytes) {
81
+ return parameterize(STANDARD_VALIDATORS.TRANSFER, [
82
+ scriptCredential(progLogicCred),
83
+ Data.bytearray(registryPolicy),
84
+ Data.int(BigInt(maxInlineDatumBytes)),
85
+ ]);
78
86
  },
79
- unfracking(paramsPolicy) {
80
- return parameterize(STANDARD_VALIDATORS.UNFRACKING, [Data.bytearray(paramsPolicy)]);
87
+ thirdParty(progLogicCred, registryPolicy, maxInlineDatumBytes) {
88
+ return parameterize(STANDARD_VALIDATORS.THIRD_PARTY, [
89
+ scriptCredential(progLogicCred),
90
+ Data.bytearray(registryPolicy),
91
+ Data.int(BigInt(maxInlineDatumBytes)),
92
+ ]);
81
93
  },
82
- upgradeMultisig(signers, threshold) {
83
- return parameterize(STANDARD_VALIDATORS.UPGRADE_MULTISIG, [
84
- Data.list(signers.map((s) => Data.bytearray(s))),
85
- Data.int(BigInt(threshold)),
94
+ unfracking(progLogicCred, registryPolicy, maxInlineDatumBytes) {
95
+ return parameterize(STANDARD_VALIDATORS.UNFRACKING, [
96
+ scriptCredential(progLogicCred),
97
+ Data.bytearray(registryPolicy),
98
+ Data.int(BigInt(maxInlineDatumBytes)),
86
99
  ]);
87
100
  },
101
+ upgradeMultisig(utxoRef) {
102
+ return parameterize(STANDARD_VALIDATORS.UPGRADE_MULTISIG, [outputReference(utxoRef)]);
103
+ },
88
104
  issuanceCborHexMint(utxoRef, alwaysFailHash) {
89
105
  return parameterize(STANDARD_VALIDATORS.ISSUANCE_CBOR_HEX_MINT, [
90
106
  outputReference(utxoRef),
91
107
  Data.bytearray(alwaysFailHash),
92
108
  ]);
93
109
  },
94
- registryMint(utxoRef, issuanceCborHexPolicy, registrySpendHash) {
95
- return parameterize(STANDARD_VALIDATORS.REGISTRY_MINT, [
110
+ registry(utxoRef, issuanceCborHexPolicy) {
111
+ return parameterize(STANDARD_VALIDATORS.REGISTRY, [
96
112
  outputReference(utxoRef),
97
113
  Data.bytearray(issuanceCborHexPolicy),
98
- scriptCredential(registrySpendHash),
99
114
  ]);
100
115
  },
101
- registrySpend(paramsPolicy) {
102
- return parameterize(STANDARD_VALIDATORS.REGISTRY_SPEND, [
103
- Data.bytearray(paramsPolicy),
116
+ programmableLogicGlobal(transferHash, thirdPartyHash, unfrackingHash) {
117
+ // Bare ScriptHashes — NOT scriptCredential(). The blueprint declares
118
+ // `aiken/crypto/ScriptHash` here, while issuance_mint declares
119
+ // `cardano/address/Credential` for the same 28 bytes. Wrapping these
120
+ // would produce a different script that still hashes and still deploys.
121
+ return parameterize(STANDARD_VALIDATORS.PROGRAMMABLE_LOGIC_GLOBAL, [
122
+ Data.bytearray(transferHash),
123
+ Data.bytearray(thirdPartyHash),
124
+ Data.bytearray(unfrackingHash),
104
125
  ]);
105
126
  },
106
- issuanceMint(plbHash, registryNodePolicy, mintingLogicHash, paramsPolicy) {
127
+ issuanceMint(mintingLogicHash, paramsPolicy) {
107
128
  return parameterize(STANDARD_VALIDATORS.ISSUANCE_MINT, [
108
- scriptCredential(plbHash),
109
- Data.bytearray(registryNodePolicy),
110
129
  scriptCredential(mintingLogicHash),
111
130
  Data.bytearray(paramsPolicy),
112
131
  ]);
113
132
  },
133
+ issuanceLogic(progLogicCred, registryPolicy, paramsPolicy, maxInlineDatumBytes) {
134
+ // Credential, then TWO bare PolicyIds in blueprint order
135
+ // (registry_node_cs, params_policy), then the Int. See the interface
136
+ // doc: the two policies are the swap hazard alpha.4 introduced.
137
+ return parameterize(STANDARD_VALIDATORS.ISSUANCE_LOGIC, [
138
+ scriptCredential(progLogicCred),
139
+ Data.bytearray(registryPolicy),
140
+ Data.bytearray(paramsPolicy),
141
+ Data.int(BigInt(maxInlineDatumBytes)),
142
+ ]);
143
+ },
114
144
  };
115
145
  }
116
146
  /** Thrown when a blueprint does not reproduce its deployment's script hashes. */
@@ -128,92 +158,151 @@ export class DeploymentMismatchError extends Error {
128
158
  this.mismatches = mismatches;
129
159
  }
130
160
  }
131
- /**
132
- * Derive every parameterizable standard script hash from the blueprint and
133
- * check it against DeploymentParams. Throws DeploymentMismatchError on any
134
- * difference; returns the full check list on success.
135
- *
136
- * Why this exists: parameterization changes are not always visible to the
137
- * compiler. Upstream has changed a parameter's *meaning* while keeping its
138
- * arity and type (protocol_params_mint's `always_fail_hash` became
139
- * `coordination_addr_hash` in 0.5.0-alpha.1), so a wrong value typechecks,
140
- * builds, and only fails when the ledger rejects the transaction. This is the
141
- * check that catches it, and it is why buildDeploymentScripts no longer
142
- * overwrites derived hashes with deployment values.
143
- *
144
- * Not covered: always_fail (its nonce is not carried in DeploymentParams),
145
- * issuance_mint (parameterized per minting logic), and upgrade_multisig (its
146
- * signers/threshold are an authority choice, not a derived protocol value).
147
- * coordination_spend IS covered — DeploymentParams carries its nonce precisely
148
- * so the lock target can be re-derived rather than trusted.
149
- *
150
- * WHERE THIS CHECK HAS VALUE — and where it has none.
151
- *
152
- * It is only meaningful when the blueprint and the deployment come from
153
- * INDEPENDENT sources, so that they can actually disagree: a deployment loaded
154
- * from disk, a database, or the chain, checked against the blueprint currently
155
- * bundled. That is the case it catches, and the failure it catches is real —
156
- * this repo shipped a blueprint swapped in place under an unchanged directory
157
- * name, with 4 of 8 validator hashes moved.
158
- *
159
- * It proves NOTHING at bootstrap time. A deployment script derives the hashes,
160
- * populates DeploymentParams from those same values, and then asserts against
161
- * them — a tautology that cannot fail. Do not read a passing assertion inside a
162
- * bootstrap as evidence that the deployment is correct; assert on LOAD instead.
163
- */
164
- export function assertDeploymentScripts(blueprint, deployment) {
161
+ function deriveDeploymentScripts(blueprint, deployment) {
165
162
  const builders = createStandardScripts(blueprint);
163
+ const plb = deployment.programmableLogicBase.scriptHash;
164
+ const registryPolicy = deployment.registry.scriptHash;
165
+ const paramsPolicy = deployment.protocolParams.policyId;
166
+ const mid = deployment.maxInlineDatumBytes;
167
+ // ⚑ ONE call per script. Every `derived` field below reads a `.hash` off one
168
+ // of these objects, and `scripts` returns the very same objects — so a wrong
169
+ // argument here is caught by the check beside it rather than surviving into
170
+ // the resolved surface.
171
+ const protocolParams = builders.protocolParams(deployment.protocolParams.txInput);
172
+ const programmableLogicBase = builders.programmableLogicBase(paramsPolicy);
173
+ const transfer = builders.transfer(plb, registryPolicy, mid);
174
+ const thirdParty = builders.thirdParty(plb, registryPolicy, mid);
175
+ const unfracking = builders.unfracking(plb, registryPolicy, mid);
176
+ const programmableLogicGlobal = builders.programmableLogicGlobal(deployment.transfer.scriptHash, deployment.thirdParty.scriptHash, deployment.unfracking.scriptHash);
177
+ const issuanceCborHexMint = builders.issuanceCborHexMint(deployment.issuance.txInput, deployment.issuance.alwaysFailScriptHash);
178
+ const registry = builders.registry(deployment.registry.txInput, deployment.registry.issuanceScriptHash);
179
+ const issuanceLogic = builders.issuanceLogic(plb, registryPolicy, paramsPolicy, mid);
180
+ const upgradeMultisig = builders.upgradeMultisig(deployment.upgradeMultisig.txInput);
166
181
  const checks = [
167
182
  {
168
- name: "coordination_spend",
169
- derived: builders.coordinationSpend(deployment.coordinationNonce).hash,
170
- deployed: deployment.coordination.scriptHash,
171
- },
172
- {
173
- name: "protocol_params_mint",
174
- derived: builders.protocolParamsMint(deployment.protocolParams.txInput, deployment.protocolParams.coordinationScriptHash).hash,
183
+ // ⚑ ONE derivation for what used to be two. The params NFT policy and the
184
+ // params address's payment credential are the same value in alpha.3, so
185
+ // deriving them separately is not "belt and braces" — it is two chances
186
+ // to disagree about one fact.
187
+ name: "protocol_params (policy == address)",
188
+ derived: protocolParams.hash,
175
189
  deployed: deployment.protocolParams.policyId,
176
190
  },
177
191
  {
178
192
  name: "programmable_logic_base",
179
- derived: builders.programmableLogicBase(deployment.protocolParams.policyId).hash,
180
- deployed: deployment.programmableLogicBase.scriptHash,
193
+ derived: programmableLogicBase.hash,
194
+ deployed: plb,
181
195
  },
182
196
  {
183
197
  name: "transfer",
184
- derived: builders.transfer(deployment.protocolParams.policyId).hash,
198
+ derived: transfer.hash,
185
199
  deployed: deployment.transfer.scriptHash,
186
200
  },
187
201
  {
188
202
  name: "third_party",
189
- derived: builders.thirdParty(deployment.protocolParams.policyId).hash,
203
+ derived: thirdParty.hash,
190
204
  deployed: deployment.thirdParty.scriptHash,
191
205
  },
192
206
  {
193
207
  name: "unfracking",
194
- derived: builders.unfracking(deployment.protocolParams.policyId).hash,
208
+ derived: unfracking.hash,
195
209
  deployed: deployment.unfracking.scriptHash,
196
210
  },
211
+ {
212
+ // ⛔ THE COHERENCE CHECK THE LEDGER CANNOT DO. A script cannot read
213
+ // another script's parameters, so nothing on chain verifies that the
214
+ // dispatcher was compiled against THESE three delegates. Deriving it from
215
+ // the deployment's own delegate hashes is the only place that mismatch
216
+ // can be caught — and a dispatcher naming stale delegates fails at
217
+ // withdrawal time with an index error, never with "wrong dispatcher".
218
+ name: "programmable_logic_global (dispatcher coherence)",
219
+ derived: programmableLogicGlobal.hash,
220
+ deployed: deployment.programmableLogicGlobal.scriptHash,
221
+ },
197
222
  {
198
223
  name: "issuance_cbor_hex_mint",
199
- derived: builders.issuanceCborHexMint(deployment.issuance.txInput, deployment.issuance.alwaysFailScriptHash).hash,
224
+ derived: issuanceCborHexMint.hash,
200
225
  deployed: deployment.issuance.policyId,
201
226
  },
202
227
  {
203
- name: "registry_spend",
204
- derived: builders.registrySpend(deployment.protocolParams.policyId).hash,
205
- deployed: deployment.directorySpend.scriptHash,
228
+ // ⚑ Also one derivation for what used to be two (registry_mint's policy
229
+ // and registry_spend's address).
230
+ name: "registry (policy == address)",
231
+ derived: registry.hash,
232
+ deployed: registryPolicy,
206
233
  },
207
234
  {
208
- name: "registry_mint",
209
- derived: builders.registryMint(deployment.directoryMint.txInput, deployment.issuance.policyId, deployment.directorySpend.scriptHash).hash,
210
- deployed: deployment.directoryMint.scriptHash,
235
+ // ⛔ THE FOURTH CONSUMER OF `mid`. transfer, third_party and unfracking
236
+ // were three; alpha.4's issuance_logic is the fourth, and the count is
237
+ // the mechanism: the negative test asserting FOUR mismatches for a wrong
238
+ // `maxInlineDatumBytes` is what proves this call site exists. A comment
239
+ // cannot prove a call site; a count can.
240
+ //
241
+ // ⚠ Argument order is `(plb, registry_node_cs, params_policy, mid)` and
242
+ // the middle two are both bare PolicyIds. Swapping them builds, hashes
243
+ // and deploys — see the adjacent-parameter negative in
244
+ // test/deployment-assertion.test.mjs.
245
+ name: "issuance_logic",
246
+ derived: issuanceLogic.hash,
247
+ deployed: deployment.issuanceLogic.scriptHash,
248
+ },
249
+ {
250
+ // ⛔ CHECKED AGAIN, AND THE REASON IT CAN BE IS THE WHOLE CHANGE. This
251
+ // check was REMOVED in S-11 after it shipped a defect: it derived
252
+ // `upgrade_multisig` from `upgradeAuthority.hash`, a relationship that
253
+ // never existed (a PAYMENT key hash matched against `extra_signatories`
254
+ // versus the STAKE credential named in the params datum). alpha.3 could
255
+ // not derive it at all — its signer set and threshold were a deployment
256
+ // CHOICE that DeploymentParams did not record. alpha.4 replaces both
257
+ // parameters with a single `utxo_ref`, which IS recorded, so the hash is
258
+ // derivable and the check comes back.
259
+ //
260
+ // ⚠ AND THE VACUITY TRAP COMES BACK WITH IT, IN A NEW SHAPE. What hid the
261
+ // S-11 bug was a fixture using ONE value for two fields, so the wrong
262
+ // derivation reproduced perfectly and the check passed vacuously — only a
263
+ // live devnet exposed it. DeploymentParams now holds TWO one-shot
264
+ // `TxInput`s of identical type: `protocolParams.txInput` and
265
+ // `upgradeMultisig.txInput`. A fixture that reuses one for both makes
266
+ // this check pass no matter which one the code reads.
267
+ //
268
+ // ⛔ Do NOT add any check relating `upgradeAuthority` to
269
+ // `upgradeMultisig`. A deployment may legitimately name a key credential,
270
+ // a different script, or the multisig as its authority, and the validator
271
+ // never inspects it. Such a check would reject valid deployments — it is
272
+ // the S-11 defect returning under a new name.
273
+ name: "upgrade_multisig",
274
+ derived: upgradeMultisig.hash,
275
+ deployed: deployment.upgradeMultisig.scriptHash,
211
276
  },
212
277
  ];
278
+ return {
279
+ builders,
280
+ paramsPolicy,
281
+ scripts: {
282
+ protocolParams,
283
+ programmableLogicBase,
284
+ transfer,
285
+ thirdParty,
286
+ unfracking,
287
+ programmableLogicGlobal,
288
+ issuanceCborHexMint,
289
+ registry,
290
+ issuanceLogic,
291
+ upgradeMultisig,
292
+ },
293
+ checks,
294
+ };
295
+ }
296
+ /** Throw if any derived hash disagrees with the deployment record. */
297
+ function refuseOnMismatch(checks, blueprintTitle) {
213
298
  const mismatches = checks.filter((c) => c.derived !== c.deployed);
214
299
  if (mismatches.length > 0) {
215
- throw new DeploymentMismatchError(mismatches, blueprint.preamble.title);
300
+ throw new DeploymentMismatchError(mismatches, blueprintTitle);
216
301
  }
302
+ }
303
+ export function assertDeploymentScripts(blueprint, deployment) {
304
+ const { checks } = deriveDeploymentScripts(blueprint, deployment);
305
+ refuseOnMismatch(checks, blueprint.preamble.title);
217
306
  return checks;
218
307
  }
219
308
  /**
@@ -225,21 +314,27 @@ export function assertDeploymentScripts(blueprint, deployment) {
225
314
  * undetectable until submission.
226
315
  */
227
316
  export function buildDeploymentScripts(blueprint, deployment) {
228
- assertDeploymentScripts(blueprint, deployment);
229
- const builders = createStandardScripts(blueprint);
230
- const paramsPolicy = deployment.protocolParams.policyId;
317
+ // ⚑ ONE FACT, ONE DERIVATION — and this line is what makes that phrase true
318
+ // rather than aspirational. The scripts returned below are the SAME OBJECTS
319
+ // whose hashes were just checked, not a second build from the same arguments.
320
+ // A second build is a second chance to disagree, and it WAS unguarded here:
321
+ // see the block on `DerivedDeployment`.
322
+ const { builders, paramsPolicy, scripts, checks } = deriveDeploymentScripts(blueprint, deployment);
323
+ refuseOnMismatch(checks, blueprint.preamble.title);
231
324
  return {
232
- coordinationSpend: builders.coordinationSpend(deployment.coordinationNonce),
233
- protocolParamsMint: builders.protocolParamsMint(deployment.protocolParams.txInput, deployment.protocolParams.coordinationScriptHash),
234
- programmableLogicBase: builders.programmableLogicBase(paramsPolicy),
235
- transfer: builders.transfer(paramsPolicy),
236
- thirdParty: builders.thirdParty(paramsPolicy),
237
- unfracking: builders.unfracking(paramsPolicy),
238
- issuanceCborHexMint: builders.issuanceCborHexMint(deployment.issuance.txInput, deployment.issuance.alwaysFailScriptHash),
239
- registryMint: builders.registryMint(deployment.directoryMint.txInput, deployment.issuance.policyId, deployment.directorySpend.scriptHash),
240
- registrySpend: builders.registrySpend(paramsPolicy),
325
+ ...scripts,
241
326
  buildIssuanceMint(mintingLogicHash) {
242
- return builders.issuanceMint(deployment.programmableLogicBase.scriptHash, deployment.directoryMint.scriptHash, mintingLogicHash, paramsPolicy);
327
+ // ⚑ ITS SIGNATURE IS UNCHANGED AND ITS RESULT IS NOT. alpha.4 dropped
328
+ // `programmable_logic_base` and `registry_node_cs` from issuance_mint's
329
+ // parameters, so THE POLICY ID CHANGES FOR THE SAME MINTING LOGIC. That
330
+ // is correct, not a bug to fix: an alpha.3 token and an alpha.4 token
331
+ // built from identical issuance logic are different assets.
332
+ //
333
+ // ⚠ NOT part of the single-derivation collapse above, and cannot be: it
334
+ // is parameterised per minting logic, so there is no one hash for
335
+ // `assertDeploymentScripts` to check. It stays uncovered, as the
336
+ // assertion's own "Not covered" note says.
337
+ return builders.issuanceMint(mintingLogicHash, paramsPolicy);
243
338
  },
244
339
  };
245
340
  }
@@ -1 +1 @@
1
- {"version":3,"file":"scripts.js","sourceRoot":"","sources":["../../src/standard/scripts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAUhD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAmF9B,MAAM,UAAU,qBAAqB,CACnC,SAA0B,EAC1B,cAAuD;IAEvD,SAAS,YAAY,CAAC,cAAsB,EAAE,MAAmB;QAC/D,MAAM,IAAI,GAAG,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QACzD,0EAA0E;QAC1E,0EAA0E;QAC1E,uDAAuD;QACvD,MAAM,MAAM,GAAG,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAChD,IAAI,cAAc,EAAE,CAAC;YACnB,cAAc,CAAC;gBACb,KAAK,EAAE,cAAc;gBACrB,aAAa,EAAE,iBAAiB,CAAC,IAAI,CAAC;gBACtC,iBAAiB,EAAE,MAAM,CAAC,IAAI;gBAC9B,MAAM;aACP,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO;QACL,UAAU,CAAC,KAAK;YACd,OAAO,YAAY,CAAC,mBAAmB,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAChF,CAAC;QAED,iBAAiB,CAAC,KAAK;YACrB,OAAO,YAAY,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC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,sEAAsE;YACtE,4DAA4D;YAC5D,EAAE;YACF,wEAAwE;YACxE,kEAAkE;YAClE,iEAAiE;YACjE,2CAA2C;YAC3C,OAAO,QAAQ,CAAC,YAAY,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;QAC/D,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -7,6 +7,25 @@
7
7
  *
8
8
  * No compliance features, no blacklist.
9
9
  * Uses Evolution SDK directly — no adapter abstraction.
10
+ *
11
+ * ⛔ alpha.4 SPLIT ISSUANCE (#129), AND IT CHANGED WHAT `register` AND `mint`
12
+ * MUST CARRY. `issuance_mint` is frozen — its applied hash IS the policy id —
13
+ * so its redeemer is now `IssuanceRedeemer { params_idx }` and nothing else.
14
+ * Everything replaceable moved behind `issuance_logic_cred` in the
15
+ * protocol-params datum, which means EVERY mint and EVERY burn now carries a
16
+ * SECOND protocol withdrawal: `issuance_logic`'s withdraw-0, whose redeemer is
17
+ * the per-policy `MintingRegistryProof` map.
18
+ *
19
+ * ⚠ Omitting that withdrawal is SILENT. `issuance_mint` calls `covered_by`,
20
+ * which scans `tx.redeemers` for a `Withdraw(issuance_logic_cred)` purpose;
21
+ * with the withdrawal absent there is no such redeemer, the scan returns False,
22
+ * and the mint fails naming neither a withdrawal, nor a policy, nor an index.
23
+ * That is why `register` and `mint` route every index through `issuancePlan`
24
+ * and cross-check `plan.withdrawals.length` against their own `withdraw()`
25
+ * call count: a comment cannot prove a call site exists, a count can.
26
+ *
27
+ * `transfer` and `thirdPartyTransfer` neither mint nor burn, so neither needs
28
+ * `issuance_logic` and both still use `plbWithdrawalPlan`.
10
29
  */
11
30
  import type { PlutusBlueprint } from "../../types.js";
12
31
  import type { SubstandardPlugin } from "../interface.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/substandards/dummy/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAaH,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EACV,iBAAiB,EASlB,MAAM,iBAAiB,CAAC;AA8CzB,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,SAAS,EAAE,eAAe,CAAC;CAC5B,GAAG,iBAAiB,CA+oBpB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/substandards/dummy/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAeH,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EACV,iBAAiB,EASlB,MAAM,iBAAiB,CAAC;AA6EzB,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,SAAS,EAAE,eAAe,CAAC;CAC5B,GAAG,iBAAiB,CAm3BpB"}