@easy1staking/cip113-sdk-ts 0.6.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 (39) 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 +166 -76
  23. package/dist/standard/scripts.d.ts.map +1 -1
  24. package/dist/standard/scripts.js +222 -118
  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 +32 -0
  31. package/dist/substandards/freeze-and-seize/index.d.ts.map +1 -1
  32. package/dist/substandards/freeze-and-seize/index.js +456 -118
  33. package/dist/substandards/freeze-and-seize/index.js.map +1 -1
  34. package/dist/substandards/freeze-and-seize/scripts.d.ts.map +1 -1
  35. package/dist/substandards/freeze-and-seize/scripts.js +8 -2
  36. package/dist/substandards/freeze-and-seize/scripts.js.map +1 -1
  37. package/dist/types.d.ts +131 -48
  38. package/dist/types.d.ts.map +1 -1
  39. package/package.json +2 -2
@@ -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";
@@ -37,23 +50,26 @@ import { parameterizeScript, outputReference, scriptCredential, computeScriptHas
37
50
  export function createStandardScripts(blueprint, onParameterize) {
38
51
  function parameterize(validatorTitle, params) {
39
52
  const code = getValidatorCode(blueprint, validatorTitle);
53
+ // Parameterise FIRST: the applied hash is a by-product of the work, not a
54
+ // second hashing pass. A recorder that fired before the application would
55
+ // also report parameterisations that went on to throw.
56
+ const script = parameterizeScript(code, params);
40
57
  if (onParameterize) {
41
- onParameterize({ title: validatorTitle, rawScriptHash: computeScriptHash(code), params });
58
+ onParameterize({
59
+ title: validatorTitle,
60
+ rawScriptHash: computeScriptHash(code),
61
+ appliedScriptHash: script.hash,
62
+ params,
63
+ });
42
64
  }
43
- return parameterizeScript(code, params);
65
+ return script;
44
66
  }
45
67
  return {
46
68
  alwaysFail(nonce) {
47
69
  return parameterize(STANDARD_VALIDATORS.ALWAYS_FAIL, [Data.bytearray(nonce)]);
48
70
  },
49
- coordinationSpend(nonce) {
50
- return parameterize(STANDARD_VALIDATORS.COORDINATION_SPEND, [Data.bytearray(nonce)]);
51
- },
52
- protocolParamsMint(utxoRef, coordinationHash) {
53
- return parameterize(STANDARD_VALIDATORS.PROTOCOL_PARAMS_MINT, [
54
- outputReference(utxoRef),
55
- Data.bytearray(coordinationHash),
56
- ]);
71
+ protocolParams(utxoRef) {
72
+ return parameterize(STANDARD_VALIDATORS.PROTOCOL_PARAMS, [outputReference(utxoRef)]);
57
73
  },
58
74
  programmableLogicBase(paramsPolicy) {
59
75
  // PolicyId — a bare ByteArray. It was scriptCredential(plgHash) before #110.
@@ -61,47 +77,70 @@ export function createStandardScripts(blueprint, onParameterize) {
61
77
  Data.bytearray(paramsPolicy),
62
78
  ]);
63
79
  },
64
- transfer(paramsPolicy) {
65
- return parameterize(STANDARD_VALIDATORS.TRANSFER, [Data.bytearray(paramsPolicy)]);
66
- },
67
- thirdParty(paramsPolicy) {
68
- 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
+ ]);
69
86
  },
70
- unfracking(paramsPolicy) {
71
- 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
+ ]);
72
93
  },
73
- upgradeMultisig(signers, threshold) {
74
- return parameterize(STANDARD_VALIDATORS.UPGRADE_MULTISIG, [
75
- Data.list(signers.map((s) => Data.bytearray(s))),
76
- 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)),
77
99
  ]);
78
100
  },
101
+ upgradeMultisig(utxoRef) {
102
+ return parameterize(STANDARD_VALIDATORS.UPGRADE_MULTISIG, [outputReference(utxoRef)]);
103
+ },
79
104
  issuanceCborHexMint(utxoRef, alwaysFailHash) {
80
105
  return parameterize(STANDARD_VALIDATORS.ISSUANCE_CBOR_HEX_MINT, [
81
106
  outputReference(utxoRef),
82
107
  Data.bytearray(alwaysFailHash),
83
108
  ]);
84
109
  },
