diff --git a/lib/aiken-content-ownership/common.ak b/lib/aiken-content-ownership/common.ak index bd8e1a6..d5903a9 100644 --- a/lib/aiken-content-ownership/common.ak +++ b/lib/aiken-content-ownership/common.ak @@ -1,6 +1,6 @@ use aiken/bytearray use aiken/list -use aiken/transaction.{Input, Output} +use aiken/transaction.{Input, Output, Spend} use aiken/transaction/credential.{Address} use aiken/transaction/value.{ AssetName, MintedValue, PolicyId, Value, flatten, from_minted_value, @@ -161,6 +161,15 @@ pub fn value_length(value: Value) -> Int { list.length(flatten(value)) } +pub fn compare_output_reference(x, y) { + expect Spend(out_ref_x) = x + expect Spend(out_ref_y) = y + bytearray.compare( + out_ref_x.transaction_id.hash, + out_ref_y.transaction_id.hash, + ) +} + test byte_conversion() { convert_int_to_bytes(1) == "1" && convert_int_to_bytes(123) == "123" && convert_int_to_bytes( 672912, diff --git a/plutus.json b/plutus.json index 9b252a8..2a9bde9 100644 --- a/plutus.json +++ b/plutus.json @@ -11,6 +11,31 @@ "license": "Apache-2.0" }, "validators": [ + { + "title": "content_registry.content_registry", + "datum": { + "title": "datum", + "schema": { + "$ref": "#/definitions/aiken_content_ownership~1types~1ContentRegistryDatum" + } + }, + "redeemer": { + "title": "redeemer", + "schema": { + "$ref": "#/definitions/aiken_content_ownership~1types~1ContentRegistryRedeemer" + } + }, + "parameters": [ + { + "title": "oracle_nft", + "schema": { + "$ref": "#/definitions/ByteArray" + } + } + ], + "compiledCode": "590a2101000032323232323232323223222232323232533300c333332323232323232323232323232323222223232323232323232323253330293370e9001181400389919191919299981719b8748000c0b40084c8c8c8c94ccc0d401c0144c94ccc0d80044c8c94ccc0d4cdc3a4008606800226464a66606e66e1d2000303600113232323232323232323232323232323232323232533304e305100213232323232323253330550020011325333056001132533305700500313253330580011323253330573370e9000182b00089919191919299982e19b8748000c16c0044c8c8c8c8c8c8c8c94ccc19cc1a800c4c94ccc1a0c1ac00c4c94ccc198cdc3a400860ca0022646464a6660d266e1d2004306800113232323232533306e3370e900218368008991919299983899b8748010c1c00044c8c8c8c8c8c8c8c8c8c94ccc1ed4ccc1ed4ccc1ed4ccc1ed4ccc1ec018401452808020a50100314a020042940400452819b873060306d375660d860f002c900219b87305f306c375660d660ee02c900219baf0063374a90001983e1ba8337006eb4c1a0c1d803920023307c374c66664444646600200200a44a666102020022661040266ec0dd40029ba73308201307f00433082013080010044bd7025eb7bdb1804c8c8c8c94ccc20804cdd799803804801260103d879800013308601337606ea0024dd39984300984180804198430098420080425eb8001454ccc20804cdc38048010998430099bb037500126e9ccc21804c20c04020cc21804c210040212f5c000626610c0266ec0dd40011ba7330860130830100133086013084010014bd70198030030019919bb030870100130870130880100137586106020066eb4c20404008c21404008c20c04004dd59835183b0071bad3068307600e0470604bd7019baf0083374a90001983d9ba8337006eb4c19cc1d404120023307b374c66664444646600200200a44a666100020022661020266ec0dd40029ba90044bd6f7b63009919191929998408099baf330070090024c0103d879800013308501337606ea0024dd48040028a9998408099b8700900213308501337606ea0024dd48040018998428099bb037500046ea4004cc01801800cdd71841008019bad308001002308401002308201001375660d260ea0206eb4c19cc1d404012017d2f5c066e1cdd69833183a0079bad3066307400c3371e03602c60ba00460d400860ee00260de0022c60bc60dc01860e800260d80022c60b660d601460aa00460c400860de00260ce0022c60ac60cc60b460cc02660d800260c80022c60a660c660ae60c60242c60d20042c60d00046eb0c190008dd6183100099bb0374e666609407004404800c6e9ccccc1280e0070078004dd7183200098320009bac3062001305a0011633046304e3756609a60b2609a60b200c466e3cdd7182600080d1bae305f001305f001375860ba00260aa0022c6608260926eacc120c150c120c15000c8cdc79bae304700101b305a006004305a0053058003002305800214a06eb0c144008dd6182880099bb0374e6660740540200246e9cccc0e80a8028030c0e8024c0e4038c0e004458dd7182780098278011bae304d001304d002375a60960026096004609200260920046eb8c11c004c11c008dd698228009822801182180098218011bae30410013041002303f001303f002375c607a002606a0022c607600260660022c60446064604c6064002607001000c607000e6466ec0c0dc004c0dcc0e0004dd6181b000981b0011bae3034001302c00200114a0605a0046eb0c0b4004cdd80069ba73301900423370e6660386eacc074c0a4c074c0a400404122010048008c09c01c58dd6181680098168011bac302b001302b002375860520026042006604e002604e004604a002603a002600200244a66603c00229000099b8048008cc008008c084004894ccc068cdc40010008a6103d87980001533301a337100020042980103d87b800014c103d87a800023253330193370e90000008991919192999810181180109924c6602a00246464646eb8c08c008dd718108009919bb0302500130253026001375860420046eb4c07c00458dd5981080098108011bad301f00130170021630170012222330090042533301b3375e60166032002008266e1cccc030dd59806980c80080180124004294088c8cc00400400c894ccc0700045300103d87a800013232533301b300500213374a90001980f9ba70024bd7009980200200098100011bac301e00122233006003253330183375e6010602c6014602c00200626644646600200200644a66603e00229404c8c94ccc078c01400852889980200200098118011bac3021001300b37566014602c6014602c002466e3cdd718048008018a5023253330153370e9000000899191919299980e180f8010991924c64a66603666e1d20000011323253330203023002132498c94ccc078cdc3a400000226464a666046604c00426493180a0008b1812000980e0010a99980f19b87480080044c8c8c8c8c8c94ccc09cc0a800852616375a605000260500046eb4c098004c098008dd69812000980e0010b180e0008b1810800980c8018a99980d99b874800800454ccc078c06400c52616163019002300d00316301d001301d002301b0013013002163013001230183019301900122323300100100322533301800114bd7009919299980b980280109980d80119802002000899802002000980e001180d0009180b00091119199119299980b19b874800800440084dd6980d980a001980a00119299980a19b87480080045300103d87a8000132323300100100222533301a00114c103d87a8000132323232533301b3371e014004266e9520003301f375000297ae0133006006003375a60380066eb8c068008c078008c070004dd5980c98090011809000a4000646600200200844a66602e0022980103d87a800013232323253330183371e010004266e9520003301c374c00297ae0133006006003375660320066eb8c05c008c06c008c0640048c050c0540048c8cc004004008894ccc04c00452f5c0264666444646600200200644a66603200220062646664446603c6e9ccc078dd48049980f1ba90033301e375000497ae0001375c60300026eb4c064004cc00c00cc074008c06c004dd718090009bab30130013300300330170023015001232533300e3370e9000000899192999809980b0010a4c2c6eb8c050004c03000854ccc038cdc3a400400226464a666026602c0042930b1bae3014001300c00216300c00100800700600514984d958c94ccc030cdc3a4000002264646464a666026602c00426493191bae3013002375c60220022c6466ec0c054004c054c058004dd6180a000980a0011bae3012001300a0061533300c3370e90010008a99980798050030a4c2c2c601400a600200a464a66601666e1d200000113232323253330123015002132498cc01c0048c8dd718098011bad3011001163756602600260260046eb4c044004c02400858c02400488c8cc00400400c894ccc03c00452613233003003301300230033011001375c0024600a6ea80048c00cdd5000ab9a5573aaae7955cfaba05742ae89", + "hash": "224762cbde55de2a8d58b422c8f466899090ff2ad94f04bfc2c8deb2" + }, { "title": "content_registry_ref_token.content_registry_ref_token", "redeemer": { @@ -27,8 +52,8 @@ } } ], - "compiledCode": "590766010000323232323232323232232223253330083232323232323232323232323253330153370e90000008991919191919191919191919299981099b8748000c08000854ccc09000c0044c94ccc0940044c8c94ccc090cdc3a40086046002264646464646464646464646464646464646464a666074004002264a666076002264a66607800a006264a66607a00226464a66607866e1d2004303b0011323232533303f3370e9002181f0008991919299982119b8748000c1040084c8c8c8c94ccc124c1300084c8c8c8c8c8c8c8c94ccc1394ccc1394ccc13801c401852808010a50100114a066e1cc008dd5981a1825809a400866e1cc004dd59819982500a24008460046060002600200244a66609c00229000099b8048008cc008008c1440054ccc120cdc3802a4000266ebcdd3001a60101a00014a066ebc028c8c8c8c8cdd2a40006609e60a00086609e60a00066609e60a00046609e60a00026609e6ea0cdc000ca400460a260a200260a0002609e002609c002608a044646600200200444a66609600229309919801801982780119191bae304c002375a6094002609a0022c6eacc128004c128008dd6982400098200010b180c8021822800981e8008b1811981e0021821000981d0008b1810181c801981f803002181f802981e801801181e8010a503758606c0046eb0c0d8004c8cdd81ba73333001024008030488100374e666600204800800c66464646464644660046600491010a526567697374727920280033003001330060014800922101290022337140040026002002444a66607466e1c005200213300448810033700004903009980219980180199b8600200133706002900a19b803370600400290301119b8b0010023001001222533303733710004900a0800899980180199b8300248050cdc1000a40280044444660400084a66607066ebcc06cc0d80040104cdc39998101bab301f3036001003002480085281bad3037001303700230350013035002375c6066002606600460620026062002605000a6002008464a66605466e1d200000113232323232323232323232323232323232323232533304130440021323232498c064024c060038c05c04458dd7182100098210011bae30400013040002375a607c002607c004607800260780046eb8c0e8004c0e8008dd6981c000981c001181b000981b0011bae3034001303400230320013032002375c606000260500042c6050002464a66605266e1d20000011323232325333030303300213232498c94ccc0bccdc3a400000226464a666068606e0042649319299981919b87480000044c8c94ccc0dcc0e80084c926300e0011630380013030002153330323370e90010008991919191919299981d981f0010a4c2c6eb4c0f0004c0f0008dd6981d000981d0011bad30380013030002163030001163035001302d0031533302f3370e90010008a99981918168018a4c2c2c605a004600e0062c60620026062004605e002604e0042c604e002464a66605066e1d200000113232533302d3030002149858dd7181700098130010a99981419b87480080044c8c94ccc0b4c0c000852616375c605c002604c0042c604c002605400260440022c6010604260146042002604e008004604e0060022a66604066e1d2002301f001132323300100100222533302600114a226464a66604aa66604a66e3cdd71804001007899b88375a601400490000a5113300400400114a060540046eb0c0a0004c010c8cc004004038894ccc09400452f5bded8c0264646464a66604c66e3d220100002100313302a337606ea4008dd3000998030030019bab3027003375c604a0046052004604e0022940c080014dd6181000211811800919198008008011129998110008a5eb804c8ccc888c8cc00400400c894ccc0a0004400c4c8ccc888cc0b4dd3998169ba90093302d37520066605a6ea00092f5c00026eb8c09c004dd6981400099801801981600118150009bae30210013756604400266006006604c0046048002460426044604400266ec0054dd399801806919b873330033756600460326004603200202e91100480088c07cc080004888c8cc88c94ccc07ccdc3a4004002200426eb4c090c07400cc074008c94ccc074cdc3a40040022980103d87a8000132323300100100222533302300114c103d87a800013232323253330243371e014004266e95200033028375000297ae0133006006003375a604a0066eb8c08c008c09c008c094004dd59811180d801180d800a4000646600200200844a6660400022980103d87a800013232323253330213371e010004266e95200033025374c00297ae0133006006003375660440066eb8c080008c090008c08800488c8cc00400400c894ccc07800452f5c026464a66603a600a00426604200466008008002266008008002604400460400026eb8c06c004c04c02852818098049bab3018001301800130170023758602a002602a00260280046eb0c048004c02800cc040004c040008c038004c018008526136563253330083370e90000008a99980598030018a4c2c2a66601066e1d20020011533300b300600314985858c018008dd7000918029baa001230033754002ae6955ceaab9e5573eae815d0aba21", - "hash": "bbc53b52bb8dabe86bb133a83c7572cb2aeb358220d86eb1bb0a3d45" + "compiledCode": "590769010000323232323232323232232223253330083333232323232323232323232323232323232323222232323232323232323232323232533302b3370e90000008991919191919299981899b8748000c0c000854ccc0d000c0044c94ccc0d40044c8c94ccc0d0cdc3a40086066002264646464646464646464646464646464a66608e004002264a666090002264a66609200a006264a66609400226464a66609266e1d200430480011323232533304c3370e900218258008991919299982799b8748000c1380084c8c8c8c94ccc158c1640084c8c8c8c8c94ccc1614ccc1614ccc160010400c52808010a50100114a066e1cc0f4dd59824182a8082400866e1cc0f0dd59823982a008a4008a6660aa66e1c015200013375e6e9800d30101a00014a066ebc028c8c8c8c8cdd2a4000660b860ba008660b860ba006660b860ba004660b860ba002660b86ea0cdc000ca400460bc60bc00260ba00260b800260b600260a403e646600200200444a6660b000229309919801801982e00119191bae3059002375a60ae00260b40022c6eacc15c004c15c008dd6982a80098268010b181b002182900098250008b181a1824802182780098238008b1818982300198260030021826002982500180118250010a50375860860046eb0c10c004cdd81ba7333302701a007025488100374e666604e03400600a6605c6605c91010a5265676973747279202800330330013303600148009221012900375a60880026088004608400260840046eb8c100004c100008c0f8004c0f8004c0d4008c078004c0e8004c0c800458c070c0c4c090c0c4004c0dc010008c0dc00c00454ccc0c0cdc3a4004605e002264646600200200444a66606c00229444c8c94ccc0d54ccc0d4cdc79bae30200020091337106eb4c078009200014a22660080080022940c0e8008dd6181c000980d191980080080411299981a8008a5eb7bdb1804c8c8c8c94ccc0d8cdc7a4500002100313303a337606ea4008dd3000998030030019bab3037003375c606a0046072004606e0022940c0c0008dd6181800099bb0011374e66038014466e1cccc078dd5980f9816180f9816000809a4410048008dd7181880098148050a5030290093756605c002605c002605a0046eb0c0ac004c0ac004c0a8008dd618140009810001981300098130011812000980e0009180398028009111198060021299980f19baf3009301c00100413370e66601c6eacc03cc07000400c009200214a0464a66603466e1d200000113232323232323232323232323232323232323232533303130340021323232498c088024c084038c08004458dd7181900098190011bae30300013030002375a605c002605c004605800260580046eb8c0a8004c0a8008dd698140009814001181300098130011bae3024001302400230220013022002375c604000260300042c60300024603a603c603c0024646600200200444a666038002297ae01323332223233001001003225333022001100313233322233027374e6604e6ea4024cc09cdd4801998139ba80024bd700009bae3021001375a604400266006006604c00460480026eb8c06c004dd5980e000998018019810001180f0009180d800980080091299980c0008a4000266e01200233002002301b001223371400400244646600200200644a666030002297ae0132325333017300500213301b00233004004001133004004001301c002301a0012223233223253330173370e9001000880109bad301c301500330150023253330153370e90010008a6103d87a8000132323300100100222533301b00114c103d87a8000132323232533301c3371e014004266e95200033020375000297ae0133006006003375a603a0066eb8c06c008c07c008c074004dd5980d18098011809800a4000646600200200844a6660300022980103d87a800013232323253330193371e010004266e9520003301d374c00297ae0133006006003375660340066eb8c060008c070008c0680048c054c0580048c94ccc040cdc3a4000002264646464a66602e6034004264649319299980b19b87480000044c8c94ccc06cc0780084c9263253330193370e900000089919299980f181080109924c60260022c603e002602e0042a66603266e1d2002001132323232323253330223025002149858dd6981180098118011bad30210013021002375a603e002602e0042c602e0022c603800260280062a66602c66e1d200200115333019301400314985858c050008c03000c58c060004c060008c058004c03800858c038004c0040048894ccc03ccdc3800a40042660089110033700004903009980219980180199b8600200133706002900a19b803370600400290301119b8b0010023001001222533300c33710004900a0800899980180199b8300248050cdc1000a4028464a66601466e1d200000113232533300f3012002149858dd7180800098040010a99980519b87480080044c8c94ccc03cc04800852616375c602000260100042c601000200800600429309b2b19299980419b874800000454ccc02cc01800c52616153330083370e90010008a99980598030018a4c2c2c600c0046eb80048c014dd5000918019baa0015734aae7555cf2ab9f5740ae855d11", + "hash": "7f16bf20f7438f55bc1f6440bd4ea6db39e8b03afc5e082e558f20c7" }, { "title": "one_time_minting_policy.one_time_minting_policy", @@ -46,8 +71,8 @@ } } ], - "compiledCode": "5902040100003232323232323232322223253330073232323232533300c3370e9000000899191919299980819b87480000084c8c8c8c94ccc050cdc3a400000229445281809000991980080080111299980b8008a60103d87a80001323253330163375e026600e6028004266e9520003301a0024bd70099802002000980d801180c8009bac3016001300e0081332232323300100100222533301800114a226464a66602ea66602e66e3cdd71804001003099b88375a6038603a603a00490000a5113300400400114a060380046eb0c068004c8c8cc004004008894ccc06000452f5c0264666444646600200200644a66603c0022006264666444660466e9ccc08cdd4804998119ba900333023375000497ae0001375c603a0026eb4c078004cc00c00cc088008c080004dd7180b8009bab301800133003003301c002301a001323300100100322533301700114bd6f7b630099191919299980c19b8f488100002100313301c337606ea4008dd3000998030030019bab3019003375c602e004603600460320026eacc054c058c058c058c058c03802000c8c054004c034028dd7180900098050010a50300a001300f001300f002300d001300500214984d958c94ccc01ccdc3a40000022a666014600a0062930b0a99980399b874800800454ccc028c01400c52616163005002230053754002460066ea80055cd2ab9d5573caae7d5d02ba15745", - "hash": "d8c276927b630e86ea7a787a44db48c13847b674e1ecacf266ed5e9b" + "compiledCode": "59020c01000032323232323232323222232533300733332222323232323253330103370e90000008991919299980999b87480000044c8c8c8c94ccc05ccdc3a40000022944528180a800991980080080111299980d0008a60103d87a80001323253330193375e0226024602e004266e9520003301d0024bd70099802002000980f001180e0009bac301900130110071332232323300100100222533301b00114a226464a666034a66603466e3cdd71809801003099b88375a603e6040604000490000a5113300400400114a0603e0046eb0c074004c8c8cc004004008894ccc06c00452f5c0264666444646600200200644a66604200220062646664446604c6e9ccc098dd4804998131ba900333026375000497ae0001375c60400026eb4c084004cc00c00cc094008c08c004dd7180d0009bab301b00133003003301f002301d001323300100100322533301a00114bd6f7b630099191919299980d99b8f488100002100313301f337606ea4008dd3000998030030019bab301c003375c6034004603c00460380026eacc060c064c064c064c064c04401c008c044024dd7180b00098070010a50300e00130130013013002301100130090012300d00100400300214984d958c94ccc01ccdc3a40000022a666014600a0062930b0a99980399b874800800454ccc028c01400c52616163005002230053754002460066ea80055cd2ab9d5573caae7d5d02ba157441", + "hash": "d7a75e29fc699c832922e4594b5ac04ed4701b06f680ed9d39a8e5b6" }, { "title": "oracle_validator.oracle_validator", @@ -63,8 +88,33 @@ "$ref": "#/definitions/aiken_content_ownership~1types~1OracleRedeemer" } }, - "compiledCode": "5907140100003232323232323232322223232323232533300b323232323253330103370e90010008991919191919191919191919191919191919191919191919191919191919191919191919191919299981b99b87480000244cccc004084058c00804d2002153330373370e900100489999800810808980100724004264a66607066e1d200400a132323232323253330413044002132533303f3370e9002181f00089919191929998219919198008008011129998248008a511323253330483301102d00213300400400114a0609a0046eb8c12c004cc11cdd480c198239ba90164bd7008008a503375e0046464646464646466e9520003304d304e0073304d304e0063304d304e0053304d304e0043304d304e0033304d304e0023304d304e0013304d304e304f0013304d37520206609a6ea40392f5c0609c002609a0026098002609600260940026092002608007e6072002608a002607a0022c60866088608860780022c6084002646600200205444a666082002297ae013232533304053330403375e608a607c004042266e1cccc888c8cc88c94ccc11ccdc3a4004002200426eb4c130c11400cc114008c94ccc114cdc3a4004002298103d87a8000132323300100100222533304b00114c103d87a8000132323232533304c3371e014004266e95200033050375000297ae0133006006003375a609a0066eb8c12c008c13c008c134004dd5982518218011821800a4000646600200200844a6660900022980103d87a800013232323253330493371e010004266e9520003304d374c00297ae0133006006003375660940066eb8c120008c130008c128004dd598229823181f001011a45004800852809982200119802002000899802002000982280118218009bae30400013040002375c607c002606c0682a6660706600203a01626666004044036911004800452811191980080080191299981f0008a5013232533303d3371e00400a29444cc010010004c108008dd7182000091111919299981f9821001099191919192999820a99982099b8f00500a13371e00601229404cdc38008040a50375a608a002608a0046eb8c10c004c10c008dd718208008b1bac304000132323300100100222533304000114bd7009919991119198008008019129998230008801899199911198259ba73304b3752012660966ea400ccc12cdd400125eb80004dd718228009bad304600133003003304a0023048001375c607e0026eacc100004cc00c00cc110008c108004c8cc004004014894ccc0fc00452f5bded8c0264646464a66608066e3d2201000021003133044337606ea4008dd3000998030030019bab3041003375c607e00460860046082002466004660049110a526567697374727920280033003001330060014800922101290022337140040026002002444a66606a66e1c005200213300448810033700004903009980219980180199b8600200133706002900a19b803370600400290301119b8b0010023001001222533303233710004900a0800899980180199b8300248050cdc1000a4028605a0546eb8c0c8004c0c8008dd7181800098180011bad302e001302e001302d002375c605600260560046eb4c0a4004c0a4004c0a0008dd718130009813001181200098120011bae3022001301a019375860400026040002603e002603c002603a0046eacc06c004c06c004c068008dd6180c000980c000980b80098070020a50300e001301300130130023011001300900614984d958c94ccc02ccdc3a40000022a66601c601200e2930b0a99980599b874800800454ccc038c02401c526161533300b3370e90020008991919192999809180a8010a4c2c6eb8c04c004c04c008dd7180880098048038a99980599b874801800454ccc038c02401c526161630090063001006232533300a3370e90000008991919191919191919191919191919191919191929998109812001099191924c6032012603001c602e0222c6eb8c088004c088008dd7181000098100011bad301e001301e002301c001301c002375c603400260340046eb4c060004c060008c058004c058008dd7180a000980a001180900098090011bae3010001300800216300800123253330093370e9000000899191919299980818098010991924c64a66601e66e1d20000011323253330143017002132498c94ccc048cdc3a400000226464a66602e60340042649318070008b180c00098080010a99980919b87480080044c8c8c8c8c8c94ccc06cc07800852616375a603800260380046eb4c068004c068008dd6980c00098080010b18080008b180a80098068018a99980799b874800800454ccc048c03400c5261616300d00230070031630110013011002300f001300700216300700123253330083370e900000089919299980698080010a4c2c6eb8c038004c01800854ccc020cdc3a400400226464a66601a60200042930b1bae300e0013006002163006001230053754002460066ea80055cd2ab9d5573caae7d5d02ba15745", - "hash": "f45c93a64fb10cc4ec725353b299d142650305d695ec64e067cf63a7" + "compiledCode": "59071b0100003232323232323232322223232323232533300b3333232323232323232322223232323232533301c3370e9001000899191919191919191919191919191919191919191919191919191919191919299981d99b87480000044cccc0a4064038c0a002d20021533303b3370e90010008999981480c8049814003240042a66607666e1d200400113232323232325333044304700213253330423370e9002182080089919191929998231919198008008011129998260008a5113232533304b3303a02400213300400400114a060a00046eb8c138004cc128dd4807998251ba900d4bd7008008a503375e0046464646464646466e9520003305030510073305030510063305030510053305030510043305030510033305030510023305030510013305030513052001330503752020660a06ea40392f5c060a200260a0002609e002609c002609a002609800260860626078002609000260800022c608c608e608e607e0022c608a002646600200204244a666088002297ae013232533304353330433375e60906082004030266e1cccc888c8cc88c94ccc128cdc3a4004002200426eb4c13cc12000cc120008c94ccc120cdc3a4004002298103d87a8000132323300100100222533304e00114c103d87a8000132323232533304f3371e014004266e95200033053375000297ae0133006006003375a60a00066eb8c138008c148008c140004dd5982698230011823000a4000646600200200844a6660960022980103d87a8000132323232533304c3371e010004266e95200033050374c00297ae01330060060033756609a0066eb8c12c008c13c008c134004dd598241824982080100d245004800852809982380119802002000899802002000982400118230009bae30430013043002375c6082002607204c2a66607666054028004266660520320249110048004528181c8129bae303e001303e002375c607800260780046eb4c0e8004c0e8004c0e4008dd7181b800981b8011bad303500130350013034002375c60640026064004606000260600046eb8c0b8004c098050dd6181600098160009815800981500098148011bab302700130270013026002375860480026048002604600260340082940c068004c07c004c07c008c074004c0540048cc010cc0112210a526567697374727920280033005001330080014800922101290022223232533301b301e00213232323232533301d533301d3371e00a014266e3c00c024528099b8700100814a06eb4c084004c084008dd7180f800980f8011bae301d001163758603800264646600200200444a666038002297ae01323332223233001001003225333022001100313233322233027374e6604e6ea4024cc09cdd4801998139ba80024bd700009bae3021001375a604400266006006604c00460480026eb8c06c004dd5980e000998018019810001180f000991980080080291299980d8008a5eb7bdb1804c8c8c8c94ccc070cdc7a441000021003133020337606ea4008dd3000998030030019bab301d003375c6036004603e004603a00244646600200200644a66603000229404c8c94ccc05ccdc78010028a51133004004001301c002375c60340024466e28008004c0040048894ccc044cdc3800a40042660089110033700004903009980219980180199b8600200133706002900a19b803370600400290301119b8b0010023001001222533300e33710004900a0800899980180199b8300248050cdc1000a402801000e00c29309b2b19299980599b874800000454ccc038c02401c526161533300b3370e90010008a99980718048038a4c2c2a66601666e1d200400113232323253330123015002149858dd7180980098098011bae301100130090071533300b3370e90030008a99980718048038a4c2c2c601200c600200c464a66601466e1d200000113232323232323232323232323232323232323232533302130240021323232498c064024c060038c05c04458dd7181100098110011bae30200013020002375a603c002603c004603800260380046eb8c068004c068008dd6980c000980c001180b000980b0011bae3014001301400230120013012002375c602000260100042c6010002464a66601266e1d20000011323232325333010301300213232498c94ccc03ccdc3a400000226464a666028602e0042649319299980919b87480000044c8c94ccc05cc0680084c926300e0011630180013010002153330123370e90010008991919191919299980d980f0010a4c2c6eb4c070004c070008dd6980d000980d0011bad30180013010002163010001163015001300d0031533300f3370e90010008a99980918068018a4c2c2c601a004600e0062c60220026022004601e002600e0042c600e002464a66601066e1d200000113232533300d3010002149858dd7180700098030010a99980419b87480080044c8c94ccc034c04000852616375c601c002600c0042c600c0024600a6ea80048c00cdd5000ab9a5573aaae7955cfaba05742ae89", + "hash": "e231c92370fb608b43dcfdc754763befb17608bf985cdc5411c817e2" + }, + { + "title": "ownership_registry.ownership_registry", + "datum": { + "title": "datum", + "schema": { + "$ref": "#/definitions/aiken_content_ownership~1types~1OwnershipRegistryDatum" + } + }, + "redeemer": { + "title": "redeemer", + "schema": { + "$ref": "#/definitions/aiken_content_ownership~1types~1OwnershipRegistryRedeemer" + } + }, + "parameters": [ + { + "title": "oracle_nft", + "schema": { + "$ref": "#/definitions/ByteArray" + } + } + ], + "compiledCode": "5905930100003232323232323232322322223232533300a333332323232322222323232323232323232323232323232323253330243370e9001181180709919191919299981499b8748000c0a000854ccc0b000c0044c94ccc0b40044c8c94ccc0b0cdc3a4008605600226464a66605c66e1d2000302d001132323232323232323232323232323232323232325333045304800213232323232533304a304d00213253330483370e90001823800899191919299982619b87480000045288a50304a00232533304b3370e90000008991919192999829182a80109924c646eb8c148008dd718280008b1919bb0305400130543055001375860a600260a60046eb8c144004c12400854ccc12ccdc3a40040022a66609c60920042930b0b1824800982700098230008b1919198008008131129998268008a60103d87a8000132323232533304e3375e00e004266e952000330520014bd70099803003001982780198268011828801182780099ba548008cc12cc0ecc1140052f5c02c60960026607005a466ebcc0e8c110c0ecc110004044c0d8024c0d4038c0d004458dd7182300098230011bae30440013044002375a60840026084004608000260800046eb8c0f8004c0f8008dd6981e000981e001181d000981d0011bae3038001303800230360013036002375c606800260580022c606400260540022c606060626062605260406052002605e008004605e0060022940c0a0008dd6181400099bb0014374e66030016466e1cccc888c8cc88c94ccc0b4cdc3a4004002200426eb4c0c8c0ac00cc0ac008c94ccc0accdc3a4004002298103d87a8000132323300100100222533303100114c103d87a800013232323253330323371e014004266e95200033036375000297ae0133006006003375a60660066eb8c0c4008c0d4008c0cc004dd5981818148011814800a4000646600200200844a66605c0022980103d87a8000132323232533302f3371e010004266e95200033033374c00297ae0133006006003375660600066eb8c0b8008c0c8008c0c0004dd5980d9812180d981200080ba450048008c08803858dd59814000981400098138009813000981280098120009811800981100098108011bac301f001301f0023758603a002602a0066036002603600460320026022002464a66602066e1d20000011323232325333017301a00213232498c94ccc058cdc3a400000226464a666036603c0042649319299980c99b87480000044c8c94ccc078c0840084c926301100116301f0013017002153330193370e90010008991919191919299981118128010a4c2c6eb4c08c004c08c008dd6981080098108011bad301f001301700216301700116301c0013014003153330163370e90010008a99980c980a0018a4c2c2c602800460140062c60300026030004602c002601c0042c601c00244646600200200644a666028002297ae01323253330133005002133017002330040040011330040040013018002301600123012001230113012001232533300c3370e9000000899192999808980a0010a4c2c6eb8c048004c02800854ccc030cdc3a400400226464a66602260280042930b1bae3012001300a00216300a00100600500400314984d958c94ccc028cdc3a40000022a66601a60100082930b0a99980519b87480080044c8c8c8c94ccc044c0500084c92632375c60220086eb8c03c00c58dd6980900098090011919bb03011001301130120013758602000260100082a66601466e1d20040011533300d300800414985858c02000cc94ccc024cdc3a4000002264646464a66602060260042649319198008008011129998090008a4c26466006006602c004646464646eb8c054008dd718098009919bb0301700130173018001375860260046eb4c044004c05000458dd5980880098088011bad300f0013007004163007003375c0024600a6ea80048c00cdd5000ab9a5573aaae7955cfaba05742ae89", + "hash": "efeb87cb0bd19b259870a45609f4ddbd71281226ba58087de996d898" }, { "title": "ownership_registry_ref_token.ownership_registry_ref_token", @@ -82,8 +132,8 @@ } } ], - "compiledCode": "5907ab010000323232323232323232232223253330083232323232323232323232323253330153370e90000008991919191919191919191919299981099b8748000c08000854ccc09000c0044c94ccc0940044c8c94ccc090cdc3a40086046002264646464646464646464646464646464646464646464a66607a004002264a66607c002264a66607e00a006264a66608000226464a66607e66e1d2004303e001132323253330423370e900218208008991919299982299b8748000c1100084c8c8c8c94ccc130c13c0084c8c8c8c8c8c8c8c94ccc1454ccc1454ccc14401c401852808010a50100114a066e1cc008dd5981b9827009a400866e1cc004dd5981b182680a24008460046066002600200244a6660a200229000099b8048008cc008008c1500054ccc12ccdc3802a4000266ebcdd3001a60101a00014a066ebc028c8c8c8c8c8c8c8cdd2a4000660aa60ac00e660aa60ac00c660aa60ac00a660aa60ac008660aa60ac006660aa60ac004660aa60ac002660aa6ea0cdc000e2400460ae60ae00260ac00260aa00260a800260a600260a400260a2002609004a646600200200444a66609c002293099198018019829001191919191bae3051002375c609e0026466ec0c14c004c14cc150004dd618278011bad304d0013050001163756609a002609a0046eb4c12c004c10c00858c070010c120004c10000458c098c0fc010c114004c0f400458c08cc0f000cc108018010c108014c10000c008c1000085281bac3039002375860720026466ec0dd39999800813805819a4500374e666600204e00800c66464646464644660046600491010a526567697374727920280033003001330060014800922101290022337140040026002002444a66607a66e1c005200213300448810033700004903009980219980180199b8600200133706002900a19b803370600400290301119b8b0010023001001222533303a33710004900a0800899980180199b8300248050cdc1000a40280044444660460084a66607666ebcc078c0e40040104cdc39998119bab30223039001003002480085281bad303a001303a00230380013038002375c606c002606c002606a0026068002606600460620026062002605000a6002008464a66605466e1d200000113232323232323232323232323232323232323232533304130440021323232498c064024c060038c05c04458dd7182100098210011bae30400013040002375a607c002607c004607800260780046eb8c0e8004c0e8008dd6981c000981c001181b000981b0011bae3034001303400230320013032002375c606000260500042c6050002464a66605266e1d20000011323232325333030303300213232498c94ccc0bccdc3a400000226464a666068606e0042649319299981919b87480000044c8c94ccc0dcc0e80084c926300e0011630380013030002153330323370e90010008991919191919299981d981f0010a4c2c6eb4c0f0004c0f0008dd6981d000981d0011bad30380013030002163030001163035001302d0031533302f3370e90010008a99981918168018a4c2c2c605a004600e0062c60620026062004605e002604e0042c604e002464a66605066e1d200000113232533302d3030002149858dd7181700098130010a99981419b87480080044c8c94ccc0b4c0c000852616375c605c002604c0042c604c002605400260440022c6010604260146042002604e008004604e0060022a66604066e1d2002301f001132323300100100222533302600114a226464a66604aa66604a66e3cdd71804001007899b88375a601400490000a5113300400400114a060540046eb0c0a0004c010c8cc004004038894ccc09400452f5bded8c0264646464a66604c66e3d22100002100313302a337606ea4008dd3000998030030019bab3027003375c604a0046052004604e0022940c080014dd6181000211811800919198008008011129998110008a5eb804c8ccc888c8cc00400400c894ccc0a0004400c4c8ccc888cc0b4dd3998169ba90093302d37520066605a6ea00092f5c00026eb8c09c004dd6981400099801801981600118150009bae30210013756604400266006006604c0046048002460426044604400266ec0054dd399801806919b873330033756600460326004603200202e91100480088c07cc080004888c8cc88c94ccc07ccdc3a4004002200426eb4c090c07400cc074008c94ccc074cdc3a40040022980103d87a8000132323300100100222533302300114c103d87a800013232323253330243371e014004266e95200033028375000297ae0133006006003375a604a0066eb8c08c008c09c008c094004dd59811180d801180d800a4000646600200200844a6660400022980103d87a800013232323253330213371e010004266e95200033025374c00297ae0133006006003375660440066eb8c080008c090008c08800488c8cc00400400c894ccc07800452f5c026464a66603a600a00426604200466008008002266008008002604400460400026eb8c06c004c04c02852818098049bab3018001301800130170023758602a002602a00260280046eb0c048004c02800cc040004c040008c038004c018008526136563253330083370e90000008a99980598030018a4c2c2a66601066e1d20020011533300b300600314985858c018008dd7000918029baa001230033754002ae6955ceaab9e5573eae815d0aba21", - "hash": "0b3446bc6eea7ab5041e1f7470e87aba62382b7124dc97f63c483d0d" + "compiledCode": "5907af010000323232323232323232232223253330083333232323232323232323232323232323232323222232323232323232323232323232533302b3370e90000008991919191919299981899b8748000c0c000854ccc0d000c0044c94ccc0d40044c8c94ccc0d0cdc3a40086066002264646464646464646464646464646464646464a666094004002264a666096002264a66609800a006264a66609a00226464a66609866e1d2004304b0011323232533304f3370e900218270008991919299982919b8748000c1440084c8c8c8c94ccc164c1700084c8c8c8c8c94ccc16d4ccc16d4ccc16c010400c52808010a50100114a066e1cc100dd59825982c0082400866e1cc0fcdd59825182b808a4008a6660b066e1c015200013375e6e9800d30101a00014a066ebc028c8c8c8c8c8c8c8cdd2a4000660c460c600e660c460c600c660c460c600a660c460c6008660c460c6006660c460c6004660c460c6002660c46ea0cdc000e2400460c860c800260c600260c400260c200260c000260be00260bc00260aa044646600200200444a6660b600229309919801801982f801191919191bae305e002375c60b80026466ec0c180004c180c184004dd6182e0011bad305a001305d00116375660b400260b40046eb4c160004c14000858c0e4010c154004c13400458c0dcc130010c148004c12800458c0d0c12400cc13c018010c13c014c13400c008c1340085281bac30460023758608c00266ec0dd3999981500e80501424500374e666605403a00600a660626606291010a5265676973747279202800330360013303900148009221012900375a608e002608e004608a002608a0046eb8c10c004c10c004c108004c104004c100008c0f8004c0f8004c0d4008c078004c0e8004c0c800458c070c0c4c090c0c4004c0dc010008c0dc00c00454ccc0c0cdc3a4004605e002264646600200200444a66606c00229444c8c94ccc0d54ccc0d4cdc79bae30200020091337106eb4c078009200014a22660080080022940c0e8008dd6181c000980d191980080080411299981a8008a5eb7bdb1804c8c8c8c94ccc0d8cdc7a44100002100313303a337606ea4008dd3000998030030019bab3037003375c606a0046072004606e0022940c0c0008dd6181800099bb0011374e66038014466e1cccc078dd5980f9816180f9816000809a4410048008dd7181880098148050a5030290093756605c002605c002605a0046eb0c0ac004c0ac004c0a8008dd618140009810001981300098130011812000980e0009180398028009111198060021299980f19baf3009301c00100413370e66601c6eacc03cc07000400c009200214a0464a66603466e1d200000113232323232323232323232323232323232323232533303130340021323232498c088024c084038c08004458dd7181900098190011bae30300013030002375a605c002605c004605800260580046eb8c0a8004c0a8008dd698140009814001181300098130011bae3024001302400230220013022002375c604000260300042c60300024603a603c603c0024646600200200444a666038002297ae01323332223233001001003225333022001100313233322233027374e6604e6ea4024cc09cdd4801998139ba80024bd700009bae3021001375a604400266006006604c00460480026eb8c06c004dd5980e000998018019810001180f0009180d800980080091299980c0008a4000266e01200233002002301b001223371400400244646600200200644a666030002297ae0132325333017300500213301b00233004004001133004004001301c002301a0012223233223253330173370e9001000880109bad301c301500330150023253330153370e90010008a6103d87a8000132323300100100222533301b00114c103d87a8000132323232533301c3371e014004266e95200033020375000297ae0133006006003375a603a0066eb8c06c008c07c008c074004dd5980d18098011809800a4000646600200200844a6660300022980103d87a800013232323253330193371e010004266e9520003301d374c00297ae0133006006003375660340066eb8c060008c070008c0680048c054c0580048c94ccc040cdc3a4000002264646464a66602e6034004264649319299980b19b87480000044c8c94ccc06cc0780084c9263253330193370e900000089919299980f181080109924c60260022c603e002602e0042a66603266e1d2002001132323232323253330223025002149858dd6981180098118011bad30210013021002375a603e002602e0042c602e0022c603800260280062a66602c66e1d200200115333019301400314985858c050008c03000c58c060004c060008c058004c03800858c038004c0040048894ccc03ccdc3800a40042660089110033700004903009980219980180199b8600200133706002900a19b803370600400290301119b8b0010023001001222533300c33710004900a0800899980180199b8300248050cdc1000a4028464a66601466e1d200000113232533300f3012002149858dd7180800098040010a99980519b87480080044c8c94ccc03cc04800852616375c602000260100042c601000200800600429309b2b19299980419b874800000454ccc02cc01800c52616153330083370e90010008a99980598030018a4c2c2c600c0046eb80048c014dd5000918019baa0015734aae7555cf2ab9f5740ae855d11", + "hash": "8885b57b7687038c3ae1842fa491409ee27e8f63cc5822455b7b6ec9" } ], "definitions": { @@ -116,6 +166,40 @@ } ] }, + "Tuple$ByteArray_ByteArray": { + "title": "Tuple", + "dataType": "list", + "items": [ + { + "$ref": "#/definitions/ByteArray" + }, + { + "$ref": "#/definitions/ByteArray" + } + ] + }, + "aiken/dict/Dict$Int_ByteArray": { + "title": "Dict", + "description": "An opaque `Dict`. The type is opaque because the module maintains some\n invariant, namely: there's only one occurrence of a given key in the dictionary.\n\n Note that the `key` parameter is a phantom-type, and only present as a\n means of documentation. Keys can be any type, yet will need to comparable\n to use functions like `insert`.\n\n See for example:\n\n ```aiken\n pub type Value =\n Dict>\n ```", + "dataType": "map", + "keys": { + "$ref": "#/definitions/Int" + }, + "values": { + "$ref": "#/definitions/ByteArray" + } + }, + "aiken/dict/Dict$Int_Tuple$ByteArray_ByteArray": { + "title": "Dict", + "description": "An opaque `Dict`. The type is opaque because the module maintains some\n invariant, namely: there's only one occurrence of a given key in the dictionary.\n\n Note that the `key` parameter is a phantom-type, and only present as a\n means of documentation. Keys can be any type, yet will need to comparable\n to use functions like `insert`.\n\n See for example:\n\n ```aiken\n pub type Value =\n Dict>\n ```", + "dataType": "map", + "keys": { + "$ref": "#/definitions/Int" + }, + "values": { + "$ref": "#/definitions/Tuple$ByteArray_ByteArray" + } + }, "aiken/transaction/OutputReference": { "title": "OutputReference", "description": "An `OutputReference` is a unique reference to an output on-chain. The `output_index`\n corresponds to the position in the output list of the transaction (identified by its id)\n that produced that output", @@ -236,6 +320,52 @@ } ] }, + "aiken_content_ownership/types/ContentRegistryDatum": { + "title": "ContentRegistryDatum", + "anyOf": [ + { + "title": "ContentRegistryDatum", + "dataType": "constructor", + "index": 0, + "fields": [ + { + "title": "count", + "$ref": "#/definitions/Int" + }, + { + "title": "registry", + "$ref": "#/definitions/aiken~1dict~1Dict$Int_ByteArray" + } + ] + } + ] + }, + "aiken_content_ownership/types/ContentRegistryRedeemer": { + "title": "ContentRegistryRedeemer", + "anyOf": [ + { + "title": "CreateContent", + "dataType": "constructor", + "index": 0, + "fields": [ + { + "title": "content_hash", + "$ref": "#/definitions/ByteArray" + }, + { + "title": "owner", + "$ref": "#/definitions/Tuple$ByteArray_ByteArray" + } + ] + }, + { + "title": "StopContentRegistry", + "dataType": "constructor", + "index": 1, + "fields": [] + } + ] + }, "aiken_content_ownership/types/MintPolarity": { "title": "MintPolarity", "anyOf": [ @@ -342,6 +472,58 @@ "fields": [] } ] + }, + "aiken_content_ownership/types/OwnershipRegistryDatum": { + "title": "OwnershipRegistryDatum", + "anyOf": [ + { + "title": "OwnershipRegistryDatum", + "dataType": "constructor", + "index": 0, + "fields": [ + { + "title": "count", + "$ref": "#/definitions/Int" + }, + { + "title": "registry", + "$ref": "#/definitions/aiken~1dict~1Dict$Int_Tuple$ByteArray_ByteArray" + } + ] + } + ] + }, + "aiken_content_ownership/types/OwnershipRegistryRedeemer": { + "title": "OwnershipRegistryRedeemer", + "anyOf": [ + { + "title": "CreateOwnershipRecord", + "dataType": "constructor", + "index": 0, + "fields": [] + }, + { + "title": "TransferOwnership", + "dataType": "constructor", + "index": 1, + "fields": [ + { + "title": "new_owner_toen", + "$ref": "#/definitions/Tuple$ByteArray_ByteArray" + }, + { + "title": "content_number", + "$ref": "#/definitions/Int" + } + ] + }, + { + "title": "StopOwnershipRegistry", + "dataType": "constructor", + "index": 2, + "fields": [] + } + ] } } } \ No newline at end of file diff --git a/validators/tests/unit-tests/ownership_registry.ak b/validators/tests/unit-tests/ownership_registry.ak new file mode 100644 index 0000000..ac076d9 --- /dev/null +++ b/validators/tests/unit-tests/ownership_registry.ak @@ -0,0 +1,153 @@ +use aiken/dict.{Dict} +use aiken/int +use aiken/transaction.{ + Input, Output, ScriptContext, Spend, Transaction, placeholder, +} +use aiken/transaction/value.{AssetName, PolicyId, add, from_asset} +use aiken_content_ownership/common.{compare_output_reference} +use aiken_content_ownership/placeholder.{ + mock_content_registry_output, mock_oracle_datum, mock_oracle_output, + mock_ownership_registry_output, mock_policy_id, mock_policy_id_2, + mock_policy_id_3, mock_policy_id_4, mock_utxo_ref, +} +use aiken_content_ownership/types.{ + ContentRegistryDatum, CreateContent, CreateOwnershipRecord, + OwnershipRegistryDatum, StopContentRegistry, +} +use aiken_content_ownership/utils.{get_registry_token_name} +use aiken_content_ownership/validators/ownership_registry.{ + ownership_registry_logic, +} + +type TestCase { + has_input_from_content_registry: Bool, + is_content_registry_redeemer_correct: Bool, +} + +fn make_mock_tx_body( + record_count: Int, + content_registry: Dict, + ownership_registry: Dict, + content_hash: ByteArray, + owner: (PolicyId, AssetName), + test_case: TestCase, +) -> Transaction { + let content_registry_value = + from_asset(mock_policy_id_2(), get_registry_token_name(0), 1) + |> add(#"", #"", 2_000_000) + + let ownership_registry_value = + from_asset(mock_policy_id_3(), get_registry_token_name(0), 1) + |> add(#"", #"", 2_000_000) + let content_redeemer: Data = + if test_case.is_content_registry_redeemer_correct { + CreateContent { content_hash, owner } + } else { + StopContentRegistry + } + let ownership_redeemer: Data = CreateOwnershipRecord + let redeemers = + dict.new() + |> dict.insert( + Spend(mock_utxo_ref(2)), + ownership_redeemer, + compare_output_reference, + ) + |> dict.insert( + Spend(mock_utxo_ref(1)), + content_redeemer, + compare_output_reference, + ) + + Transaction { + ..placeholder(), + reference_inputs: [ + Input { + output_reference: mock_utxo_ref(0), + output: mock_oracle_output(mock_oracle_datum()), + }, + ], + inputs: [ + Input { + output_reference: mock_utxo_ref(1), + output: Output { + ..mock_content_registry_output( + 0, + ContentRegistryDatum { + count: record_count, + registry: content_registry, + }, + ), + value: content_registry_value, + }, + }, + Input { + output_reference: mock_utxo_ref(2), + output: Output { + ..mock_ownership_registry_output( + 0, + OwnershipRegistryDatum { + count: record_count, + registry: ownership_registry, + }, + ), + value: ownership_registry_value, + }, + }, + ], + outputs: [ + Output { + ..mock_content_registry_output( + 0, + ContentRegistryDatum { + count: record_count + 1, + registry: dict.insert( + content_registry, + record_count, + content_hash, + int.compare, + ), + }, + ), + value: content_registry_value, + }, + Output { + ..mock_ownership_registry_output( + 0, + OwnershipRegistryDatum { + count: record_count + 1, + registry: dict.insert( + ownership_registry, + record_count, + owner, + int.compare, + ), + }, + ), + value: ownership_registry_value, + }, + ], + redeemers: redeemers, + } +} + +test success_mint() { + let redeemer = CreateOwnershipRecord + let dat = OwnershipRegistryDatum { count: 0, registry: dict.new() } + let content_hash = "QmWBaeu6y1zEcKbsEqCuhuDHPL3W8pZouCPdafMCRCSUWk" + let owner = (mock_policy_id_4(), "my_token_name") + let tx = + make_mock_tx_body( + 0, + dict.new(), + dict.new(), + content_hash, + owner, + TestCase { + has_input_from_content_registry: True, + is_content_registry_redeemer_correct: True, + }, + ) + let ctx = ScriptContext { purpose: Spend(mock_utxo_ref(2)), transaction: tx } + ownership_registry_logic(mock_policy_id(), dat, redeemer, ctx) +}