From d303e64c7f26cc85898f6f01c98375c4f80afea7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Mar 2026 22:14:10 +0000 Subject: [PATCH 1/5] Initial plan From bf6773d566704335b1b9f90ad63fc17791e31f84 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Mar 2026 22:18:09 +0000 Subject: [PATCH 2/5] Fix missing redeemer for Plutus mint script Co-authored-by: SynthLuvr <131367121+SynthLuvr@users.noreply.github.com> --- src/mint.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mint.ts b/src/mint.ts index f02e221..a5a4518 100644 --- a/src/mint.ts +++ b/src/mint.ts @@ -4,6 +4,7 @@ import { Address, Assets, createClient, + Data, Effect, ScriptHash, TransactionHash, @@ -130,6 +131,7 @@ const program = new Command() .newTx() .mintAssets({ assets: Assets.fromRecord({ [token]: amount }), + redeemer: new Data.Constr({ index: 0n, fields: [] }), }) .readFrom({ referenceInputs: [refScript] }) .collectFrom({ inputs: [ref] }) From 27bd6902f5326e72dad2c4def19f70451f04e4d4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Mar 2026 22:31:25 +0000 Subject: [PATCH 3/5] Replace new Data.Constr with Data.constr factory across all source files Co-authored-by: SynthLuvr <131367121+SynthLuvr@users.noreply.github.com> --- src/burn.ts | 2 +- src/distribute.ts | 4 ++-- src/mint.ts | 2 +- src/nft.ts | 2 +- src/zero.ts | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/burn.ts b/src/burn.ts index 714232b..b101d67 100644 --- a/src/burn.ts +++ b/src/burn.ts @@ -76,7 +76,7 @@ const program = new Command() .newTx(wallet.utxos) .mintAssets({ assets: Assets.fromRecord({ [token]: amount * -1n }), - redeemer: new Data.Constr({ index: 0n, fields: [] }), + redeemer: Data.constr(0n, []), }) .readFrom({ referenceInputs: [refScript] }) .setValidity({ to: BigInt(Date.now() + expiresIn) }) diff --git a/src/distribute.ts b/src/distribute.ts index e3cce78..a829e13 100644 --- a/src/distribute.ts +++ b/src/distribute.ts @@ -105,7 +105,7 @@ const program = new Command() address: blackholeAddr, assets: Assets.fromLovelace(2000000n), datum: new InlineDatum.InlineDatum({ - data: new Data.Constr({ index: 0n, fields: [] }), + data: Data.constr(0n, []), }), script, }) @@ -156,7 +156,7 @@ const program = new Command() for (const [j, token] of tokens.entries()) { mintBuilder.mintAssets({ assets: Assets.fromRecord({ [token]: 1n }), - redeemer: new Data.Constr({ index: 0n, fields: [] }), + redeemer: Data.constr(0n, []), }); mintBuilder.payToAddress({ address: Address.fromBech32(addrs[j]), diff --git a/src/mint.ts b/src/mint.ts index a5a4518..d4d7244 100644 --- a/src/mint.ts +++ b/src/mint.ts @@ -131,7 +131,7 @@ const program = new Command() .newTx() .mintAssets({ assets: Assets.fromRecord({ [token]: amount }), - redeemer: new Data.Constr({ index: 0n, fields: [] }), + redeemer: Data.constr(0n, []), }) .readFrom({ referenceInputs: [refScript] }) .collectFrom({ inputs: [ref] }) diff --git a/src/nft.ts b/src/nft.ts index e20c722..883de56 100644 --- a/src/nft.ts +++ b/src/nft.ts @@ -89,7 +89,7 @@ const program = new Command() address: blackholeAddr, assets: Assets.fromLovelace(2000000n), datum: new InlineDatum.InlineDatum({ - data: new Data.Constr({ index: 0n, fields: [] }), + data: Data.constr(0n, []), }), script, }) diff --git a/src/zero.ts b/src/zero.ts index 5d4ff10..a070a9b 100644 --- a/src/zero.ts +++ b/src/zero.ts @@ -64,7 +64,7 @@ const program = new Command() .newTx(wallet.utxos) .mintAssets({ assets: Assets.fromRecord({ [token]: 1n }), - redeemer: new Data.Constr({ index: 0n, fields: [] }), + redeemer: Data.constr(0n, []), }) .attachScript({ script }) .collectFrom({ inputs: [ref] }) @@ -79,7 +79,7 @@ const program = new Command() .newTx(mintChain.available) .mintAssets({ assets: Assets.fromRecord({ [token]: -1n }), - redeemer: new Data.Constr({ index: 0n, fields: [] }), + redeemer: Data.constr(0n, []), }) .attachScript({ script }) .setValidity({ to: BigInt(Date.now() + expiresIn) }) From d11e442bc05ceae1b203b0d08e9feff4acab5e42 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Mar 2026 22:39:57 +0000 Subject: [PATCH 4/5] =?UTF-8?q?Remove=20redeemer=20from=20mintAssets=20cal?= =?UTF-8?q?ls=20=E2=80=94=20Plutus=20V3=20doesn't=20require=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: SynthLuvr <131367121+SynthLuvr@users.noreply.github.com> --- src/burn.ts | 2 -- src/distribute.ts | 1 - src/mint.ts | 2 -- src/zero.ts | 3 --- 4 files changed, 8 deletions(-) diff --git a/src/burn.ts b/src/burn.ts index b101d67..363c4cc 100644 --- a/src/burn.ts +++ b/src/burn.ts @@ -2,7 +2,6 @@ import { Address, Assets, createClient, - Data, ScriptHash, Transaction, TransactionHash, @@ -76,7 +75,6 @@ const program = new Command() .newTx(wallet.utxos) .mintAssets({ assets: Assets.fromRecord({ [token]: amount * -1n }), - redeemer: Data.constr(0n, []), }) .readFrom({ referenceInputs: [refScript] }) .setValidity({ to: BigInt(Date.now() + expiresIn) }) diff --git a/src/distribute.ts b/src/distribute.ts index a829e13..83e78a9 100644 --- a/src/distribute.ts +++ b/src/distribute.ts @@ -156,7 +156,6 @@ const program = new Command() for (const [j, token] of tokens.entries()) { mintBuilder.mintAssets({ assets: Assets.fromRecord({ [token]: 1n }), - redeemer: Data.constr(0n, []), }); mintBuilder.payToAddress({ address: Address.fromBech32(addrs[j]), diff --git a/src/mint.ts b/src/mint.ts index d4d7244..f02e221 100644 --- a/src/mint.ts +++ b/src/mint.ts @@ -4,7 +4,6 @@ import { Address, Assets, createClient, - Data, Effect, ScriptHash, TransactionHash, @@ -131,7 +130,6 @@ const program = new Command() .newTx() .mintAssets({ assets: Assets.fromRecord({ [token]: amount }), - redeemer: Data.constr(0n, []), }) .readFrom({ referenceInputs: [refScript] }) .collectFrom({ inputs: [ref] }) diff --git a/src/zero.ts b/src/zero.ts index a070a9b..86a9fc6 100644 --- a/src/zero.ts +++ b/src/zero.ts @@ -3,7 +3,6 @@ import { Address, Assets, createClient, - Data, ScriptHash, TransactionHash, UPLC, @@ -64,7 +63,6 @@ const program = new Command() .newTx(wallet.utxos) .mintAssets({ assets: Assets.fromRecord({ [token]: 1n }), - redeemer: Data.constr(0n, []), }) .attachScript({ script }) .collectFrom({ inputs: [ref] }) @@ -79,7 +77,6 @@ const program = new Command() .newTx(mintChain.available) .mintAssets({ assets: Assets.fromRecord({ [token]: -1n }), - redeemer: Data.constr(0n, []), }) .attachScript({ script }) .setValidity({ to: BigInt(Date.now() + expiresIn) }) From df1f59734adb249eba9506220e516f4278bc92bd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Mar 2026 22:49:09 +0000 Subject: [PATCH 5/5] =?UTF-8?q?Fix=20PlutusV2=E2=86=92PlutusV3=20and=20add?= =?UTF-8?q?=20applySingleCborEncoding=20in=20zero.ts=20and=20distribute.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: SynthLuvr <131367121+SynthLuvr@users.noreply.github.com> --- src/distribute.ts | 16 +++++++++------- src/zero.ts | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/distribute.ts b/src/distribute.ts index 83e78a9..4845aac 100644 --- a/src/distribute.ts +++ b/src/distribute.ts @@ -1,6 +1,6 @@ import { readFileSync } from "fs"; import { password } from "@inquirer/prompts"; -import { PlutusV2 } from "@evolution-sdk/evolution/PlutusV2"; +import { PlutusV3 } from "@evolution-sdk/evolution/PlutusV3"; import { Address, Assets, @@ -218,12 +218,14 @@ const Addresses = (network: "Mainnet" | "Preprod" | "Preview") => return lines; }); -const createScript = (plutus: string, ref: UTxO.UTxO): PlutusV2 => { - const scriptHex = UPLC.applyParamsToScript(plutus, [ - TransactionHash.toBytes(ref.transactionId), - ]); +const createScript = (plutus: string, ref: UTxO.UTxO): PlutusV3 => { + const scriptHex = UPLC.applySingleCborEncoding( + UPLC.applyParamsToScript(plutus, [ + TransactionHash.toBytes(ref.transactionId), + ]) + ); - return new PlutusV2({ bytes: hexToBytes(scriptHex) }); + return new PlutusV3({ bytes: hexToBytes(scriptHex) }); }; const createBlackholeAddress = ( @@ -236,7 +238,7 @@ const createBlackholeAddress = ( const footer = "0048810014984d9595cd01"; const scriptHex = `${header}${body}${footer}`; - const script = new PlutusV2({ bytes: hexToBytes(scriptHex) }); + const script = new PlutusV3({ bytes: hexToBytes(scriptHex) }); const scriptHash = ScriptHash.fromScript(script); return new Address.Address({ diff --git a/src/zero.ts b/src/zero.ts index 86a9fc6..4638991 100644 --- a/src/zero.ts +++ b/src/zero.ts @@ -1,4 +1,4 @@ -import { PlutusV2 } from "@evolution-sdk/evolution/PlutusV2"; +import { PlutusV3 } from "@evolution-sdk/evolution/PlutusV3"; import { Address, Assets, @@ -90,13 +90,15 @@ const program = new Command() console.log(`\nCreated token: ${token}`); }); -const createScript = (plutus: string, ref: UTxO.UTxO): PlutusV2 => { - const scriptHex = UPLC.applyParamsToScript(plutus, [ - TransactionHash.toBytes(ref.transactionId), - ref.index, - ]); +const createScript = (plutus: string, ref: UTxO.UTxO): PlutusV3 => { + const scriptHex = UPLC.applySingleCborEncoding( + UPLC.applyParamsToScript(plutus, [ + TransactionHash.toBytes(ref.transactionId), + ref.index, + ]) + ); - return new PlutusV2({ bytes: hexToBytes(scriptHex) }); + return new PlutusV3({ bytes: hexToBytes(scriptHex) }); }; program.parseAsync(process.argv);