85
- registryMint(utxoRef, issuanceCborHexPolicy, registrySpendHash) {
86
- return parameterize(STANDARD_VALIDATORS.REGISTRY_MINT, [
110
+ registry(utxoRef, issuanceCborHexPolicy) {
111
+ return parameterize(STANDARD_VALIDATORS.REGISTRY, [
87
112
  outputReference(utxoRef),
88
113
  Data.bytearray(issuanceCborHexPolicy),
89
- scriptCredential(registrySpendHash),
90
114
  ]);
91
115
  },
92
- registrySpend(paramsPolicy) {
93
- return parameterize(STANDARD_VALIDATORS.REGISTRY_SPEND, [
94
- 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),
95
125
  ]);
96
126
  },
97
- issuanceMint(plbHash, registryNodePolicy, mintingLogicHash, paramsPolicy) {
127
+ issuanceMint(mintingLogicHash, paramsPolicy) {
98
128
  return parameterize(STANDARD_VALIDATORS.ISSUANCE_MINT, [
99
- scriptCredential(plbHash),
100
- Data.bytearray(registryNodePolicy),
101
129
  scriptCredential(mintingLogicHash),
102
130
  Data.bytearray(paramsPolicy),
103
131
  ]);
104
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
+ },
105
144
  };
106
145
  }
107
146
  /** Thrown when a blueprint does not reproduce its deployment's script hashes. */
@@ -119,92 +158,151 @@ export class DeploymentMismatchError extends Error {
119
158
  this.mismatches = mismatches;
120
159
  }
121
160
  }
