From 92c96390d50516a6ed880d942f62bb9be1a7befd Mon Sep 17 00:00:00 2001 From: Carlos Souza Date: Fri, 12 Jul 2024 15:35:27 -0400 Subject: [PATCH 1/4] Update to aiken v1.0.28-alpha --- aiken.lock | 4 ++-- aiken.toml | 2 +- plutus.json | 12 ++++++++---- validators/mint.ak | 12 ++++++++---- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/aiken.lock b/aiken.lock index ea3e8c8..62f2265 100644 --- a/aiken.lock +++ b/aiken.lock @@ -3,12 +3,12 @@ [[requirements]] name = "aiken-lang/stdlib" -version = "1.6.0" +version = "1.9.0" source = "github" [[packages]] name = "aiken-lang/stdlib" -version = "1.6.0" +version = "1.9.0" requirements = [] source = "github" diff --git a/aiken.toml b/aiken.toml index 1b19543..3ea4e90 100644 --- a/aiken.toml +++ b/aiken.toml @@ -10,5 +10,5 @@ platform = "github" [[dependencies]] name = "aiken-lang/stdlib" -version = "1.6.0" +version = "1.9.0" source = "github" diff --git a/plutus.json b/plutus.json index a314f18..dae0303 100644 --- a/plutus.json +++ b/plutus.json @@ -4,6 +4,10 @@ "description": "Aiken contracts for project 'wowica/jungle_vault'", "version": "0.0.0", "plutusVersion": "v2", + "compiler": { + "name": "Aiken", + "version": "v1.0.28-alpha+c9a1519" + }, "license": "Apache-2.0" }, "validators": [ @@ -29,8 +33,8 @@ } } ], - "compiledCode": "590221010000323232323232323232323223222232533300b32323232533300f3370e9000180700089919191919191919191919299980e98100010991919299980e99b87480000044c94ccc078cdc3a4000603a002264a66603e66e1c011200213371e00a0322940c07000458c8cc004004030894ccc088004530103d87a80001323253330213375e6603a603e004900000d099ba548000cc0940092f5c0266008008002604c00460480022a66603a66e1c009200113371e00602e2940c06c050dd6980e8011bae301b00116301e001323232533301b3370e90010008a5eb7bdb1804c8dd59810800980c801180c800991980080080111299980f0008a6103d87a8000132323232533301f3371e01e004266e95200033023374c00297ae0133006006003375660400066eb8c078008c088008c080004c8cc004004008894ccc07400452f5bded8c0264646464a66603c66e3d221000021003133022337606ea4008dd3000998030030019bab301f003375c603a0046042004603e0026eacc070004c070004c06c004c068004c064008dd6180b80098078029bae3015001300d001163013001301300230110013009002149858c94ccc02ccdc3a40000022a66601c60120062930b0a99980599b874800800454ccc038c02400c52616163009002375c0026600200290001111199980399b8700100300c233330050053370000890011807000801001118029baa001230033754002ae6955ceaab9e5573eae815d0aba201", - "hash": "b68d60efe0d3745ffde93cfe0c84368391908275df712ca413039dc3" + "compiledCode": "5901f5010000323232323232322322232323225333009323232533300c3007300d3754002264646464a666026602c00426464a666024601a60266ea803854ccc048c034c04cdd5191980080080311299980b8008a60103d87a80001323253330163375e603660306ea800804c4cdd2a40006603400497ae0133004004001301b002301900115333012300c00113371e00402029405854ccc048cdc3800a4002266e3c0080405281bad3013002375c60220022c602800264a66601e601260206ea800452f5bded8c026eacc050c044dd500099191980080099198008009bab3016301730173017301700522533301500114bd6f7b630099191919299980b19b91488100002153330163371e9101000021003100513301a337606ea4008dd3000998030030019bab3017003375c602a0046032004602e00244a666028002298103d87a800013232323253330153372200e0042a66602a66e3c01c0084cdd2a4000660326e980052f5c02980103d87a80001330060060033756602c0066eb8c050008c060008c058004dd7180998081baa00337586024002601c6ea800858c040c044008c03c004c02cdd50008a4c26cac64a66601060060022a66601660146ea8010526161533300830020011533300b300a37540082930b0b18041baa003370e90011b8748000dd7000ab9a5573aaae7955cfaba05742ae89", + "hash": "0c0d17d9095fe6b07a2727403e2c6f2dff8042ed7c300cb67a2577a2" }, { "title": "mint.redeem", @@ -60,8 +64,8 @@ } } ], - "compiledCode": "59015901000032323232323232323232232232222533300b323232323232323232325333018301b0021323253330173370e0029000899b8f00201214a06eb4c060008dd7180b0008b180c800991919299980b19b874800800452f5bded8c02646eacc070004c054008c058dd5000991980080080111299980c8008a60103d87a8000132323232533301a3371e026004266e9520003301e374c00297ae0133006006003375660360066eb8c064008c074008c06c004c8cc004004008894ccc06000452f5bded8c0264646464a66603266e3d22100002100313301d337606ea4008dd3000998030030019bab301a003375c6030004603800460340026eacc05c004c05c004c058004c054004c050004c030004c044004c02800452616375c0026eb8004cc0040052000222233330063370e0020060164666600a00a66e000112002300d001002002230043754002ae6955ceaab9e5573eae815d0aba21", - "hash": "4c1fbddb9fa7ded1ac9c455ff6152c36748cba15e16fa64ca6d9fc26" + "compiledCode": "5901320100003232323232323223223222253330083232533300d3010002132533300b3370e6eb4c034009200113371e0020122940dd718058008b180700099299980499b8748008c028dd50008a5eb7bdb1804dd5980718059baa001323300100132330010013756601e602060206020602060186ea8c03cc030dd50019129998070008a5eb7bdb1804c8c8c8c94ccc03ccdc8a45000021533300f3371e91010000210031005133013337606ea4008dd3000998030030019bab3010003375c601c0046024004602000244a66601a002298103d87a8000132323232533300e337220140042a66601c66e3c0280084cdd2a4000660246e980052f5c02980103d87a80001330060060033756601e0066eb8c034008c044008c03c00452613656375c0026eb80055cd2ab9d5573caae7d5d02ba157441", + "hash": "39faa048196bb6b30f50815475e9d16b22e7a0ef6de5935b408ca617" } ], "definitions": { diff --git a/validators/mint.ak b/validators/mint.ak index ee49426..cf201db 100644 --- a/validators/mint.ak +++ b/validators/mint.ak @@ -16,11 +16,13 @@ validator(token_name: ByteArray, utxo_ref: OutputReference) { let Transaction { inputs, mint, .. } = transaction - expect [(asset_name, amount)] = + let asset_pairs = mint |> value.from_minted_value |> value.tokens(policy_id) - |> dict.to_list() + |> dict.to_pairs() + + expect [Pair(asset_name, amount)] = asset_pairs when rdmr is { Mint -> { @@ -39,11 +41,13 @@ validator(token_name: ByteArray, policy_id: ByteArray) { let Transaction { mint, .. } = transaction - expect [(asset_name, amount)] = + let asset_pairs = mint |> value.from_minted_value |> value.tokens(policy_id) - |> dict.to_list() + |> dict.to_pairs() + + expect [Pair(asset_name, amount)] = asset_pairs amount == -1 && asset_name == token_name } From cbc497f39066cdf69e10805a7fda883ef55fb46c Mon Sep 17 00:00:00 2001 From: Carlos Souza Date: Fri, 12 Jul 2024 15:35:55 -0400 Subject: [PATCH 2/4] Update to v1.0.29-alpha --- plutus.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plutus.json b/plutus.json index dae0303..a7d63d7 100644 --- a/plutus.json +++ b/plutus.json @@ -6,7 +6,7 @@ "plutusVersion": "v2", "compiler": { "name": "Aiken", - "version": "v1.0.28-alpha+c9a1519" + "version": "v1.0.29-alpha+16fb02e" }, "license": "Apache-2.0" }, From 6b97731fdd9d89fe429a7f626fb70e1d5151fa2c Mon Sep 17 00:00:00 2001 From: Carlos Souza Date: Fri, 12 Jul 2024 15:40:26 -0400 Subject: [PATCH 3/4] Update Aiken version on CI --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7a2fd57..cb08162 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: - uses: aiken-lang/setup-aiken@v0.1.0 with: - version: v1.0.17-alpha + version: v1.0.29-alpha - run: aiken fmt --check - run: aiken check -D From 044e7cd77d3ebbbfc36f246d69070178d52b9918 Mon Sep 17 00:00:00 2001 From: Carlos Souza Date: Fri, 12 Jul 2024 15:43:20 -0400 Subject: [PATCH 4/4] Update setup-aiken GH action --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cb08162..de45a94 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: aiken-lang/setup-aiken@v0.1.0 + - uses: aiken-lang/setup-aiken@v1 with: version: v1.0.29-alpha