122
- /**
123
- * Derive every parameterizable standard script hash from the blueprint and
124
- * check it against DeploymentParams. Throws DeploymentMismatchError on any
125
- * difference; returns the full check list on success.
126
- *
127
- * Why this exists: parameterization changes are not always visible to the
128
- * compiler. Upstream has changed a parameter's *meaning* while keeping its
129
- * arity and type (protocol_params_mint's `always_fail_hash` became
130
- * `coordination_addr_hash` in 0.5.0-alpha.1), so a wrong value typechecks,
131
- * builds, and only fails when the ledger rejects the transaction. This is the
132
- * check that catches it, and it is why buildDeploymentScripts no longer
133
- * overwrites derived hashes with deployment values.
134
- *
135
- * Not covered: always_fail (its nonce is not carried in DeploymentParams),
136
- * issuance_mint (parameterized per minting logic), and upgrade_multisig (its
137
- * signers/threshold are an authority choice, not a derived protocol value).
138
- * coordination_spend IS covered — DeploymentParams carries its nonce precisely
139
- * so the lock target can be re-derived rather than trusted.
140
- *
141
- * WHERE THIS CHECK HAS VALUE — and where it has none.
142
- *
143
- * It is only meaningful when the blueprint and the deployment come from
144
- * INDEPENDENT sources, so that they can actually disagree: a deployment loaded
145
- * from disk, a database, or the chain, checked against the blueprint currently
146
- * bundled. That is the case it catches, and the failure it catches is real —
147
- * this repo shipped a blueprint swapped in place under an unchanged directory
148
- * name, with 4 of 8 validator hashes moved.
149
- *
150
- * It proves NOTHING at bootstrap time. A deployment script derives the hashes,
151
- * populates DeploymentParams from those same values, and then asserts against
152
- * them — a tautology that cannot fail. Do not read a passing assertion inside a
153
- * bootstrap as evidence that the deployment is correct; assert on LOAD instead.
154
- */
155
- export function assertDeploymentScripts(blueprint, deployment) {
161
+ function deriveDeploymentScripts(blueprint, deployment) {
156
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);
157
181
  const checks = [
158
182
  {
159
- name: "coordination_spend",
160
- derived: builders.coordinationSpend(deployment.coordinationNonce).hash,
161
- deployed: deployment.coordination.scriptHash,
162
- },
163
- {
164
- name: "protocol_params_mint",
165
- 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,
166
189
  deployed: deployment.protocolParams.policyId,
167
190
  },
168
191
  {
169
192
  name: "programmable_logic_base",
170
- derived: builders.programmableLogicBase(deployment.protocolParams.policyId).hash,
171
- deployed: deployment.programmableLogicBase.scriptHash,
193
+ derived: programmableLogicBase.hash,
194
+ deployed: plb,
172
195
  },
173
196
  {
174
197
  name: "transfer",
175
- derived: builders.transfer(deployment.protocolParams.policyId).hash,
198
+ derived: transfer.hash,
176
199
  deployed: deployment.transfer.scriptHash,
177
200
  },
178
201
  {
179
202
  name: "third_party",
180
- derived: builders.thirdParty(deployment.protocolParams.policyId).hash,
203
+ derived: thirdParty.hash,
181
204
  deployed: deployment.thirdParty.scriptHash,
182
205
  },
183
206
  {
184
207
  name: "unfracking",
185
- derived: builders.unfracking(deployment.protocolParams.policyId).hash,
208
+ derived: unfracking.hash,
186
209
  deployed: deployment.unfracking.scriptHash,
187
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
+ },
188
222
  {
189
223
  name: "issuance_cbor_hex_mint",
190
- derived: builders.issuanceCborHexMint(deployment.issuance.txInput, deployment.issuance.alwaysFailScriptHash).hash,
224
+ derived: issuanceCborHexMint.hash,
191
225
  deployed: deployment.issuance.policyId,
192
226
  },
193
227
  {
194
- name: "registry_spend",
195
- derived: builders.registrySpend(deployment.protocolParams.policyId).hash,
196
- 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,
197
233
  },
198
234
  {
199
- name: "registry_mint",
200
- derived: builders.registryMint(deployment.directoryMint.txInput, deployment.issuance.policyId, deployment.directorySpend.scriptHash).hash,
201
- 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,
202
276
  },
203
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) {
204
298
  const mismatches = checks.filter((c) => c.derived !== c.deployed);
205
299
  if (mismatches.length > 0) {
206
- throw new DeploymentMismatchError(mismatches, blueprint.preamble.title);
300
+ throw new DeploymentMismatchError(mismatches, blueprintTitle);
207
301
  }
302
+ }
303
+ export function assertDeploymentScripts(blueprint, deployment) {
304
+ const { checks } = deriveDeploymentScripts(blueprint, deployment);
305
+ refuseOnMismatch(checks, blueprint.preamble.title);
208
306
  return checks;
209
307
  }
210
308
  /**
@@ -216,21 +314,27 @@ export function assertDeploymentScripts(blueprint, deployment) {
216
314
  * undetectable until submission.
217
315
  */
218
316
  export function buildDeploymentScripts(blueprint, deployment) {
219
- assertDeploymentScripts(blueprint, deployment);
220
- const builders = createStandardScripts(blueprint);
221
- 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);
222
324
  return {
223
- coordinationSpend: builders.coordinationSpend(deployment.coordinationNonce),
224
- protocolParamsMint: builders.protocolParamsMint(deployment.protocolParams.txInput, deployment.protocolParams.coordinationScriptHash),
225
- programmableLogicBase: builders.programmableLogicBase(paramsPolicy),
226
- transfer: builders.transfer(paramsPolicy),
227
- thirdParty: builders.thirdParty(paramsPolicy),
228
- unfracking: builders.unfracking(paramsPolicy),
229
- issuanceCborHexMint: builders.issuanceCborHexMint(deployment.issuance.txInput, deployment.issuance.alwaysFailScriptHash),
230
- registryMint: builders.registryMint(deployment.directoryMint.txInput, deployment.issuance.policyId, deployment.directorySpend.scriptHash),
231
- registrySpend: builders.registrySpend(paramsPolicy),
325
+ ...scripts,
232
326
  buildIssuanceMint(mintingLogicHash) {
233
- 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);
234
338
  },
235
339
  };
236
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;AA6D9B,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,IAAI,cAAc,EAAE,CAAC;YACn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ACnD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CACpC,SAA0B,EAC1B,UAA4B;IAE5B,4EAA4E;IAC5E,4EAA4E;IAC5E,8EAA8E;IAC9E,4EAA4E;IAC5E,wCAAwC;IACxC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,uBAAuB,CACzE,SAAS,EACT,UAAU,CACX,CAAC;IACF,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEnD,OAAO;QACL,GAAG,OAAO;QACV,iBAAiB,CAAC,gBAA4B;YAC5C,sEAAsE;YACtE,wEAAwE;YACxE,wEAAwE;YACxE,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"}