diff --git a/Makefile b/Makefile index cf4e93b..2d6c7b1 100644 --- a/Makefile +++ b/Makefile @@ -39,4 +39,4 @@ ci: .PHONY: export export: - cabal run smart-handles -f optimized + cabal clean && cabal run smart-handles -f optimized diff --git a/README.md b/README.md index 2aa82cc..3dd0a3a 100644 --- a/README.md +++ b/README.md @@ -1,132 +1,172 @@ # Table of Contents -- [Smart Beacons](#smart-beacons) - - [Introduction](#introduction) - - [Documentation](#documentation) - - [What problems do Smart Beacons solve?](#what-problems-do-smart-beacons-solve) - - [Details](#details) - - [Basic Routing Script](#basic-routing-script) - - [Advanced Routing Script](#advanced-routing-script) - - [Getting Started](#getting-started) - - [Prerequisites](#prerequisites) - - [Building and Developing](#building-and-developing) - - [Using Routing Contract](#using-routing-contract) - - [Sending Swap Order](#sending-swap-order) - - [Routing Swap Order to Minswap](#routing-swap-order-to-minswap) - - [License](#license) +- [Smart Handles](#smart-handles) + - [Introduction](#introduction) + - [Documentation](#documentation) + - [What problems do Smart Beacons solve?](#what-problems-do-smart-beacons-solve) + - [Contract Logic](#contract-logic) + - [Getting Started](#getting-started) + - [Prerequisites](#prerequisites) + - [Official option](#official-option) + - [Preferred option](#preferred-option) + - [Building and developing](#building-and-developing) + - [Using Routing Contract](#using-routing-contract) + - [License](#license) -# Smart Beacons +# Smart Handles ## Introduction -Smart Beacons is a framework for routing transactions. It is essentially AdaHandles for Smart Contract addresses. +Smart Handles is an abstract Cardano contract generator for instantiating +validators that are meant to be carried out by incentivised agents to handle +the requests in a decentralized and trustless manner. -Through the use of Smart Beacons & router scripts, users will be able to interact with DApps without going through their front-end or building the smart contract transactions themselves. +One of the simplest use-cases can be an instance for swapping one specific token +to another without going through a DEX UI directly. This instance will have its +unique address, which can be complemented with AdaHandles (e.g. `@ada-to-min`) +and therefore any wallet that supports Smart Handles configurations can send +some $ADA directly to this address to be swapped for $MIN. -For example, swapping tokens on a dex will be as simple as sending funds to `@ada-to-min` (or whatever token pair you want). It doesn’t need to be a swap, this can be done for any arbitrary smart contract interaction. For instance, sending funds to `@offer-spacebudz` (which resolves to a router smart contract for SpaceBudz collection offers) could create a collection offer for SpaceBudz. Each smart beacon requires a custom routing smart contract. +This is not limited to swaps of course. For instance, sending funds to +`@offer-spacebudz` (which resolves to a router smart contract for SpaceBudz +collection offers) could create a collection offer for SpaceBudz. -Here we demonstrates the use of Smart Beacons for swapping $ADA for $MIN through Minswap exchange by implementing the routing script for `@ada-to-min`. +The example here uses Smart Handles for swapping any token pairs through Minswap +exchange. -This project is funded by the Cardano Treasury in [Catalyst Fund 10](https://projectcatalyst.io/funds/10/f10-osde-open-source-dev-ecosystem/anastasia-labs-smart-beacons-router-nfts). +This project is funded by the Cardano Treasury +in [Catalyst Fund 10](https://projectcatalyst.io/funds/10/f10-osde-open-source-dev-ecosystem/anastasia-labs-smart-beacons-router-nfts). ## Documentation ### What problems do Smart Beacons solve? -Right now, most interaction with smart contract protocols is done through centralized front-end services where the transactions are built and submitted through centralized backend infrastructure. In addition to the negative impact this has on decentralization, it also hampers adoption due to the restrictions it imposes. For instance, users with mobile wallets have severely limited options when it comes to interacting with DApps. Also, regular users will be unable to interact with most DApps if the DApp front-ends were to become unavailable for any reason or if the backend was down. - -There are a few attempts to address this problem, such as [DApp Schemas](https://cardano.ideascale.com/c/idea/64468) or [Smart Contract Blueprints](https://developers.cardano.org/docs/governance/cardano-improvement-proposals/cip-0057/); however, all of these solutions rely on offchain infrastructure to specify how to interpret a DApp's datums, redeemers, and other onchain data in order to build transactions. Smart Beacons differ from these other approaches in that it is a fully onchain solution that does not rely on offchain infrastructure. - -A Smart Beacon is an NFT that lives at a UTxO locked in a spending validator; the datum of the UTxO specifies how to interact with the spending validator that locks it. The datum is in essence an onchain Schema describing how to interact with the associated DApp (or at-least with the spending validator that locks the associated UTxO). - -### Details - -#### Basic Routing Script - -A user sends $ADA to the routing contract with a datum containing his address. This helps convey ownership of the UTxO and destination for receiving $MIN in exchange. Keep in mind that a single UTxO corresponds to a single swap order. - -```haskell -data SmartHandleDatum = SmartHandleDatum - { owner :: Address - } -``` - -That's all that needs to be done by the user. Post which the routing agents take responsibility of sending this UTxO from the contract address to Minswap's swap address. They do so by initiating a spending transaction (with a `SmartHandleRedeemer`) and sending the output UTxO (with the correct `MinswapRequestDatum` as below). They can take a 1 ADA routing fee (from the owner) upon building a successful transaction. - -```haskell -data MinswapRequestDatum = MinswapRequestDatum - { sender :: Address => Owner - , receiver :: Address => Owner - , receiverDatumHash :: Maybe DatumHash => Constr 1 [] - , step :: OrderType => Constr 0 [Constr 0 [policyId, tokenName], minAmount] - , batcherFee :: Integer => 2_000_000 - , outputAda :: Integer => 2_000_000 - } - -data SmartHandleRedeemer - = Swap - { ownIndex :: Integer - , routerIndex :: Integer - } - | Reclaim -``` - -The `Swap` tells the contract which output UTxO (outputs[ routerIndex ]) is created from the spending of provided script input UTxO (inputs[ ownIndex ]) to facilitate validations. The owner can choose to reclaim his locked funds back (if they haven't been spent yet) by initiating a spending transaction with `Reclaim` redeemer. - -```haskell -psmartHandleValidator :: Term s (PAddress :--> PSmartHandleDatum :--> PSmartHandleRedeemer :--> PScriptContext :--> PUnit) +Right now, most interaction with smart contract protocols is done through +centralized front-end services where the transactions are built and submitted +through centralized backend infrastructure. In addition to the negative impact +this has on decentralization, it also hampers adoption due to the restrictions +it imposes. For instance, users with mobile wallets have severely limited +options when it comes to interacting with DApps. Also, regular users will be +unable to interact with most DApps if the DApp front-ends were to become +unavailable for any reason or if the backend was down. + +There are a few attempts to address this problem, such as +[DApp Schemas](https://cardano.ideascale.com/c/idea/64468) or +[Smart Contract Blueprints](https://developers.cardano.org/docs/governance/cardano-improvement-proposals/cip-0057/); however, +all of these solutions rely on off-chain infrastructure to specify how to +interpret a DApp's datums, redeemers, and other on-chain data in order to build +transactions. Smart Beacons differ from these other approaches in that it is a +fully onchain solution that does not rely on offchain infrastructure. + +UTxOs locked at a Smart Handles instance can carry datums that determine how a +routing agent should reproduce them at their specified destination addresses +(or route addresses). + +In case of simple datums however, the interaction logic is hard-coded in the +instance itself, and their corresponding off-chain agents should provide routers +with all they need to handle requests. + +## Contract Logic + +Smart Handles framework offers two datums: +```hs +data PSmartHandleDatum (s :: S) + = PSimple (Term s (PDataRecord '["owner" ':= PAddress])) + | PAdvanced + ( Term + s + ( PDataRecord + '[ "mOwner" ':= PMaybeData PAddress + , "routerFee" ':= PInteger + , "reclaimRouterFee" ':= PInteger + , "routeRequiredMint" ':= PRequiredMint + , "reclaimRequiredMint" ':= PRequiredMint + , "extraInfo" ':= PData + ] + ) + ) ``` - -The routing contract (`psmartHandleValidator`, compiled script at `./compiled/smartHandleSimple.json`) mentioned here, is the standalone validator (takes Minswap's swap address as a parameter) which gets the job done. However, it has a limitation. It only allows one script input to be spent in a single transaction, severely limiting the routing throughput per transaction. - -Allowing more than one script input to be spent within it, could result in a critical vulnerability in the form of [Double Satisfaction Attack](https://plutus.readthedocs.io/en/latest/reference/writing-scripts/common-weaknesses/double-satisfaction.html?highlight=double#unique-outputs). This contract serves as a starting point for understanding and working with Smart Beacons. For those looking to carry out routing of multiple script inputs in a single transaction, the next section provides the required details. - -#### Advanced Routing Script - -Here a single transaction can fulfill multiple routings, whether all of them are correct or not, is validated only once at the tx level using the [Zero ADA Withdrawal Trick](https://github.com/cardano-foundation/CIPs/pull/418#issuecomment-1366605115) from a Staking validator. - -```haskell -smartHandleStakeValidatorW :: Term s (PAddress :--> PStakeValidator) +- `Simple`, which only carries an owner address +- `Advanced`, which allows for a more involved routing/reclaim scenarios: + - `mOwner` is an optional owner (if this is set to `Nothing` it makes the UTxO + un-reclaimable) + - `routerFee` specifies how much an agent must be compensated for routing a + request + - `reclaimRouterFee` is similar to `routerFee` for invoking the advanced + reclaim endpoint (this helps with balancing of the incentive structure) + - `routeRequiredMint` is a value (isomorphic with + `Maybe (PolicyID, TokenName)`) that specifies whether a route output must + append the same quantity of mints/burns present in the transaction + - `reclaimRequiredMint` is similar to `routeRequiredMint`, but for the + advanced reclaim endpoint + - `extraInfo` is an arbitrary `PData` provided for instances + +On top of that, each instance can also support a "single" variant and a "batch" +variant: Single will be a spending script that only supports a single +route/reclaim per transaction. Batch, on the other hand, is a staking script for +handling multiple requests in single transactions. + +Single variants will have 3 redeemers: routing, simple reclaims, and advanced +reclaims: +```hs +data PSmartHandleRedeemer (s :: S) + = PRoute (Term s (PDataRecord '["ownIndex" ':= PInteger, "routerIndex" ':= PInteger])) + | PReclaim (Term s (PDataRecord '[])) + | PAdvancedReclaim (Term s (PDataRecord '["ownIndex" ':= PInteger, "routerIndex" ':= PInteger])) ``` +Simple reclaim only applies to simple datums, and the only requirement is +imposes on withdrawals is the signature of the owner. Advanced reclaim passes +the spending UTxO to instance's underlying validator, and therefore has a +redeemer similar to the routing endpoint. -The Staking validator (`smartHandleStakeValidatorW`, compiled script at `./compiled/smartHandleStake.json`) takes care of validating all script inputs against their corresponding swap outputs in a given tx. It takes Minswap's swap address as a parameter. - -This Staking validator's credential is used as a parameter to a Spending Validator (`smartHandleRouteValidatorW`, compiled script at `./compiled/smartHandleRouter.json`), the advanced routing contract which locks the user's UTxOs. Spending validator ensures that the Staking validator is executed in the tx thereby confirming that no script input avoids validation. A successful validation from both spending and staking validator is essentail for spending UTxOs. - -```haskell -smartHandleRouteValidatorW :: Term s (PStakingCredential :--> PValidator) +Batch variants' scripts (spending and staking) will have 2 redeemers each: +```hs +-- for the staking script +data PRouterRedeemer (s :: S) + = PRouterRedeemer + ( Term + s + ( PDataRecord + '[ "inputIdxs" ':= PBuiltinList (PAsData PInteger) + , "outputIdxs" ':= PBuiltinList (PAsData PInteger) + ] + ) + ) + +-- for the batch spend script +data PSmartRedeemer (s :: S) + = PRouteSmart (Term s (PDataRecord '[])) + | PReclaimSmart (Term s (PDataRecord '[])) ``` +The underlying logic of an instance is shared between the two variants, and +therefore utilizing either one will be very similar. -For carrying out this tx level validation, the Staking Validator requires a redeemer containing one-to-one correlation between script input UTxOs (user UTxOs) and swap output UTxOs (sent to Minswap by routing agents). This is provided via ordered lists of input/output indices of inputs/ouputs present in the Script Context. +You may have noticed that both redeemers are using the [UTxO indexer pattern](https://github.com/Anastasia-Labs/design-patterns/blob/main/utxo-indexers/UTXO-INDEXERS.md) +for a more optimized performance. -```haskell -data RouterRedeemer = RouterRedeemer - { inputIdxs :: [Integer] - , outputIdxs :: [Integer] - } -``` - -For e.g. -``` -Inputs : [swapOrderA, swapOrderC, randomInput3, swapOrderB, randomInput1, randomInput2] // random inputs are not routing script inputs -Outputs : [swapOutputA, swapOutputB, swapOutputC, randomOuput1, randomOutput2, randomOutput3] -InputIdxs : [0, 1, 3] -OutputIdxs : [0, 2, 1] -``` +## Off-Chain Tools -While its easy to understand and declare indices of outputs (the order in which outputs appear in the tx builder), we cannot control the order of inputs as seen by the script. As inputs are sorted lexicographically based on their output reference, first by Tx#Id and then by Tx#Idx. +There are 2 packages available for working with smart handles instances: +- [`smart-handles-offchain`](https://github.com/Anastasia-Labs/smart-handles-offchain) + offers config interfaces to build transactions for all possible endpoints +- [`smart-handles-agent`](https://github.com/Anastasia-Labs/smart-handles-agent) + provides a CLI application generator function that allows instances to have + curated user-friendly Node applications for submitting, routing and reclaiming + requests -Note: Staking validator need not be invoked if user wishes to cancel his swap order and reclaim funds. ## Getting Started ### Prerequisites -Before you begin, ensure you have [Nix](https://nixos.org) installed on your system. Nix is used for package management and to provide a consistent development environment. If you don't have Nix installed, you can do so by running the following command: +Before you begin, ensure you have [Nix](https://nixos.org) installed on your +system. Nix is used for package management and to provide a consistent +development environment. If you don't have Nix installed, you can do so by +running the following command: #### Official option @@ -152,16 +192,23 @@ experimental-features = nix-command flakes ca-derivations allow-import-from-derivation = true ``` -Optionally, to improve build speed, it is possible to set up binary caches by adding additional configuration entries: +Optionally, to improve build speed, it is possible to set up binary caches by +adding additional configuration entries: ```yaml substituters = https://cache.nixos.org https://cache.iog.io https://cache.zw3rk.com trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk= ``` -To facilitate seamlessly moving between directories and associated Nix development shells we use [direnv](https://direnv.net) and [nix-direnv](https://github.com/nix-community/nix-direnv): +To facilitate seamlessly moving between directories and associated Nix +development shells we use [direnv](https://direnv.net) and +[nix-direnv](https://github.com/nix-community/nix-direnv): -Your shell and editors should pick up on the `.envrc` files in different directories and prepare the environment accordingly. Use `direnv allow` to enable the direnv environment and `direnv reload` to reload it when necessary. Otherwise, the `.envrc` file contains a proper Nix target which will be used with the `nix develop --accept-flake-config` command. +Your shell and editors should pick up on the `.envrc` files in different +directories and prepare the environment accordingly. Use `direnv allow` to +enable the direnv environment and `direnv reload` to reload it when necessary. +Otherwise, the `.envrc` file contains a proper Nix target which will be used +with the `nix develop --accept-flake-config` command. To install both using `nixpkgs`: @@ -197,7 +244,15 @@ Or make shell ``` -Please be patient when building nix development environment for the first time, as it may take a very long time. Subsequent builds should be faster. Additionally, when you run `nix run .#help` you'll get a list of scripts you can run, the Github CI (nix flake check) is setup in a way where it checks the project builds successfully, haskell format is done correctly, and commit message follows conventional commits. Before pushing you should run `cabal run` , `nix run .#haskellFormat` (automatically formats all haskell files, including cabal), if you want to commit a correct format message you can run `cz commit` +Please be patient when building nix development environment for the first time, +as it may take a very long time. Subsequent builds should be faster. +Additionally, when you run `nix run .#help` you'll get a list of scripts you can +run, the Github CI (nix flake check) is setup in a way where it checks the +project builds successfully, haskell format is done correctly, and commit +message follows conventional commits. Before pushing you should +run `cabal run`, `nix run .#haskellFormat` (automatically formats all haskell +files, including cabal), if you want to commit a correct format message you can +run `cz commit`. Build: @@ -221,51 +276,13 @@ make export ### Using Routing Contract -This section explains how to interact with Basic Routing Contract using [Lucid](https://lucid.spacebudz.io/) based offchain scripts. Please install [Deno](https://deno.land/ "A modern runtime for Javascript & Typescript") before proceeding further. - -#### Setup - -Move into the offchain scripts directory: - -```sh -cd offchain/ -``` - -Please configure your preprod wallet details and Blockfrost API Key in `offchain/config.ts` before executing scripts. - -#### Sending Swap Order - -Inorder to create a swap order at the routing contract, a UTxO needs to be sent to it containing $ADA to be exchanged for $MIN along with a datum of type SmartHandleDatum. - -```hs -data SmartHandleDatum = SmartHandleDatum - { owner :: Address - } -``` - -Run: - -```sh -deno run --allow-all create-swap-order.ts -``` - -Note: Script execution may take couple of minutes, as it waits for tx confirmation. Upon successful execution, the script will output a detailed message with a tx hash. - -#### Routing Swap Order to Minswap - -A routing agent spends a UTxO at routing contract address (the one locked above) by passing a `Swap` redeemer and sending the output UTxO with the correct `MinswapRequestDatum` to Minswap's swap address. - -Run: - -```sh -deno run --allow-all route-swap-order.ts -``` - -Note: Script execution may take couple of minutes, as it waits for tx confirmation. Upon successful execution, the script will output a detailed message with a tx hash. +Head over to the [off-chain SDK of smart handles](https://github.com/Anastasia-Labs/smart-handles-offchain) to +learn how to define your instance's off-chain, or look +through [an example with Minswap V1](https://github.com/Anastasia-Labs/smart-handles-offchain/tree/main/example). ## License -© 2023 Anastasia Labs. +© 2024 Anastasia Labs. All code is licensed under MIT License. See [LICENSE](./LICENSE) file -for details. \ No newline at end of file +for details. diff --git a/compiled/smartHandleRouter.json b/compiled/smartHandleRouter.json index 05f0489..7308e28 100644 --- a/compiled/smartHandleRouter.json +++ b/compiled/smartHandleRouter.json @@ -1,5 +1,5 @@ { - "cborHex": "59036159035e01000022223232325333573466e1d200200213232325333573466e1d200200216153335734664646460044660040040024600446600400400244a666aae7c0045280a999ab9a3375e6ae8400400c528898011aba200135742002646eb0d5d0991aba235744646ae88c8d5d1191aba23235744646ae88d5d1000800800800800800991aab9e37540020026ae84c8d55cf1baa001007149858d55cf0011aab9d0013754646ae84c8d55cf1baa0010013235742646aae78dd5000800991919190052999ab9a3370e9000001099191919191919191924ca666aae7c00452616357440046ae84004d5d10032999ab9a3370e900000109919191919191919191919191924ca666aae7c004526163574400ca666ae68cdc3a4000004264646464646464932999aab9f001149858d5d10032999ab9a3370e900000109919191919191924ca666aae7c004526163574400ca666ae68cdc3a400000426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400454ccd5cd19b87480080084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008b1aab9e00235573a0026ea8004d5d08008a999ab9a3370e900100109919191919191919191924ca666aae7c00452616357440066eb4004d5d08009aba2003375a0026ae84004d5d10019bad001357420022c6aae78008d55ce8009baa001357420022a666ae68cdc3a4004004264932999aab9f00114985858d55cf0011aab9d00137540026ae84004d5d10032999ab9a3370e9000001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba100115333573466e1d2002002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022c6aae78008d55ce8009baa001357420022c6aae78008d55ce8009baa001357420022c6aae78008d55ce8009baa006133333222332323002233002002001230022330020020012253335573e002244a0022a666ae68cdd79aab9d357420020082600a6ae840044c008d5d10008009191118010019bad35573c00200e646eacd5d0991aba23235744646ae88c8d5d1191aba235744002002002002002646aae78dd50008009aba13235573c6ea80040109261635573c0046aae74004dd500101", + "cborHex": "59076a59076701000022223232325333573466e1d200200213232325333573466e1d20000021323232325333573466e1d200200214a02664646460044660040040024600446600400400244a666aae7c0045280a999ab9a3375e6ae8400400c528898011aba200135742002646eb0d5d0991aba235744646ae88c8d5d1191aba23235744646ae88d5d1000800800800800800991aab9e37540020026ae84c8d55cf1baa00100b35573c0046aae74004dd51aba13235573c6ea8004004d5d08008999991991119919180111980100100091801119801001000912999aab9f001122500115333573466ebcd55ce9aba10010041300535742002260046ae880040048c888c00800cdd69aab9e00100100a3237566ae84c8d5d1191aba23235744646ae88c8d5d11aba20010010010010013235573c6ea8004004d5d0991aab9e375400200e4930b1aab9e00235573a0026ea8c8c8c8c80294ccd5cd19b87480000084c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d20000021323232323232323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d20000021323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008a999ab9a3370e9001001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba10011635573c0046aae74004dd50009aba100115333573466e1d20020021323232323232323232324994ccd55cf8008a4c2c6ae8800cdd68009aba1001357440066eb4004d5d08009aba2003375a0026ae8400458d55cf0011aab9d00137540026ae8400454ccd5cd19b87480080084c92653335573e0022930b0b1aab9e00235573a0026ea8004d5d08009aba20065333573466e1d2000002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022a666ae68cdc3a400400426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400458d55cf0011aab9d00137540026ae8400458d55cf0011aab9d00137540026ae8400454ccd5cd19b87480080084c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba2002357420026ae880194ccd5cd19b87480000084c8c8c94ccd5cd299919ab9a00114a266e1c005200013370e002901c09919192999ab9a337126e340052040132324994ccd55cf8008a4c2c6ae8800c58dd70009aba1001357440082c6e34004dd70009aba100115333573466e1d20020021324994ccd55cf8008a4c2c2c6aae78008d55ce8009baa001357420026ae880194ccd5cd19b87480000084c8c8c94ccd5cd299919ab9a00114a266e1c005200013370e002901c09919192999ab9a337126e340052040132324994ccd55cf8008a4c2c6ae8800c58dd70009aba1001357440082c6e34004dd70009aba100115333573466e1d20020021324994ccd55cf8008a4c2c2c6aae78008d55ce8009baa001357420026ae8800cdd68009aba1001357440066eb4004d5d08009aba20065333573466e1d20000021323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d20000021323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d2000002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022a666ae68cdc3a400400426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400458d55cf0011aab9d00137540026ae8400454ccd5cd19b87480080084c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba2003375a0026ae84004d5d10019bad001357420026ae8800cdd68009aba10011635573c0046aae74004dd50009aba100115333573466e1d20020021324994ccd55cf8008a4c2c2c6aae78008d55ce8009baa001357420026ae880194ccd5cd19b87480000084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008a999ab9a3370e9001001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba10011635573c0046aae74004dd50009aba10011635573c0046aae74004dd50009aba100115333573466e1d20020021324994ccd55cf8008a4c2c2c6aae78008d55ce8009baa001357420022c6aae78008d55ce8009baa00613333233222332323002233002002001230022330020020012253335573e002244a0022a666ae68cdd79aab9d357420020082600a6ae840044c008d5d10008009191118010019bad35573c00200200e646eacd5d0991aba23235744646ae88c8d5d1191aba235744002002002002002646aae78dd50008009aba13235573c6ea80040109261635573c0046aae74004dd500101", "description": "Smart Handle Router", "type": "PlutusScriptV2" } \ No newline at end of file diff --git a/compiled/smartHandleSimple.json b/compiled/smartHandleSimple.json index 63d3c34..c4391bc 100644 --- a/compiled/smartHandleSimple.json +++ b/compiled/smartHandleSimple.json @@ -1,5 +1,5 @@ { - "cborHex": "590d0c590d0901000022223232325333573466e1d2000002133322232323232323232325333573466e1d2002002132323232325333573466e1d20000021613232533357346644666ae68008005281991199ab9a0020014a06644666ae68008005281991199ab9a0020014a066ebcd5d08041aba100733223375e6e9cc8d55cf1baa001002374e646aae78dd50008009aba100201933223375e6e98008dd30009bab35742002646646446646460044660040040024600446600400400244a666aae7c00452f5bded8c026466600a6aae78d5d0801119aba0337606aae74d5d0801800801080098011aba2001001233300237560024644460040066e9800448940048c94ccd5cd1aba3001122500112230020033322332323002233002002001230022330020020012253335573e002297adef6c6013233300535573c6ae840088cd5d019bb035573a6ae8400c0040084004c008d5d100080092999ab9a3375e0026ea1200012250011223002003001001332233323222333323232300223300200200123002233002002001322323223300100300222253335573e002266ae8000c0084c8c8c94ccd5cd19baf002001133574066ec0008cc024d55cf0031aab9e00333300822002005357440082a666ae68cdc81bae002375c002266ae80018cccc0208800400cd5d1002002899aba0003333300822001006005357440086aae74008d55ce8021aba10012253335573e004200226666006440026ae84008d5d100100080080191001001000911ba63300337560046eac00488ccc888cccc8c8c8c0088cc0080080048c0088cc008008004c88c8c88cc00400c0088894ccd55cf800899aba000300213232325333573466ebc0080044cd5d019bb00023300935573c00c6aae7800cccc02088008014d5d10020a999ab9a337206eb8008dd7000899aba00063333008220010033574400800a266ae8000ccccc02088004018014d5d10021aab9d00235573a0086ae84004894ccd55cf801080089999801910009aba10023574400400200200644004004002446ea0cdc01bad002375a0020040020040026eacd5d09aba2006325333573466e1c005200014bd6f7b630099199119aba03376000400297adef6c603752910100374c002664466ae80cdd8001000a5eb7bdb180dd4a450037500026466e0520000014820225e8cdc3999199191801119801001000918011198010010009112999aab9f001100213232325333573466e1d2000002133006005357440082a666ae68cdc78039bae3574200226600c66e0001520023574400826600c00a6ae88010d55cf0011aab9d0013754646ae84c8d55cf1baa0010013235742646aae78dd5000800991aba135744646aae78dd50008009aba100148000dd71aba100337586ae840352002333222323232323232323233223335734004002940cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223375e6e9cc8d55cf1baa001002374e646aae78dd50008009aba100700b33223375e6e9cc8d55cf1baa001002374e646aae78dd50008009aba100600b3232325333573466e1d200000214a02944d55cf0011aab9d00137546ae84014cdd79aba10013574201066ebcd5d09aba2001357426ae88020cdc39bad357420069040497a0099b87375a6ae84d5d1001a410125e802646aae78dd50009aba10013235573c6ea8004d5d08011aba2001357440026ae88004d5d1000991aab9e37540026464646400ca666ae68cdc3a4000004264646464646464646464646464646464646464646464646464646464646464932999aab9f001149858d5d10019bad001357420026ae8800cdd68009aba10013574400ca666ae68cdc3a4000004264646464646464646464932999aab9f001149858d5d10019bad001357420026ae880194ccd5cd19b87480000084c8c8c94ccd5cd299919ab9a00114a266e1c005200013370e002901c09919192999ab9a337126e340052040132324994ccd55cf8008a4c2c6ae8800c58dd70009aba1001357440082c6e34004dd70009aba10011635573c0046aae74004dd50009aba10011635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a400000426464a666ae68cdc39b8d375c00490200991924ca666aae7c00452616357440062c6eb8004d5d08008a999ab9a3370e900100109924ca666aae7c004526161635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a4000004264646464646464646464646464932999aab9f001149858d5d10032999ab9a3370e900000109919191919191924ca666aae7c004526163574400ca666ae68cdc3a4000004264646464646464932999aab9f001149858d5d10032999ab9a3370e9000001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba100115333573466e1d2002002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022c6aae78008d55ce8009baa001357420022a666ae68cdc3a4004004264646464646464646464932999aab9f001149858d5d10019bad001357420026ae8800cdd68009aba1001357440066eb4004d5d08008b1aab9e00235573a0026ea8004d5d08008a999ab9a3370e900100109924ca666aae7c004526161635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a400000426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400454ccd5cd19b87480080084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008b1aab9e00235573a0026ea8004d5d08008b1aab9e00235573a0026ea8004d5d08009aba20065333573466e1d20000021323232323232323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d20000021323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008a999ab9a3370e9001001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba10011635573c0046aae74004dd50009aba100115333573466e1d20020021323232323232323232324994ccd55cf8008a4c2c6ae8800cdd68009aba1001357440066eb4004d5d08009aba2003375a0026ae8400458d55cf0011aab9d00137540026ae8400454ccd5cd19b87480080084c92653335573e0022930b0b1aab9e00235573a0026ea8004d5d08009aba20065333573466e1d2000002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022a666ae68cdc3a400400426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400458d55cf0011aab9d00137540026ae8400458d55cf0011aab9d00137540026ae8400458d55cf0011aab9d0013754004646aae78dd50008011aba100f357426ae8803ccc88c8c8c94ccd5cd19b87480000085854ccd5cd19b87480100084d5d08008991980090008b1991991119919180111980100100091801119801001000912999aab9f001122500115333573466ebcd55ce9aba10010041300535742002260046ae880040048c888c00800cd55cf0009ba9001375c6ae84004010d55cf0011aab9d00137540046ae84d5d10009bab357426ae88d5d10058a4c2c6ae88004c8d55cf1baa00133225333573466e20009200016133225333573466e1c009200013574200226646646444a666ae68cdc38012400026ae840044cc00ccdc0801240046ae880048cc0080080048c8894ccd5cd19b87002480004d5d080089980199b8100248008d5d100091980100100080099b8100248008d5d10008010008079bac357420146aae78008d55ce8009baa3235742646aae78dd50008009aba10013235573c6ea8004d5d09aba20013235573c6ea8004cc894ccd5cd19b8800248000584cc894ccd5cd19b87002480004d5d0800899919919112999ab9a3370e004900009aba10011330033370200490011aba2001233002002001232225333573466e1c009200013574200226600666e0400920023574400246600400400200266e040092002357440020040020166eb0d5d08030b1aab9e00235573a0026ea8d5d09aba20043235744646ae88c8d5d1191aba2357440020020020026ae88004d5d11aba20013235573c6ea8004d5d0800991aab9e3754002004646aae78dd50008049bad357420026eb4d5d09aba200100413232325333573466e1d2000002153335734664646460044660040040024600446600400400244a666aae7c0045280a999ab9a3375e6ae8400400c528898011aba200135742002646eb0d5d0991aba2357446ae88c8d5d1191aba23235744646ae88d5d1000800800800800991aab9e37540020026ae84c8d55cf1baa00100714985858d55cf0011aab9d0013754646ae84c8d55cf1baa00100135742646aae78dd50008031aab9e00235573a0026ea8009", + "cborHex": "592bff592bfc01000022223232325333573466e1d200200213232325333573466e1d200000215333573464646464a666ae68cdc3a400400429404cc8c8c8c0088cc0080080048c0088cc008008004894ccd55cf8008a5015333573466ebcd5d08008018a5113002357440026ae84004c8dd61aba13235744646ae88c8d5d1191aba23235744646ae88c8d5d11aba20010010010010010010013235573c6ea8004004d5d0991aab9e37540020166aae78008d55ce8009baa35742646aae78dd50008009aba100114985858d55cf0011aab9d001375400c2a666ae68cdc3a40080042646464a666ae68cdc3a4004004264646464a666ae68cdc3a40000042666666644444446464646464646464a666ae68cdc3a400400426464646464a666ae68cdc3a40000042c26464a666ae68cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a503375e6ae84020d5d0803999119baf374e646aae78dd50008011ba73235573c6ea8004004d5d080100a99b873323323230022330020020012300223300200200122253335573e00220042646464a666ae68cdc3a400000426600c00a6ae8801054ccd5cd19b8f007375c6ae840044cc018cdc0002a40046ae880104cc018014d5d10021aab9e00235573a0026ea8c8d5d0991aab9e3754002002646ae84c8d55cf1baa00100132357426ae88c8d55cf1baa0010013574200290001bae357420066eb0d5d080724004646464a666ae68cdc3a400000426644666ae6800800528199999980c99ba548000cd5d01aba10014bd702410112f46eacd5d09aba2009498cc88c8c8c94ccd5cd19b87480000085854ccd5cd19b87480100084d5d08008991980090008b1991991119919180111980100100091801119801001000912999aab9f001122500115333573466ebcd55ce9aba10010041300535742002260046ae880040048c888c00800cd55cf0009ba9001375c6ae84004010d55cf0011aab9d00137540046ae84d5d10021bab357426ae88d5d100700a0099999112999ab9a3370e00290000999119baf374c0046e9800400800c4cc88cdd79ba6002374c002004646646446646460044660040040024600446600400400244a666aae7c00452f5bded8c026466600a6aae78d5d0801119aba0337606aae74d5d0801800801080098011aba2001001233300237560024644460040066e9800448940048c94ccd5cd1aba3001122500112230020033322332323002233002002001230022330020020012253335573e002297adef6c6013233300535573c6ae840088cd5d019bb035573a6ae8400c0040084004c008d5d100080092999ab9a3375e0026ea120001225001122300200300100133322233323222333323232300223300200200123002233002002001322323223300100300222253335573e002266ae8000c0084c8c8c94ccd5cd19baf002001133574066ec0008cc024d55cf0031aab9e00333300822002005357440082a666ae68cdc81bae002375c002266ae80018cccc0208800400cd5d1002002899aba0003333300822001006005357440086aae74008d55ce8021aba10012253335573e004200226666006440026ae84008d5d100100080080191001001000911ba63300337560046eac00488ccc8c888cccc8c8c8c0088cc0080080048c0088cc008008004c88c8c88cc00400c0088894ccd55cf800899aba000300213232325333573466ebc0080044cd5d019bb00023300935573c00c6aae7800cccc02088008014d5d10020a999ab9a337206eb8008dd7000899aba00063333008220010033574400800a266ae8000ccccc02088004018014d5d10021aab9d00235573a0086ae84004894ccd55cf801080089999801910009aba10023574400400200200644004004002446ea0cc00cdd68011bad001005002001002001700006666444a666ae68cdc3800a4000297adef6c6013322332233574066ec00080052f5bded8c06ea4008dd30008019991199119aba03376000400297adef6c6037520046ea000400800522010048810000137566ae84d5d10049bab357420086466e0520000014820225e84c8c8c8c8c8cc88ccd5cd001000a50333333301e3574200c0026eacd5d09aba200e357426ae88008cc88c8c8c94ccd5cd19b87480000085854ccd5cd19b87480100084d5d08008991980090008b1991991119919180111980100100091801119801001000912999aab9f001122500115333573466ebcd55ce9aba10010041300535742002260046ae880040048c888c00800cd55cf0009ba9001375c6ae84004010d55cf0011aab9d00137540046ae84d5d10049bab357426ae88d5d100980c80c1999112999ab9a3370e00290000999119baf374c0046e9800400800c4cc88cdd79ba6002374c002004646646446646460044660040040024600446600400400244a666aae7c00452f5bded8c026466600a6aae78d5d0801119aba0337606aae74d5d0801800801080098011aba2001001233300237560024644460040066e9800448940048c94ccd5cd1aba3001122500112230020033322332323002233002002001230022330020020012253335573e002297adef6c6013233300535573c6ae840088cd5d019bb035573a6ae8400c0040084004c008d5d100080092999ab9a3375e0026ea120001225001122300200300100133322233323222333323232300223300200200123002233002002001322323223300100300222253335573e002266ae8000c0084c8c8c94ccd5cd19baf002001133574066ec0008cc024d55cf0031aab9e00333300822002005357440082a666ae68cdc81bae002375c002266ae80018cccc0208800400cd5d1002002899aba0003333300822001006005357440086aae74008d55ce8021aba10012253335573e004200226666006440026ae84008d5d100100080080191001001000911ba63300337560046eac00488ccc8c888cccc8c8c8c0088cc0080080048c0088cc008008004c88c8c88cc00400c0088894ccd55cf800899aba000300213232325333573466ebc0080044cd5d019bb00023300935573c00c6aae7800cccc02088008014d5d10020a999ab9a337206eb8008dd7000899aba00063333008220010033574400800a266ae8000ccccc02088004018014d5d10021aab9d00235573a0086ae84004894ccd55cf801080089999801910009aba10023574400400200200644004004002446ea0cc00cdd68011bad001005002001002001700006666444a666ae68cdc3800a4000297adef6c6013322332233574066ec00080052f5bded8c06ea4008dd30008019991199119aba03376000400297adef6c6037520046ea0004008005221004881000013232325333573466e1d2002002137566ae84d5d10088992999ab9a332233232323002233002002001230022330020020012253335573e002294454cc88ccd5cd0010008a50300335742002260046ae880048c00cdd59aab9e0010012332233232323002233002002001230022330020020012253335573e002294454cc88ccd5cd0010008a50300335742002260046ae880048c00cdd69aab9e001001233710900000080080088008b1919919119919180111980100100091801119801001000912999aab9f00114bd6f7b6300991998029aab9e35742004466ae80cdd81aab9d35742006002004200260046ae880040048ccc008dd58009191118010019ba60011225001232533357346ae8c0044894004488c00800ccc88cc8c8c0088cc0080080048c0088cc008008004894ccd55cf8008a5eb7bdb1804c8ccc014d55cf1aba1002233574066ec0d55ce9aba100300100210013002357440020024a666ae68cdd78009ba8480004894004488c00800c004004ccc888ccc8c888cccc8c8c8c0088cc0080080048c0088cc008008004c88c8c88cc00400c0088894ccd55cf800899aba000300213232325333573466ebc0080044cd5d019bb00023300935573c00c6aae7800cccc02088008014d5d10020a999ab9a337206eb8008dd7000899aba00063333008220010033574400800a266ae8000ccccc02088004018014d5d10021aab9d00235573a0086ae84004894ccd55cf801080089999801910009aba10023574400400200200644004004002446e98cc00cdd58011bab0012233323222333323232300223300200200123002233002002001322323223300100300222253335573e002266ae8000c0084c8c8c94ccd5cd19baf002001133574066ec0008cc024d55cf0031aab9e00333300822002005357440082a666ae68cdc81bae002375c002266ae80018cccc0208800400cd5d1002002899aba0003333300822001006005357440086aae74008d55ce8021aba10012253335573e004200226666006440026ae84008d5d100100080080191001001000911ba833003375a0046eb4004014008004008005c01999112999ab9a3370e00290000a5eb7bdb1804cc88cc88cd5d019bb00020014bd6f7b6301ba9002374c0020066644664466ae80cdd8001000a5eb7bdb180dd48011ba8001002001375c6ae84004dd71aba1357440026646464646446660020080060046eb4d55cf0019bae35573a0046eb8d55ce801192999aab9f0011613253335573e00226ae8400858d5d10009bab35573c00264a666aae7c004584c94ccd55cf80089aba100216357440026ae88c94ccd55cf8008a5eb7bdb1804cd5d01aba1001357440026eacd5d080b9112999ab9a33223335734004002940cdc79bae3574200800666e3cdd71aba13574400800420022c6eacd5d09aba201135573c0046aae74004dd52999ab9a01913574200626ae84008dd59aba100932337029000000800a999ab9a0181375a6ae840104dd69aba1003357440026ae88004d5d10009aba200135573c0046aae74004dd500a0a4c2c6ae88004c8d55cf1baa00133225333573466e20009200016133225333573466e1c009200013574200226646646444a666ae68cdc38012400026ae840044cc00ccdc0801240046ae880048cc0080080048c8894ccd5cd19b87002480004d5d080089980199b8100248008d5d100091980100100080099b8100248008d5d10008010008081bac357420166aae78008d55ce8009baa3235742646aae78dd50008009aba10013235573c6ea8004d5d09aba20013235573c6ea8004cc894ccd5cd19b8800248000584cc894ccd5cd19b87002480004d5d0800899919919112999ab9a3370e004900009aba10011330033370200490011aba2001233002002001232225333573466e1c009200013574200226600666e0400920023574400246600400400200266e040092002357440020040020186eb0d5d08038b1aab9e00235573a0026ea8d5d09aba20053235744646ae88d5d10008009aba2001357446ae88004d5d11aba20013235573c6ea8004d5d0800991aab9e37540020024444444646464a666ae68cdc3a40000042a666ae680144c8c8c8c8c8c8c8c8c8c8cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223375e6e9cc8d55cf1baa001002374e646aae78dd50008009aba100735742016664466ebcdd3991aab9e37540020046e9cc8d55cf1baa0010013574200c6ae8402ccdd79aba10053574201066ebcd5d08009aba100a3375e6ae84d5d10009aba10093375e6ae84d5d10011aba13574401066e1cdd69aba1003482024bd004cdc39bad357426ae8800d208092f4013235573c6ea8004d5d0800991aab9e37540026ae84008d5d10009aba2001357440026ae88004c8d55cf1baa0013232323200d5333573466e1d20000021323232323232323232323232323232323232323232323232323232323232324994ccd55cf8008a4c2c6ae8800cdd68009aba1001357440066eb4004d5d08009aba20065333573466e1d20000021323232323232323232324994ccd55cf8008a4c2c6ae8800cdd68009aba10013574400ca666ae68cdc3a40000042646464a666ae694cc8cd5cd0008a513370e0029000099b87001480e04c8c8c94ccd5cd19b89371a00290200991924ca666aae7c00452616357440062c6eb8004d5d08009aba200416371a0026eb8004d5d08008b1aab9e00235573a0026ea8004d5d08008b1aab9e00235573a0026ea8004d5d08009aba20065333573466e1d2000002132325333573466e1cdc69bae002481004c8c92653335573e0022930b1aba200316375c0026ae8400454ccd5cd19b87480080084c92653335573e0022930b0b1aab9e00235573a0026ea8004d5d08009aba20065333573466e1d20000021323232323232323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d20000021323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008a999ab9a3370e9001001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba10011635573c0046aae74004dd50009aba100115333573466e1d20020021323232323232323232324994ccd55cf8008a4c2c6ae8800cdd68009aba1001357440066eb4004d5d08009aba2003375a0026ae8400458d55cf0011aab9d00137540026ae8400454ccd5cd19b87480080084c92653335573e0022930b0b1aab9e00235573a0026ea8004d5d08009aba20065333573466e1d2000002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022a666ae68cdc3a400400426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400458d55cf0011aab9d00137540026ae8400458d55cf0011aab9d00137540026ae84004d5d10032999ab9a3370e900000109919191919191919191919191924ca666aae7c004526163574400ca666ae68cdc3a4000004264646464646464932999aab9f001149858d5d10032999ab9a3370e900000109919191919191924ca666aae7c004526163574400ca666ae68cdc3a400000426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400454ccd5cd19b87480080084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008b1aab9e00235573a0026ea8004d5d08008a999ab9a3370e900100109919191919191919191924ca666aae7c00452616357440066eb4004d5d08009aba2003375a0026ae84004d5d10019bad001357420022c6aae78008d55ce8009baa001357420022a666ae68cdc3a4004004264932999aab9f00114985858d55cf0011aab9d00137540026ae84004d5d10032999ab9a3370e9000001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba100115333573466e1d2002002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022c6aae78008d55ce8009baa001357420022c6aae78008d55ce8009baa001357420022c6aae78008d55ce8009baa009357440026ae88004c8d55cf1baa0010071323232325333573466e1d200200214a02664646460044660040040024600446600400400244a666aae7c0045280a999ab9a3375e6ae8400400c528898011aba200135742002646eb0d5d0991aba23235744646ae88c8d5d1191aba23235744646ae88d5d1000800800800800800800991aab9e37540020026ae84c8d55cf1baa00100835573c0046aae74004dd51aba13235573c6ea8004004d5d08008a5035573c0046aae74004dd50039aba100100d375a6ae84020dd69aba13574401094002c58d55cf0011aab9d00137546ae84008d5d10008b1aab9e00235573a0026ea80184c8c8c8ccccccc8888888c8c8c8c8c8c8c8c94ccd5cd19b87480080084c8c8c8c8c94ccd5cd19b8748000008584c8c94ccd5cd1991199ab9a0020014a06644666ae68008005281991199ab9a0020014a066ebcd5d08041aba100733223375e6e9cc8d55cf1baa001002374e646aae78dd50008009aba10020153370e66466464600446600400400246004466004004002444a666aae7c00440084c8c8c94ccd5cd19b87480000084cc018014d5d10020a999ab9a3371e00e6eb8d5d080089980319b8000548008d5d10020998030029aba200435573c0046aae74004dd5191aba13235573c6ea8004004c8d5d0991aab9e3754002002646ae84d5d1191aab9e37540020026ae840052000375c6ae8400cdd61aba100e48008c8c8c94ccd5cd19b87480000084cc88ccd5cd001000a5033333330193374a900019aba03574200297ae04820225e8dd59aba1357440129319911919192999ab9a3370e90000010b0a999ab9a3370e900200109aba10011323300120011633233222332323002233002002001230022330020020012253335573e002244a0022a666ae68cdd79aab9d357420020082600a6ae840044c008d5d10008009191118010019aab9e00137520026eb8d5d08008021aab9e00235573a0026ea8008d5d09aba200437566ae84d5d11aba200e0140133332225333573466e1c0052000133223375e6e98008dd30008010018999119baf374c0046e98004008c8cc8c88cc8c8c0088cc0080080048c0088cc008008004894ccd55cf8008a5eb7bdb1804c8ccc014d55cf1aba1002233574066ec0d55ce9aba1003001002100130023574400200246660046eac0048c888c00800cdd300089128009192999ab9a35746002244a002244600400666446646460044660040040024600446600400400244a666aae7c00452f5bded8c026466600a6aae78d5d0801119aba0337606aae74d5d0801800801080098011aba200100125333573466ebc004dd424000244a0022446004006002002666444666464446666464646004466004004002460044660040040026446464466002006004444a666aae7c0044cd5d000180109919192999ab9a3375e004002266ae80cdd8001198049aab9e00635573c0066660104400400a6ae8801054ccd5cd19b90375c0046eb80044cd5d00031999804110008019aba2004005133574000666660104400200c00a6ae88010d55ce8011aab9d0043574200244a666aae7c00840044cccc00c88004d5d08011aba20020010010032200200200122374c660066eac008dd5800911999191119999191918011198010010009180111980100100099119191198008018011112999aab9f00113357400060042646464a666ae68cdd7801000899aba033760004660126aae78018d55cf001999804110010029aba200415333573466e40dd70011bae001133574000c6666010440020066ae880100144cd5d00019999804110008030029aba200435573a0046aae74010d5d0800912999aab9f00210011333300322001357420046ae8800800400400c8800800800488dd4198019bad002375a00200a004002004002e0000cccc8894ccd5cd19b870014800052f5bded8c026644664466ae80cdd8001000a5eb7bdb180dd48011ba60010033322332233574066ec00080052f5bded8c06ea4008dd4000801000a4410048810000137566ae84d5d10049bab357420086466e0520000014820225e84c8c8c8c8c8cc88ccd5cd001000a50333333301e3574200c0026eacd5d09aba200e357426ae88008cc88c8c8c94ccd5cd19b87480000085854ccd5cd19b87480100084d5d08008991980090008b1991991119919180111980100100091801119801001000912999aab9f001122500115333573466ebcd55ce9aba10010041300535742002260046ae880040048c888c00800cd55cf0009ba9001375c6ae84004010d55cf0011aab9d00137540046ae84d5d10049bab357426ae88d5d100980c80c1999112999ab9a3370e00290000999119baf374c0046e9800400800c4cc88cdd79ba6002374c002004646646446646460044660040040024600446600400400244a666aae7c00452f5bded8c026466600a6aae78d5d0801119aba0337606aae74d5d0801800801080098011aba2001001233300237560024644460040066e9800448940048c94ccd5cd1aba3001122500112230020033322332323002233002002001230022330020020012253335573e002297adef6c6013233300535573c6ae840088cd5d019bb035573a6ae8400c0040084004c008d5d100080092999ab9a3375e0026ea120001225001122300200300100133322233323222333323232300223300200200123002233002002001322323223300100300222253335573e002266ae8000c0084c8c8c94ccd5cd19baf002001133574066ec0008cc024d55cf0031aab9e00333300822002005357440082a666ae68cdc81bae002375c002266ae80018cccc0208800400cd5d1002002899aba0003333300822001006005357440086aae74008d55ce8021aba10012253335573e004200226666006440026ae84008d5d100100080080191001001000911ba63300337560046eac00488ccc8c888cccc8c8c8c0088cc0080080048c0088cc008008004c88c8c88cc00400c0088894ccd55cf800899aba000300213232325333573466ebc0080044cd5d019bb00023300935573c00c6aae7800cccc02088008014d5d10020a999ab9a337206eb8008dd7000899aba00063333008220010033574400800a266ae8000ccccc02088004018014d5d10021aab9d00235573a0086ae84004894ccd55cf801080089999801910009aba10023574400400200200644004004002446ea0cc00cdd68011bad001005002001002001700006666444a666ae68cdc3800a4000297adef6c6013322332233574066ec00080052f5bded8c06ea4008dd30008019991199119aba03376000400297adef6c6037520046ea0004008005221004881000013232325333573466e1d2002002137566ae84d5d10088992999ab9a332233232323002233002002001230022330020020012253335573e002294454cc88ccd5cd0010008a50300335742002260046ae880048c00cdd59aab9e0010012332233232323002233002002001230022330020020012253335573e002294454cc88ccd5cd0010008a50300335742002260046ae880048c00cdd69aab9e001001233710900000080080088008b1919919119919180111980100100091801119801001000912999aab9f00114bd6f7b6300991998029aab9e35742004466ae80cdd81aab9d35742006002004200260046ae880040048ccc008dd58009191118010019ba60011225001232533357346ae8c0044894004488c00800ccc88cc8c8c0088cc0080080048c0088cc008008004894ccd55cf8008a5eb7bdb1804c8ccc014d55cf1aba1002233574066ec0d55ce9aba100300100210013002357440020024a666ae68cdd78009ba8480004894004488c00800c004004ccc888ccc8c888cccc8c8c8c0088cc0080080048c0088cc008008004c88c8c88cc00400c0088894ccd55cf800899aba000300213232325333573466ebc0080044cd5d019bb00023300935573c00c6aae7800cccc02088008014d5d10020a999ab9a337206eb8008dd7000899aba00063333008220010033574400800a266ae8000ccccc02088004018014d5d10021aab9d00235573a0086ae84004894ccd55cf801080089999801910009aba10023574400400200200644004004002446e98cc00cdd58011bab0012233323222333323232300223300200200123002233002002001322323223300100300222253335573e002266ae8000c0084c8c8c94ccd5cd19baf002001133574066ec0008cc024d55cf0031aab9e00333300822002005357440082a666ae68cdc81bae002375c002266ae80018cccc0208800400cd5d1002002899aba0003333300822001006005357440086aae74008d55ce8021aba10012253335573e004200226666006440026ae84008d5d100100080080191001001000911ba833003375a0046eb4004014008004008005c01999112999ab9a3370e00290000a5eb7bdb1804cc88cc88cd5d019bb00020014bd6f7b6301ba9002374c0020066644664466ae80cdd8001000a5eb7bdb180dd48011ba8001002001375c6ae84004dd71aba1357440026646464646446660020080060046eb4d55cf0019bae35573a0046eb8d55ce801192999aab9f0011613253335573e00226ae8400858d5d10009bab35573c00264a666aae7c004584c94ccd55cf80089aba100216357440026ae88c94ccd55cf8008a5eb7bdb1804cd5d01aba1001357440026eacd5d080b9112999ab9a33223335734004002940cdc79bae3574200800666e3cdd71aba13574400800420022c6eacd5d09aba201135573c0046aae74004dd52999ab9a01913574200626ae84008dd59aba100932337029000000800a999ab9a0181375a6ae840104dd69aba1003357440026ae88004d5d10009aba200135573c0046aae74004dd500a0a4c2c6ae88004c8d55cf1baa00133225333573466e20009200016133225333573466e1c009200013574200226646646444a666ae68cdc38012400026ae840044cc00ccdc0801240046ae880048cc0080080048c8894ccd5cd19b87002480004d5d080089980199b8100248008d5d100091980100100080099b8100248008d5d10008010008081bac357420166aae78008d55ce8009baa3235742646aae78dd50008009aba10013235573c6ea8004d5d09aba20013235573c6ea8004cc894ccd5cd19b8800248000584cc894ccd5cd19b87002480004d5d0800899919919112999ab9a3370e004900009aba10011330033370200490011aba2001233002002001232225333573466e1c009200013574200226600666e0400920023574400246600400400200266e040092002357440020040020186eb0d5d08038b1aab9e00235573a0026ea8d5d09aba20053235744646ae88d5d10008009aba2001357446ae88004d5d11aba20013235573c6ea8004d5d0800991aab9e37540020024444444646464a666ae68cdc3a40000042a666ae680144c8c8c8c8c8c8c8c8c8c8cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223375e6e9cc8d55cf1baa001002374e646aae78dd50008009aba100735742016664466ebcdd3991aab9e37540020046e9cc8d55cf1baa0010013574200c6ae8402ccdd79aba10053574201066ebcd5d08009aba100a3375e6ae84d5d10009aba10093375e6ae84d5d10011aba13574401066e1cdd69aba1003482024bd004cdc39bad357426ae8800d208092f4013235573c6ea8004d5d0800991aab9e37540026ae84008d5d10009aba2001357440026ae88004c8d55cf1baa0013232323200d5333573466e1d20000021323232323232323232323232323232323232323232323232323232323232324994ccd55cf8008a4c2c6ae8800cdd68009aba1001357440066eb4004d5d08009aba20065333573466e1d20000021323232323232323232324994ccd55cf8008a4c2c6ae8800cdd68009aba10013574400ca666ae68cdc3a40000042646464a666ae694cc8cd5cd0008a513370e0029000099b87001480e04c8c8c94ccd5cd19b89371a00290200991924ca666aae7c00452616357440062c6eb8004d5d08009aba200416371a0026eb8004d5d08008b1aab9e00235573a0026ea8004d5d08008b1aab9e00235573a0026ea8004d5d08009aba20065333573466e1d2000002132325333573466e1cdc69bae002481004c8c92653335573e0022930b1aba200316375c0026ae8400454ccd5cd19b87480080084c92653335573e0022930b0b1aab9e00235573a0026ea8004d5d08009aba20065333573466e1d20000021323232323232323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d20000021323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008a999ab9a3370e9001001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba10011635573c0046aae74004dd50009aba100115333573466e1d20020021323232323232323232324994ccd55cf8008a4c2c6ae8800cdd68009aba1001357440066eb4004d5d08009aba2003375a0026ae8400458d55cf0011aab9d00137540026ae8400454ccd5cd19b87480080084c92653335573e0022930b0b1aab9e00235573a0026ea8004d5d08009aba20065333573466e1d2000002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022a666ae68cdc3a400400426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400458d55cf0011aab9d00137540026ae8400458d55cf0011aab9d00137540026ae84004d5d10032999ab9a3370e900000109919191919191919191919191924ca666aae7c004526163574400ca666ae68cdc3a4000004264646464646464932999aab9f001149858d5d10032999ab9a3370e900000109919191919191924ca666aae7c004526163574400ca666ae68cdc3a400000426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400454ccd5cd19b87480080084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008b1aab9e00235573a0026ea8004d5d08008a999ab9a3370e900100109919191919191919191924ca666aae7c00452616357440066eb4004d5d08009aba2003375a0026ae84004d5d10019bad001357420022c6aae78008d55ce8009baa001357420022a666ae68cdc3a4004004264932999aab9f00114985858d55cf0011aab9d00137540026ae84004d5d10032999ab9a3370e9000001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba100115333573466e1d2002002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022c6aae78008d55ce8009baa001357420022c6aae78008d55ce8009baa001357420022c6aae78008d55ce8009baa009357440026ae88004c8d55cf1baa0010071323232325333573466e1d200200214a02664646460044660040040024600446600400400244a666aae7c0045280a999ab9a3375e6ae8400400c528898011aba200135742002646eb0d5d0991aba23235744646ae88c8d5d1191aba23235744646ae88d5d1000800800800800800800991aab9e37540020026ae84c8d55cf1baa00100835573c0046aae74004dd51aba13235573c6ea8004004d5d08008a5035573c0046aae74004dd50038050049bad357420086eb4d5d09aba20044a200e6aae78008d55ce8009baa00635573c0046aae74004dd50011", "description": "Smart Handle", "type": "PlutusScriptV2" } \ No newline at end of file diff --git a/compiled/smartHandleStake.json b/compiled/smartHandleStake.json index 4a9fd67..a69472e 100644 --- a/compiled/smartHandleStake.json +++ b/compiled/smartHandleStake.json @@ -1,5 +1,5 @@ { - "cborHex": "59131f59131c010000222323232323232325333573466e1ccccc8c8c8c0088cc0080080048c0088cc00800800488894ccd55cf8010a999ab9a3574600220062c2a666aae7c004584ccc010ccc01400cd5d08011aba1001357440046ae88004888cdc000199191919192999ab9a33223335734004002940cc88ccd5cd001000a5033223375e6e9cc8d55cf1baa001002374e646aae78dd50008009aba100301233223375e6e98008dd30009bab35742004646646446646460044660040040024600446600400400244a666aae7c00452f5bded8c026466600a6aae78d5d0801119aba0337606aae74d5d0801800801080098011aba2001001233300237560024644460040066e9800448940048c94ccd5cd1aba3001122500112230020033322332323002233002002001230022330020020012253335573e002297adef6c6013233300535573c6ae840088cd5d019bb035573a6ae8400c0040084004c008d5d100080092999ab9a3375e0026ea1200012250011223002003001001332233323222333323232300223300200200123002233002002001322323223300100300222253335573e002266ae8000c0084c8c8c94ccd5cd19baf002001133574066ec0008cc024d55cf0031aab9e00333300822002005357440082a666ae68cdc81bae002375c002266ae80018cccc0208800400cd5d1002002899aba0003333300822001006005357440086aae74008d55ce8021aba10012253335573e004200226666006440026ae84008d5d100100080080191001001000911ba63300337560046eac00488ccc888cccc8c8c8c0088cc0080080048c0088cc008008004c88c8c88cc00400c0088894ccd55cf800899aba000300213232325333573466ebc0080044cd5d019bb00023300935573c00c6aae7800cccc02088008014d5d10020a999ab9a337206eb8008dd7000899aba00063333008220010033574400800a266ae8000ccccc02088004018014d5d10021aab9d00235573a0086ae84004894ccd55cf801080089999801910009aba10023574400400200200644004004002446ea0cdc01bad002375a0020040020040026eacd5d0802192999ab9a3370e00290000a5eb7bdb1804c8cc88cd5d019bb00020014bd6f7b6301ba948900374c002664466ae80cdd8001000a5eb7bdb180dd4a450037500026466e0520000014820225e8ccc888c8c8c8c8c8c8c8c8cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223335734004002940cc88cdd79ba73235573c6ea8004008dd3991aab9e37540020026ae8401c02ccc88cdd79ba73235573c6ea8004008dd3991aab9e37540020026ae8401802cc8c8c94ccd5cd19b87480000085280a5135573c0046aae74004dd51aba10053375e6ae84004d5d080419baf357426ae88004d5d09aba20083370e6eb4d5d0801a410125e80266e1cdd69aba1357440069040497a00991aab9e37540026ae84004c8d55cf1baa001357420046ae88004d5d10009aba200135744002646aae78dd5000991919190032999ab9a3370e900000109919191919191919191919191919191919191919191919191919191919191924ca666aae7c00452616357440066eb4004d5d08009aba2003375a0026ae84004d5d10032999ab9a3370e900000109919191919191919191924ca666aae7c00452616357440066eb4004d5d08009aba20065333573466e1d2000002132323253335734a66466ae6800452899b87001480004cdc3800a40702646464a666ae68cdc49b8d001481004c8c92653335573e0022930b1aba200316375c0026ae84004d5d10020b1b8d001375c0026ae8400458d55cf0011aab9d00137540026ae8400458d55cf0011aab9d00137540026ae84004d5d10032999ab9a3370e9000001099192999ab9a3370e6e34dd70012408026464932999aab9f001149858d5d10018b1bae001357420022a666ae68cdc3a4004004264932999aab9f00114985858d55cf0011aab9d00137540026ae84004d5d10032999ab9a3370e900000109919191919191919191919191924ca666aae7c004526163574400ca666ae68cdc3a4000004264646464646464932999aab9f001149858d5d10032999ab9a3370e900000109919191919191924ca666aae7c004526163574400ca666ae68cdc3a400000426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400454ccd5cd19b87480080084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008b1aab9e00235573a0026ea8004d5d08008a999ab9a3370e900100109919191919191919191924ca666aae7c00452616357440066eb4004d5d08009aba2003375a0026ae84004d5d10019bad001357420022c6aae78008d55ce8009baa001357420022a666ae68cdc3a4004004264932999aab9f00114985858d55cf0011aab9d00137540026ae84004d5d10032999ab9a3370e9000001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba100115333573466e1d2002002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022c6aae78008d55ce8009baa001357420022c6aae78008d55ce8009baa001357420026ae880194ccd5cd19b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d20000021323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d2000002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022a666ae68cdc3a400400426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400458d55cf0011aab9d00137540026ae8400454ccd5cd19b87480080084c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba2003375a0026ae84004d5d10019bad001357420026ae8800cdd68009aba10011635573c0046aae74004dd50009aba100115333573466e1d20020021324994ccd55cf8008a4c2c2c6aae78008d55ce8009baa001357420026ae880194ccd5cd19b87480000084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008a999ab9a3370e9001001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba10011635573c0046aae74004dd50009aba10011635573c0046aae74004dd50009aba10011635573c0046aae74004dd5001191aab9e37540020046ae84004d5d09aba200133223232325333573466e1d20000021615333573466e1d20040021357420022646600240022c664664446646460044660040040024600446600400400244a666aae7c004489400454ccd5cd19baf35573a6ae840040104c014d5d0800898011aba200100123222300200335573c0026ea4004dd71aba100100435573c0046aae74004dd50011aba1357440046eacd5d09aba235744016290010b191aab9e3754002646464646644646464a666ae68cdc3a40000042c2a666ae68cdc3a400800426ae840044c8cc004800458cc8cc888cc8c8c0088cc0080080048c0088cc008008004894ccd55cf80089128008a999ab9a3375e6aae74d5d0800802098029aba100113002357440020024644460040066aae78004dd48009bae357420020086aae78008d55ce8009baa002357426ae8801cdd59aba1357446ae880394ccd5cd19b87480000084c8c8c8c8c8c8c8c8c92653335573e0022930b1aba2002357420026ae880194ccd5cd19b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d20000021323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d2000002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022a666ae68cdc3a400400426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400458d55cf0011aab9d00137540026ae8400454ccd5cd19b87480080084c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba2003375a0026ae84004d5d10019bad001357420026ae8800cdd68009aba10011635573c0046aae74004dd50009aba100115333573466e1d20020021324994ccd55cf8008a4c2c2c6aae78008d55ce8009baa001357420026ae880194ccd5cd19b87480000084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008a999ab9a3370e9001001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba10011635573c0046aae74004dd50009aba10011635573c0046aae74004dd50009aba10011635573c0046aae74004dd519911919192999ab9a3370e90000010b0a999ab9a3370e900200109aba10011323300120011633233222332323002233002002001230022330020020012253335573e002244a0022a666ae68cdd79aab9d357420020082600a6ae840044c008d5d10008009191118010019aab9e00137520026eb8d5d08008021aab9e00235573a0026ea8008d5d09aba200337566ae84d5d11aba200a35744002646aae78dd50008019aba20013235573c6ea800400920003332323230022330020020012300223300200200122253335573e002297ae015333573466e20cdc300119b8248010cc894ccd5cd19b87001480005200213332323002233002002001230022330020020012225333573466e1c00520021002132533357346466e1ccdc2800a400890000010800899b82003001330033370400400466e0c005200400200148010dd69aba10013370c66e00008cc894ccd5cd19b87001480005200213332323002233002002001230022330020020012225333573466e1c00520021002132533357346466e1ccdc2800a400890000010800899b82003001330033370400400466e0c005200400200148010dd69aba100133704900219912999ab9a3370e00290000a40042666464600446600400400246004466004004002444a666ae68cdc3800a40042004264a666ae68c8cdc399b8500148011200000210011337040060026600666e08008008cdc1800a400800400290021bad35742002266ae80c010dd69aba100133003337000046644a666ae68cdc3800a40002900109999191801119801001000918011198010010009112999ab9a3370e002900108010992999ab9a323370e66e1400520044800000840044cdc10018009980199b82002002337060029002001000a40086eb4d5d08009aba200116232357426ae88c8d55cf1baa00100133225333573466e20009200016133225333573466e1c009200013574200226646646444a666ae68cdc38012400026ae840044cc00ccdc0801240046ae880048cc0080080048c8894ccd5cd19b87002480004d5d080089980199b8100248008d5d100091980100100080099b8100248008d5d1000801000800801a40006eb0d5d0803999919191801119801001000918011198010010009112999aab9f00114bd700a999ab9a3371066e18008cdc1240086644a666ae68cdc3800a40002900109999191801119801001000918011198010010009112999ab9a3370e002900108010992999ab9a323370e66e1400520044800000840044cdc10018009980199b82002002337060029002001000a40086eb4d5d080099b86337000046644a666ae68cdc3800a40002900109999191801119801001000918011198010010009112999ab9a3370e002900108010992999ab9a323370e66e1400520044800000840044cdc10018009980199b82002002337060029002001000a40086eb4d5d080099b8248010cc894ccd5cd19b87001480005200213332323002233002002001230022330020020012225333573466e1c00520021002132533357346466e1ccdc2800a400890000010800899b82003001330033370400400466e0c005200400200148010dd69aba1001133574060086eb4d5d08009980199b8000233225333573466e1c00520001480084ccc8c8c0088cc0080080048c0088cc0080080048894ccd5cd19b870014800840084c94ccd5cd1919b873370a0029002240000042002266e0800c004cc00ccdc100100119b83001480100080052004375a6ae84004d5d10008b119912999ab9a3371000490000b099912999ab9a3370e004900009aba1001133233232225333573466e1c009200013574200226600666e0400920023574400246600400400246444a666ae68cdc38012400026ae840044cc00ccdc0801240046ae880048cc008008004004cdc0801240046ae88004008004004009200037586ae84d5d10039999191801119801001000918011198010010009112999aab9f001100213232325333573466e1d20020021330063370000a90011aba2004133006005357440086aae78008d55ce8009baa3235742646aae78dd5000800991aba13235573c6ea8004004c8d5d09aba23235573c6ea8004004d5d0800a40000042930b1bac357420066eb0d5d0801991aba2357446ae88d5d11aba2001357440026ae88d5d1000991aab9e37540026ae84004c8d55cf1baa0010023235573c6ea80040081", + "cborHex": "59381159380e01000022232323232325333573466e1d2004002132323232325333573466e1ccccc8c8c8c0088cc0080080048c0088cc00800800488894ccd55cf8010a999ab9a3574600220062c2a666aae7c004584ccc010ccc01400cd5d08011aba1001357440046ae88004888cdc0001991919192999ab9a3232325333573466e1d20000021533357346466e1cd55ce9baa00148008d55cf00489991199ab9a0020014a06644666ae6800800528199999991111111919192999ab9a3370e90000010a999ab9a00513232323232323232323233223335734004002940cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223335734004002940cc88cdd79ba73235573c6ea8004008dd3991aab9e37540020026ae8401cd5d0805999119baf374e646aae78dd50008011ba73235573c6ea8004004d5d08031aba100b3375e6ae84014d5d080419baf357420026ae84028cdd79aba1357440026ae84024cdd79aba1357440046ae84d5d100419b87375a6ae8400d208092f4013370e6eb4d5d09aba2003482024bd004c8d55cf1baa00135742002646aae78dd50009aba1002357440026ae88004d5d10009aba20013235573c6ea8004c8c8c8c80354ccd5cd19b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba2003375a0026ae84004d5d10019bad001357420026ae880194ccd5cd19b87480000084c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba2003375a0026ae84004d5d10032999ab9a3370e900000109919192999ab9a53323357340022944cdc3800a4000266e1c005203813232325333573466e24dc6800a408026464932999aab9f001149858d5d10018b1bae001357420026ae8801058dc68009bae001357420022c6aae78008d55ce8009baa001357420022c6aae78008d55ce8009baa001357420026ae880194ccd5cd19b87480000084c8c94ccd5cd19b87371a6eb80092040132324994ccd55cf8008a4c2c6ae8800c58dd70009aba100115333573466e1d20020021324994ccd55cf8008a4c2c2c6aae78008d55ce8009baa001357420026ae880194ccd5cd19b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d20000021323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d2000002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022a666ae68cdc3a400400426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400458d55cf0011aab9d00137540026ae8400454ccd5cd19b87480080084c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba2003375a0026ae84004d5d10019bad001357420026ae8800cdd68009aba10011635573c0046aae74004dd50009aba100115333573466e1d20020021324994ccd55cf8008a4c2c2c6aae78008d55ce8009baa001357420026ae880194ccd5cd19b87480000084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008a999ab9a3370e9001001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba10011635573c0046aae74004dd50009aba10011635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a4000004264646464646464646464646464932999aab9f001149858d5d10032999ab9a3370e900000109919191919191924ca666aae7c004526163574400ca666ae68cdc3a4000004264646464646464932999aab9f001149858d5d10032999ab9a3370e9000001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba100115333573466e1d2002002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022c6aae78008d55ce8009baa001357420022a666ae68cdc3a4004004264646464646464646464932999aab9f001149858d5d10019bad001357420026ae8800cdd68009aba1001357440066eb4004d5d08008b1aab9e00235573a0026ea8004d5d08008a999ab9a3370e900100109924ca666aae7c004526161635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a400000426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400454ccd5cd19b87480080084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008b1aab9e00235573a0026ea8004d5d08008b1aab9e00235573a0026ea8004d5d08008b1aab9e00235573a0026ea8024d5d10009aba20013235573c6ea800401c4c8c8c8c94ccd5cd19b874800800852809991919180111980100100091801119801001000912999aab9f00114a02a666ae68cdd79aba100100314a2260046ae88004d5d0800991bac35742646ae88c8d5d1191aba23235744646ae88c8d5d1191aba235744002002002002002002002646aae78dd50008009aba13235573c6ea8004020d55cf0011aab9d00137546ae84c8d55cf1baa001001357420022940d55cf0011aab9d001375400e66e9520003357406ae840052f5c0904044bd1bab3574200c9319911919192999ab9a3370e90000010b0a999ab9a3370e900200109aba10011323300120011633233222332323002233002002001230022330020020012253335573e002244a0022a666ae68cdd79aab9d357420020082600a6ae840044c008d5d10008009191118010019aab9e00137520026eb8d5d08008021aab9e00235573a0026ea8008d5d09aba200437566ae84d5d1006a510153332225333573466e1c0052000133223375e6e98008dd30008010018999119baf374c0046e98004008c8cc8c88cc8c8c0088cc0080080048c0088cc008008004894ccd55cf8008a5eb7bdb1804c8ccc014d55cf1aba1002233574066ec0d55ce9aba1003001002100130023574400200246660046eac0048c888c00800cdd300089128009192999ab9a35746002244a002244600400666446646460044660040040024600446600400400244a666aae7c00452f5bded8c026466600a6aae78d5d0801119aba0337606aae74d5d0801800801080098011aba200100125333573466ebc004dd424000244a0022446004006002002666444666464446666464646004466004004002460044660040040026446464466002006004444a666aae7c0044cd5d000180109919192999ab9a3375e004002266ae80cdd8001198049aab9e00635573c0066660104400400a6ae8801054ccd5cd19b90375c0046eb80044cd5d00031999804110008019aba2004005133574000666660104400200c00a6ae88010d55ce8011aab9d0043574200244a666aae7c00840044cccc00c88004d5d08011aba20020010010032200200200122374c660066eac008dd5800911999191119999191918011198010010009180111980100100099119191198008018011112999aab9f00113357400060042646464a666ae68cdd7801000899aba033760004660126aae78018d55cf001999804110010029aba200415333573466e40dd70011bae001133574000c6666010440020066ae880100144cd5d00019999804110008030029aba200435573a0046aae74010d5d0800912999aab9f00210011333300322001357420046ae8800800400400c8800800800488dd4198019bad002375a00200a004002004002e0000cccc8894ccd5cd19b870014800052f5bded8c026644664466ae80cdd8001000a5eb7bdb180dd48011ba60010033322332233574066ec00080052f5bded8c06ea4008dd4000801000a4410048810000137566ae84018dd59aba100432337029000000a410112f4664466ebcdd3991aab9e37540020046e9cc8d55cf1baa0010013574200a02e264646464a666ae68cdc3a400400429404cc8c8c8c0088cc0080080048c0088cc008008004894ccd55cf8008a5015333573466ebcd5d08008018a5113002357440026ae84004c8dd61aba13235744646ae88c8d5d1191aba23235744646ae88c8d5d11aba20010010010010010010013235573c6ea8004004d5d0991aab9e37540020326aae78008d55ce8009baa35742646aae78dd50008009aba1001132323232533357346466e1cd55ce9baa00148008d55cf00689991199ab9a0020014a06644666ae6800800528199999991111111919192999ab9a3370e90000010a999ab9a00513232323232323232323233223335734004002940cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223335734004002940cc88cdd79ba73235573c6ea8004008dd3991aab9e37540020026ae8401cd5d0805999119baf374e646aae78dd50008011ba73235573c6ea8004004d5d08031aba100b3375e6ae84014d5d080419baf357420026ae84028cdd79aba1357440026ae84024cdd79aba1357440046ae84d5d100419b87375a6ae8400d208092f4013370e6eb4d5d09aba2003482024bd004c8d55cf1baa00135742002646aae78dd50009aba1002357440026ae88004d5d10009aba20013235573c6ea8004c8c8c8c80354ccd5cd19b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba2003375a0026ae84004d5d10019bad001357420026ae880194ccd5cd19b87480000084c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba2003375a0026ae84004d5d10032999ab9a3370e900000109919192999ab9a53323357340022944cdc3800a4000266e1c005203813232325333573466e24dc6800a408026464932999aab9f001149858d5d10018b1bae001357420026ae8801058dc68009bae001357420022c6aae78008d55ce8009baa001357420022c6aae78008d55ce8009baa001357420026ae880194ccd5cd19b87480000084c8c94ccd5cd19b87371a6eb80092040132324994ccd55cf8008a4c2c6ae8800c58dd70009aba100115333573466e1d20020021324994ccd55cf8008a4c2c2c6aae78008d55ce8009baa001357420026ae880194ccd5cd19b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d20000021323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d2000002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022a666ae68cdc3a400400426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400458d55cf0011aab9d00137540026ae8400454ccd5cd19b87480080084c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba2003375a0026ae84004d5d10019bad001357420026ae8800cdd68009aba10011635573c0046aae74004dd50009aba100115333573466e1d20020021324994ccd55cf8008a4c2c2c6aae78008d55ce8009baa001357420026ae880194ccd5cd19b87480000084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008a999ab9a3370e9001001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba10011635573c0046aae74004dd50009aba10011635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a4000004264646464646464646464646464932999aab9f001149858d5d10032999ab9a3370e900000109919191919191924ca666aae7c004526163574400ca666ae68cdc3a4000004264646464646464932999aab9f001149858d5d10032999ab9a3370e9000001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba100115333573466e1d2002002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022c6aae78008d55ce8009baa001357420022a666ae68cdc3a4004004264646464646464646464932999aab9f001149858d5d10019bad001357420026ae8800cdd68009aba1001357440066eb4004d5d08008b1aab9e00235573a0026ea8004d5d08008a999ab9a3370e900100109924ca666aae7c004526161635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a400000426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400454ccd5cd19b87480080084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008b1aab9e00235573a0026ea8004d5d08008b1aab9e00235573a0026ea8004d5d08008b1aab9e00235573a0026ea8024d5d10009aba20013235573c6ea800401c4c8c8c8c94ccd5cd19b874800800852809991919180111980100100091801119801001000912999aab9f00114a02a666ae68cdd79aba100100314a2260046ae88004d5d0800991bac35742646ae88c8d5d1191aba23235744646ae88c8d5d1191aba235744002002002002002002002646aae78dd50008009aba13235573c6ea8004020d55cf0011aab9d00137546ae84c8d55cf1baa001001357420022940d55cf0011aab9d001375400e6ae84014dd69aba100437566ae84028d5d09aba200133223232325333573466e1d20000021615333573466e1d20040021357420022646600240022c664664446646460044660040040024600446600400400244a666aae7c004489400454ccd5cd19baf35573a6ae840040104c014d5d0800898011aba200100123222300200335573c0026ea4004dd71aba100100435573c0046aae74004dd50011aba1357440106eacd5d09aba2011323370e6aae74dd5000a40046aae78034064ccc8894ccd5cd19b87001480004cc88cdd79ba6002374c0020040062664466ebcdd30011ba600100232332322332323002233002002001230022330020020012253335573e002297adef6c6013233300535573c6ae840088cd5d019bb035573a6ae8400c0040084004c008d5d100080091998011bab001232223002003374c002244a002464a666ae68d5d180089128008911801001999119919180111980100100091801119801001000912999aab9f00114bd6f7b6300991998029aab9e35742004466ae80cdd81aab9d35742006002004200260046ae8800400494ccd5cd19baf00137509000091280089118010018008009999111999191119999191918011198010010009180111980100100099119191198008018011112999aab9f00113357400060042646464a666ae68cdd7801000899aba033760004660126aae78018d55cf001999804110010029aba200415333573466e40dd70011bae001133574000c6666010440020066ae880100144cd5d00019999804110008030029aba200435573a0046aae74010d5d0800912999aab9f00210011333300322001357420046ae8800800400400c8800800800488dd3198019bab002375600244666464446666464646004466004004002460044660040040026446464466002006004444a666aae7c0044cd5d000180109919192999ab9a3375e004002266ae80cdd8001198049aab9e00635573c0066660104400400a6ae8801054ccd5cd19b90375c0046eb80044cd5d00031999804110008019aba2004005133574000666660104400200c00a6ae88010d55ce8011aab9d0043574200244a666aae7c00840044cccc00c88004d5d08011aba200200100100322002002001223750660066eb4008dd6800802801000801000b800033332225333573466e1c005200014bd6f7b63009991199119aba03376000400297adef6c6037520046e9800400ccc88cc88cd5d019bb00020014bd6f7b6301ba90023750002004002911004881000013232325333573466e1d2000002132533357346644664646460044660040040024600446600400400244a666aae7c0045288a9991199ab9a00200114a060066ae840044c008d5d1000918019bab35573c00200246644664646460044660040040024600446600400400244a666aae7c0045288a9991199ab9a00200114a060066ae840044c008d5d1000918019bad35573c002002466e21200000100100110011632332322332323002233002002001230022330020020012253335573e002297adef6c6013233300535573c6ae840088cd5d019bb035573a6ae8400c0040084004c008d5d100080091998011bab001232223002003374c002244a002464a666ae68d5d180089128008911801001999119919180111980100100091801119801001000912999aab9f00114bd6f7b6300991998029aab9e35742004466ae80cdd81aab9d35742006002004200260046ae8800400494ccd5cd19baf00137509000091280089118010018008009999111999191119999191918011198010010009180111980100100099119191198008018011112999aab9f00113357400060042646464a666ae68cdd7801000899aba033760004660126aae78018d55cf001999804110010029aba200415333573466e40dd70011bae001133574000c6666010440020066ae880100144cd5d00019999804110008030029aba200435573a0046aae74010d5d0800912999aab9f00210011333300322001357420046ae8800800400400c8800800800488dd3198019bab002375600244666464446666464646004466004004002460044660040040026446464466002006004444a666aae7c0044cd5d000180109919192999ab9a3375e004002266ae80cdd8001198049aab9e00635573c0066660104400400a6ae8801054ccd5cd19b90375c0046eb80044cd5d00031999804110008019aba2004005133574000666660104400200c00a6ae88010d55ce8011aab9d0043574200244a666aae7c00840044cccc00c88004d5d08011aba200200100100322002002001223750660066eb4008dd6800802801000801000b803332225333573466e1c005200014bd6f7b63009991199119aba03376000400297adef6c6037520046e9800400ccc88cc88cd5d019bb00020014bd6f7b6301ba900237500020040026eb8d5d08009bae357426ae88004cc8c8c8c8c88ccc00401000c008dd69aab9e003375c6aae74008dd71aab9d0023253335573e0022c264a666aae7c0044d5d08010b1aba200137566aae78004c94ccd55cf8008b0992999aab9f0011357420042c6ae88004d5d1192999aab9f00114bd6f7b630099aba0357420026ae88004c8dd59aba13235744646ae88c8d5d11aba20010010013235573c6ea8004004d5d0991aab9e3754002038444a666ae68cc88ccd5cd001000a503371e6eb8d5d080200199b8f375c6ae84d5d100200108008b1bab3574201a26eacd5d08069aab9e00235573a0026ea8d5d08011bab357420106466e052000001375a6ae84010cc88cdd79ba73235573c6ea8004008dd3991aab9e37540020026ae8402406c4c8c8c94ccd5cd19b87480000084cc88ccd5cd001000a5033223335734004002940ccccccc8888888c8c8c94ccd5cd19b874800000854ccd5cd0028991919191919191919191991199ab9a0020014a06644666ae68008005281991199ab9a0020014a06644666ae68008005281991199ab9a0020014a06644666ae68008005281991199ab9a0020014a0664466ebcdd3991aab9e37540020046e9cc8d55cf1baa0010013574200e6ae8402ccc88cdd79ba73235573c6ea8004008dd3991aab9e37540020026ae84018d5d080599baf3574200a6ae84020cdd79aba10013574201466ebcd5d09aba20013574201266ebcd5d09aba2002357426ae88020cdc39bad357420069040497a0099b87375a6ae84d5d1001a410125e802646aae78dd50009aba10013235573c6ea8004d5d08011aba2001357440026ae88004d5d1000991aab9e37540026464646401aa666ae68cdc3a4000004264646464646464646464646464646464646464646464646464646464646464932999aab9f001149858d5d10019bad001357420026ae8800cdd68009aba10013574400ca666ae68cdc3a4000004264646464646464646464932999aab9f001149858d5d10019bad001357420026ae880194ccd5cd19b87480000084c8c8c94ccd5cd299919ab9a00114a266e1c005200013370e002901c09919192999ab9a337126e340052040132324994ccd55cf8008a4c2c6ae8800c58dd70009aba1001357440082c6e34004dd70009aba10011635573c0046aae74004dd50009aba10011635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a400000426464a666ae68cdc39b8d375c00490200991924ca666aae7c00452616357440062c6eb8004d5d08008a999ab9a3370e900100109924ca666aae7c004526161635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a4000004264646464646464646464646464932999aab9f001149858d5d10032999ab9a3370e900000109919191919191924ca666aae7c004526163574400ca666ae68cdc3a4000004264646464646464932999aab9f001149858d5d10032999ab9a3370e9000001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba100115333573466e1d2002002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022c6aae78008d55ce8009baa001357420022a666ae68cdc3a4004004264646464646464646464932999aab9f001149858d5d10019bad001357420026ae8800cdd68009aba1001357440066eb4004d5d08008b1aab9e00235573a0026ea8004d5d08008a999ab9a3370e900100109924ca666aae7c004526161635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a400000426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400454ccd5cd19b87480080084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008b1aab9e00235573a0026ea8004d5d08008b1aab9e00235573a0026ea8004d5d08009aba20065333573466e1d20000021323232323232323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d20000021323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008a999ab9a3370e9001001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba10011635573c0046aae74004dd50009aba100115333573466e1d20020021323232323232323232324994ccd55cf8008a4c2c6ae8800cdd68009aba1001357440066eb4004d5d08009aba2003375a0026ae8400458d55cf0011aab9d00137540026ae8400454ccd5cd19b87480080084c92653335573e0022930b0b1aab9e00235573a0026ea8004d5d08009aba20065333573466e1d2000002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022a666ae68cdc3a400400426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400458d55cf0011aab9d00137540026ae8400458d55cf0011aab9d00137540026ae8400458d55cf0011aab9d00137540126ae88004d5d1000991aab9e375400200e264646464a666ae68cdc3a400400429404cc8c8c8c0088cc0080080048c0088cc008008004894ccd55cf8008a5015333573466ebcd5d08008018a5113002357440026ae84004c8dd61aba13235744646ae88c8d5d1191aba23235744646ae88c8d5d11aba20010010010010010010013235573c6ea8004004d5d0991aab9e37540020106aae78008d55ce8009baa35742646aae78dd50008009aba100114a06aae78008d55ce8009baa007357420106eb4d5d08031bab3574201a6ae84d5d100219911919192999ab9a3370e90000010b0a999ab9a3370e900200109aba10011323300120011633233222332323002233002002001230022330020020012253335573e002244a0022a666ae68cdd79aab9d357420020082600a6ae840044c008d5d10008009191118010019aab9e00137520026eb8d5d08008021aab9e00235573a0026ea8008d5d09aba200b37566ae84d5d100a1919b8735573a6ea8005200235573c020038666444a666ae68cdc3800a40002664466ebcdd30011ba6001002003133223375e6e98008dd30008011919919119919180111980100100091801119801001000912999aab9f00114bd6f7b6300991998029aab9e35742004466ae80cdd81aab9d35742006002004200260046ae880040048ccc008dd58009191118010019ba60011225001232533357346ae8c0044894004488c00800ccc88cc8c8c0088cc0080080048c0088cc008008004894ccd55cf8008a5eb7bdb1804c8ccc014d55cf1aba1002233574066ec0d55ce9aba100300100210013002357440020024a666ae68cdd78009ba8480004894004488c00800c004004ccc888ccc8c888cccc8c8c8c0088cc0080080048c0088cc008008004c88c8c88cc00400c0088894ccd55cf800899aba000300213232325333573466ebc0080044cd5d019bb00023300935573c00c6aae7800cccc02088008014d5d10020a999ab9a337206eb8008dd7000899aba00063333008220010033574400800a266ae8000ccccc02088004018014d5d10021aab9d00235573a0086ae84004894ccd55cf801080089999801910009aba10023574400400200200644004004002446e98cc00cdd58011bab0012233323222333323232300223300200200123002233002002001322323223300100300222253335573e002266ae8000c0084c8c8c94ccd5cd19baf002001133574066ec0008cc024d55cf0031aab9e00333300822002005357440082a666ae68cdc81bae002375c002266ae80018cccc0208800400cd5d1002002899aba0003333300822001006005357440086aae74008d55ce8021aba10012253335573e004200226666006440026ae84008d5d100100080080191001001000911ba833003375a0046eb4004014008004008005c00019999112999ab9a3370e00290000a5eb7bdb1804cc88cc88cd5d019bb00020014bd6f7b6301ba9002374c0020066644664466ae80cdd8001000a5eb7bdb180dd48011ba80010020014881004881000013232325333573466e1d2002002137566ae840404c94ccd5cd19911991919180111980100100091801119801001000912999aab9f00114a22a6644666ae6800800452818019aba10011300235744002460066eacd55cf000800919911991919180111980100100091801119801001000912999aab9f00114a22a6644666ae6800800452818019aba10011300235744002460066eb4d55cf000800919b8848000004004004400458c8cc8c88cc8c8c0088cc0080080048c0088cc008008004894ccd55cf8008a5eb7bdb1804c8ccc014d55cf1aba1002233574066ec0d55ce9aba1003001002100130023574400200246660046eac0048c888c00800cdd300089128009192999ab9a35746002244a002244600400666446646460044660040040024600446600400400244a666aae7c00452f5bded8c026466600a6aae78d5d0801119aba0337606aae74d5d0801800801080098011aba200100125333573466ebc004dd424000244a0022446004006002002666444666464446666464646004466004004002460044660040040026446464466002006004444a666aae7c0044cd5d000180109919192999ab9a3375e004002266ae80cdd8001198049aab9e00635573c0066660104400400a6ae8801054ccd5cd19b90375c0046eb80044cd5d00031999804110008019aba2004005133574000666660104400200c00a6ae88010d55ce8011aab9d0043574200244a666aae7c00840044cccc00c88004d5d08011aba20020010010032200200200122374c660066eac008dd5800911999191119999191918011198010010009180111980100100099119191198008018011112999aab9f00113357400060042646464a666ae68cdd7801000899aba033760004660126aae78018d55cf001999804110010029aba200415333573466e40dd70011bae001133574000c6666010440020066ae880100144cd5d00019999804110008030029aba200435573a0046aae74010d5d0800912999aab9f00210011333300322001357420046ae8800800400400c8800800800488dd4198019bad002375a00200a004002004002e00ccc8894ccd5cd19b870014800052f5bded8c026644664466ae80cdd8001000a5eb7bdb180dd48011ba60010033322332233574066ec00080052f5bded8c06ea4008dd40008010009bae357420026eb8d5d09aba2001332323232322333001004003002375a6aae7800cdd71aab9d002375c6aae74008c94ccd55cf8008b0992999aab9f0011357420042c6ae88004dd59aab9e0013253335573e0022c264a666aae7c0044d5d08010b1aba20013574464a666aae7c00452f5bded8c0266ae80d5d08009aba20013237566ae84c8d5d1191aba232357446ae88004004004c8d55cf1baa00100135742646aae78dd500080f9112999ab9a33223335734004002940cdc79bae3574200800666e3cdd71aba13574400800420022c6eacd5d08081aab9e00235573a0026ea8d5d08021bab357420166466e052000001375a6ae84018cdd79aba100c357420022c6aae78008d55ce8009baa3574200a6ae88004d5d10009aba2001357440026aae78008d55ce8009baa3232323233223232325333573466e1d20000021615333573466e1d20040021357420022646600240022c664664446646460044660040040024600446600400400244a666aae7c004489400454ccd5cd19baf35573a6ae840040104c014d5d0800898011aba200100123222300200335573c0026ea4004dd71aba100100435573c0046aae74004dd50011aba13574400e6eacd5d09aba200e5333573466e1d20000021323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c8c8c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d20000021323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d2000002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022a666ae68cdc3a400400426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400458d55cf0011aab9d00137540026ae8400454ccd5cd19b87480080084c8c8c8c8c8c8c8c8c8c92653335573e0022930b1aba2003375a0026ae84004d5d10019bad001357420026ae8800cdd68009aba10011635573c0046aae74004dd50009aba100115333573466e1d20020021324994ccd55cf8008a4c2c2c6aae78008d55ce8009baa001357420026ae880194ccd5cd19b87480000084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008a999ab9a3370e9001001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba10011635573c0046aae74004dd50009aba10011635573c0046aae74004dd50009aba100115333573466e1d200200213232323232323232323232323232323232323232323232323232324994ccd55cf8008a4c2c6ae88008d5d08009aba20065333573466e1d2000002132323253335734a66466ae6800452899b87001480004cdc3800a40702646464a666ae68cdc49b8d001481004c8c92653335573e0022930b1aba200316375c0026ae84004d5d10020b1b8d001375c0026ae8400454ccd5cd19b87480080084c92653335573e0022930b0b1aab9e00235573a0026ea8004d5d08009aba20065333573466e1d2000002132323253335734a66466ae6800452899b87001480004cdc3800a40702646464a666ae68cdc49b8d001481004c8c92653335573e0022930b1aba200316375c0026ae84004d5d10020b1b8d001375c0026ae8400454ccd5cd19b87480080084c92653335573e0022930b0b1aab9e00235573a0026ea8004d5d08009aba2003375a0026ae84004d5d10019bad001357420026ae880194ccd5cd19b87480000084c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d20000021323232323232323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c8c8c8c8c8c92653335573e0022930b1aba20065333573466e1d20000021323232323232324994ccd55cf8008a4c2c6ae880194ccd5cd19b87480000084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452616357440062c6eb8004d5d08008a999ab9a3370e9001001099192999ab9a3370e6e340052038132324994ccd55cf8008a4c2c6ae8800c58dd70009aba10011635573c0046aae74004dd50009aba100115333573466e1d20020021323232323232323232324994ccd55cf8008a4c2c6ae8800cdd68009aba1001357440066eb4004d5d08009aba2003375a0026ae8400458d55cf0011aab9d00137540026ae8400454ccd5cd19b87480080084c92653335573e0022930b0b1aab9e00235573a0026ea8004d5d08009aba20065333573466e1d2000002132325333573466e1cdc6800a407026464932999aab9f001149858d5d10018b1bae001357420022a666ae68cdc3a400400426464a666ae68cdc39b8d001480e04c8c92653335573e0022930b1aba200316375c0026ae8400458d55cf0011aab9d00137540026ae8400458d55cf0011aab9d00137540026ae8400454ccd5cd19b87480080084c92653335573e0022930b0b1aab9e00235573a0026ea8004d5d08008b1aab9e00235573a0026ea8cc88c8c8c94ccd5cd19b87480000085854ccd5cd19b87480100084d5d08008991980090008b1991991119919180111980100100091801119801001000912999aab9f001122500115333573466ebcd55ce9aba10010041300535742002260046ae880040048c888c00800cd55cf0009ba9001375c6ae84004010d55cf0011aab9d00137540046ae84d5d10019bab357426ae88028520021635744002646aae78dd50008019aba20013235573c6ea8004d55ce8012400066646464600446600400400246004466004004002444a666aae7c00852f5bded8c02a666aae7c00452f5bded8c0266ae80cc010d5d08011aba100133003357440046ae8800488c8c8c8c94ccd5cd19b874800800854ccd5cd19baf357420086ae840044c8c8c94ccd5cd19b87480000084cdd81aba13574400e6466e94ccd5cd000a4004900025eb8128899bb0357426ae8801cc8cdd2999ab9a0014800920004bd7025035573c0046aae74004dd51aab9e005161635573c0046aae74004dd51aab9d0023235573c6ea8004008ccc8c8c8c0088cc0080080048c0088cc0080080048894ccd55cf8008a5eb8054ccd5cd19b883370c00466e09200433225333573466e1c00520001480084ccc8c8c0088cc0080080048c0088cc0080080048894ccd5cd19b870014800840084c94ccd5cd1919b873370a0029002240000042002266e0800c004cc00ccdc100100119b83001480100080052004375a6ae84004cdc319b8000233225333573466e1c00520001480084ccc8c8c0088cc0080080048c0088cc0080080048894ccd5cd19b870014800840084c94ccd5cd1919b873370a0029002240000042002266e0800c004cc00ccdc100100119b83001480100080052004375a6ae84004cdc1240086644a666ae68cdc3800a40002900109999191801119801001000918011198010010009112999ab9a3370e002900108010992999ab9a323370e66e1400520044800000840044cdc10018009980199b82002002337060029002001000a40086eb4d5d0800899aba03004375a6ae84004cc00ccdc000119912999ab9a3370e00290000a40042666464600446600400400246004466004004002444a666ae68cdc3800a40042004264a666ae68c8cdc399b8500148011200000210011337040060026600666e08008008cdc1800a400800400290021bad357420026ae88004588cc894ccd5cd19b8800248000584cc894ccd5cd19b87002480004d5d0800899919919112999ab9a3370e004900009aba10011330033370200490011aba2001233002002001232225333573466e1c009200013574200226600666e0400920023574400246600400400200266e0400920023574400200400200200690001bac35742014664646460044660040040024600446600400400244a666aae7c00452f5bded8c0264a666ae68c0100044cd5d000098019aba200213003357440046ae840048c8c8c94ccd5cd19b87480080085288a5035573c0046aae74004dd51aab9d00137566ae8400cccc8c8c8c0088cc0080080048c0088cc0080080048894ccd55cf8008a5eb8054ccd5cd19b883370c00466e09200433225333573466e1c00520001480084ccc8c8c0088cc0080080048c0088cc0080080048894ccd5cd19b870014800840084c94ccd5cd1919b873370a0029002240000042002266e0800c004cc00ccdc100100119b83001480100080052004375a6ae84004cdc319b8000233225333573466e1c00520001480084ccc8c8c0088cc0080080048c0088cc0080080048894ccd5cd19b870014800840084c94ccd5cd1919b873370a0029002240000042002266e0800c004cc00ccdc100100119b83001480100080052004375a6ae84004cdc1240086644a666ae68cdc3800a40002900109999191801119801001000918011198010010009112999ab9a3370e002900108010992999ab9a323370e66e1400520044800000840044cdc10018009980199b82002002337060029002001000a40086eb4d5d0800899aba03004375a6ae84004cc00ccdc000119912999ab9a3370e00290000a40042666464600446600400400246004466004004002444a666ae68cdc3800a40042004264a666ae68c8cdc399b8500148011200000210011337040060026600666e08008008cdc1800a400800400290021bad357420026ae88004588cc894ccd5cd19b8800248000584cc894ccd5cd19b87002480004d5d0800899919919112999ab9a3370e004900009aba10011330033370200490011aba2001233002002001232225333573466e1c009200013574200226600666e0400920023574400246600400400200266e0400920023574400200400200200490001bac357426ae88028ccc8c8c0088cc0080080048c0088cc0080080048894ccd55cf800880109919192999ab9a3370e900100109980319b8000548008d5d10020998030029aba200435573c0046aae74004dd5191aba13235573c6ea8004004c8d5d0991aab9e3754002002646ae84d5d1191aab9e37540020026ae840052000002149858dd61aba100337586ae8400cc8d5d1191aba23235744646ae88c8d5d11aba2001001001001001357440026ae88d5d1000991aab9e37540026ae8401058d55cf0011aab9d00137546ae84d5d1000991aab9e3754002004646aae78dd50008011", "description": "Smart Handle Router", "type": "PlutusScriptV2" } \ No newline at end of file diff --git a/flake.nix b/flake.nix index cf9fabb..d7945a8 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ nixConfig = { extra-experimental-features = [ "nix-command" "flakes" "ca-derivations" ]; - extra-substituters = [ "https://cache.iog.io" "https://cache.zw3rk.com" ]; + extra-substituters = [ "https://cache.iog.io" ]; extra-trusted-public-keys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" "loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk=" ]; allow-import-from-derivation = "true"; max-jobs = "auto"; diff --git a/offchain/common.ts b/offchain/common.ts deleted file mode 100644 index 461f0f5..0000000 --- a/offchain/common.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { Address, Constr, Data, getAddressDetails } from "lucid"; - -export const fromAddressToData = (address: Address): Data => { - const addrDetails = getAddressDetails(address); - - if (!addrDetails.paymentCredential) { - throw new Error("undefined paymentCredential"); - } - - const paymentCred = addrDetails.paymentCredential.type == "Key" - ? new Constr(0, [addrDetails.paymentCredential.hash]) - : new Constr(1, [addrDetails.paymentCredential.hash]); - - if (!addrDetails.stakeCredential) { - return new Constr(0, [paymentCred, new Constr(1, [])]); - } - - const stakingCred = new Constr(0, [ - new Constr(0, [new Constr(0, [addrDetails.stakeCredential.hash])]), - ]); - - return new Constr(0, [paymentCred, stakingCred]); -}; - -export function fromAddress(address: Address): AddressD { - // We do not support pointer addresses! - - const { paymentCredential, stakeCredential } = getAddressDetails(address); - - if (!paymentCredential) throw new Error("Not a valid payment address."); - - return { - paymentCredential: paymentCredential?.type === "Key" - ? { - PublicKeyCredential: [paymentCredential.hash], - } - : { ScriptCredential: [paymentCredential.hash] }, - stakeCredential: stakeCredential - ? { - Inline: [ - stakeCredential.type === "Key" - ? { - PublicKeyCredential: [stakeCredential.hash], - } - : { ScriptCredential: [stakeCredential.hash] }, - ], - } - : null, - }; -} -export const CredentialSchema = Data.Enum([ - Data.Object({ - PublicKeyCredential: Data.Tuple([ - Data.Bytes({ minLength: 28, maxLength: 28 }), - ]), - }), - Data.Object({ - ScriptCredential: Data.Tuple([ - Data.Bytes({ minLength: 28, maxLength: 28 }), - ]), - }), -]); -export type CredentialD = Data.Static; -export const CredentialD = CredentialSchema as unknown as CredentialD; - -export const AddressSchema = Data.Object({ - paymentCredential: CredentialSchema, - stakeCredential: Data.Nullable( - Data.Enum([ - Data.Object({ Inline: Data.Tuple([CredentialSchema]) }), - Data.Object({ - Pointer: Data.Tuple([ - Data.Object({ - slotNumber: Data.Integer(), - transactionIndex: Data.Integer(), - certificateIndex: Data.Integer(), - }), - ]), - }), - ]), - ), -}); -export type AddressD = Data.Static; -export const AddressD = AddressSchema as unknown as AddressD; - -export const SmartHandleDatumSchema = Data.Object({ - owner: AddressSchema, -}); -export type SmartHandleDatum = Data.Static; - -// stupid hack used everywhere to export types -export const SmartHandleDatum = - SmartHandleDatumSchema as unknown as SmartHandleDatum; - -export const script = - "59234059233d01000022223332223232325333573466e1d20000021333222323232323232325333573466e1d2002002132323232325333573466e1d2002002132323232325333573466e1d200200213333233222332323002233002002001230022330020020012253335573e002244a0022a666ae68cdd79aab9d357420020082600a6ae840044c008d5d10008009191118010019aab9e00137520026eb8d5d08009bab357426ae88d5d10071191919191919192999ab9a33223335734004002940cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5033223335734004002940cc88ccd5cd001000a5032533357340022002266ae7124117496e636f727265637420696e646578656420696e707574000013375e6ae8404cd5d0809192999ab9a0011001133573892115496e636f727265637420537761702053656e646572000013375e6ae8401cd5d0991aab9e375400204464a666ae6800440044cd5ce24917496e636f72726563742053776170205265636569766572000013375e6ae84018d5d0991aab9e375400204464a666ae6800440044cd5ce2491b496e636f7272656374205265636569766572446174756d48617368000013232325333573466e1d200000214a02944d55cf0011aab9d00137546ae84014c94ccd5cd0008800899ab9c49118496e636f727265637420244d494e20506f6c696379204964000013371e6eb8d5d0800a451ce16c2dc8ae937e8d3790c7fd7168d7b994621ba14ca11415f39fed720032533357340022002266ae71240119496e636f727265637420244d494e20546f6b656e204e616d65000013371e6eb8d5d09aba20014881034d494e0032533357340022002266ae71240115496e636f7272656374204261746368657220466565000013370e6eb4d5d0801a410125e80264a666ae6800440044cd5ce24914496e636f7272656374204f757470757420414441000013370e6eb4d5d09aba2003482024bd004c94ccd5cd0008800899ab9c490116496e636f7272656374205377617020416464726573730000133223375e6e9cc8d55cf1baa001002374e646aae78dd50008009aba100d02632533357340022002266ae712411b496e636f72726563742053776170204f75747075742056616c75650000133223375e6e98008dd30009bab35742018646646446646460044660040040024600446600400400244a666aae7c00452f5bded8c026466600a6aae78d5d0801119aba0337606aae74d5d0801800801080098011aba2001001233300237560024644460040066e9800448940048c94ccd5cd1aba3001122500112230020033322332323002233002002001230022330020020012253335573e002297adef6c6013233300535573c6ae840088cd5d019bb035573a6ae8400c0040084004c008d5d100080092999ab9a3375e0026ea1200012250011223002003001001332233323222333323232300223300200200123002233002002001322323223300100300222253335573e002266ae8000c0084c8c8c94ccd5cd19baf002001133574066ec0008cc024d55cf0031aab9e00333300822002005357440082a666ae68cdc81bae002375c002266ae80018cccc0208800400cd5d1002002899aba0003333300822001006005357440086aae74008d55ce8021aba10012253335573e004200226666006440026ae84008d5d100100080080191001001000911ba63300337560046eac00488ccc888cccc8c8c8c0088cc0080080048c0088cc008008004c88c8c88cc00400c0088894ccd55cf800899aba000300213232325333573466ebc0080044cd5d019bb00023300935573c00c6aae7800cccc02088008014d5d10020a999ab9a337206eb8008dd7000899aba00063333008220010033574400800a266ae8000ccccc02088004018014d5d10021aab9d00235573a0086ae84004894ccd55cf801080089999801910009aba10023574400400200200644004004002446ea0cdc01bad002375a0020040020040026eacd5d09aba2011325333573466e1c005200014bd6f7b630099199119aba03376000400297adef6c603752910100374c002664466ae80cdd8001000a5eb7bdb180dd4a450037500026466e0520000014820225e8c94ccd5cd0008800899ab9c4911c4d756c7469706c652073637269707420696e70757473207370656e74000013370e66466464600446600400400246004466004004002444a666aae7c00440084c8c8c94ccd5cd19b87480000084cc018014d5d10020a999ab9a3371e00e6eb8d5d080089980319b8000548008d5d10020998030029aba200435573c0046aae74004dd5191aba13235573c6ea8004004c8d5d0991aab9e3754002002646ae84d5d1191aab9e37540020026ae840052000375c6ae84038dd61aba101848008526163235573c6ea8004d5d0800991aab9e37540026ae84008d5d10009aba2001357440026ae88004c8d55cf1baa001323232320055333573466e1d20000021323232323232323232323232323232323232323232323232323232323232324994ccd55cf8008a4c2a66ae712401317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440066eb4004d5d08009aba2003375a0026ae84004d5d10032999ab9a3370e900000109919191919191919191924ca666aae7c00452615335738921317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440066eb4004d5d08009aba20065333573466e1d2000002132323253335734a66466ae6800452899b87001480004cdc3800a40702646464a666ae68cdc49b8d001481004c8c92653335573e0022930a99ab9c4901317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440062a66ae712401327074727946726f6d28546f6b656e4e616d65293a206d757374206265206174206d6f7374203332204279746573206c6f6e670016375c0026ae84004d5d10020a99ab9c4901387074727946726f6d2843757272656e637953796d626f6c293a206d757374206265203238206279746573206c6f6e67206f7220656d7074790016371a0026eb8004d5d08008a99ab9c4913f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba10011533573892013f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a400000426464a666ae68cdc39b8d375c00490200991924ca666aae7c00452615335738921317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440062a66ae7124012b7074727946726f6d2850446174756d48617368293a206d757374206265203332206279746573206c6f6e670016375c0026ae8400454ccd5cd19b87480080084c92653335573e0022930a99ab9c4901317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f00161533573892013f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a4000004264646464646464646464646464932999aab9f001149854cd5ce2481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f00163574400ca666ae68cdc3a4000004264646464646464932999aab9f001149854cd5ce2481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f00163574400ca666ae68cdc3a4000004264646464646464932999aab9f001149854cd5ce2481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f00163574400ca666ae68cdc3a400000426464a666ae68cdc39b8d001480e04c8c92653335573e0022930a99ab9c491317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440062a66ae7124012c7074727946726f6d28505075624b657948617368293a206d757374206265203238206279746573206c6f6e670016375c0026ae8400454ccd5cd19b87480080084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452615335738921317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440062a66ae7124012c7074727946726f6d285053637269707448617368293a206d757374206265203238206279746573206c6f6e670016375c0026ae8400454cd5ce24813f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba100115333573466e1d20020021323232323232323232324994ccd55cf8008a4c2a66ae712401317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440066eb4004d5d08009aba2003375a0026ae84004d5d10019bad001357420022a66ae712413f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba100115333573466e1d20020021324994ccd55cf8008a4c2a66ae712401317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f00161533573892013f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a400000426464a666ae68cdc39b8d001480e04c8c92653335573e0022930a99ab9c491317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440062a66ae7124012c7074727946726f6d28505075624b657948617368293a206d757374206265203238206279746573206c6f6e670016375c0026ae8400454ccd5cd19b87480080084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452615335738921317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440062a66ae7124012c7074727946726f6d285053637269707448617368293a206d757374206265203238206279746573206c6f6e670016375c0026ae8400454cd5ce24813f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba10011533573892013f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a4000004264646464646464646464646464932999aab9f001149854cd5ce2481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f00163574400ca666ae68cdc3a4000004264646464646464932999aab9f001149854cd5ce2481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f00163574400ca666ae68cdc3a4000004264646464646464932999aab9f001149854cd5ce2481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f00163574400ca666ae68cdc3a400000426464a666ae68cdc39b8d001480e04c8c92653335573e0022930a99ab9c491317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440062a66ae7124012c7074727946726f6d28505075624b657948617368293a206d757374206265203238206279746573206c6f6e670016375c0026ae8400454ccd5cd19b87480080084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452615335738921317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440062a66ae7124012c7074727946726f6d285053637269707448617368293a206d757374206265203238206279746573206c6f6e670016375c0026ae8400454cd5ce24813f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba100115333573466e1d20020021323232323232323232324994ccd55cf8008a4c2a66ae712401317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440066eb4004d5d08009aba2003375a0026ae84004d5d10019bad001357420022a66ae712413f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba100115333573466e1d20020021324994ccd55cf8008a4c2a66ae712401317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f00161533573892013f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a400000426464a666ae68cdc39b8d001480e04c8c92653335573e0022930a99ab9c491317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440062a66ae7124012c7074727946726f6d28505075624b657948617368293a206d757374206265203238206279746573206c6f6e670016375c0026ae8400454ccd5cd19b87480080084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452615335738921317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440062a66ae7124012c7074727946726f6d285053637269707448617368293a206d757374206265203238206279746573206c6f6e670016375c0026ae8400454cd5ce24813f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba10011533573892013f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba10011533573892013f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50008a99ab9c49014d5061747465726e206d61746368206661696c75726520696e207175616c69666965642027646f2720626c6f636b206174207372632f536d61727448616e646c65732e68733a3332333a332d313900161533573892014d5061747465726e206d61746368206661696c75726520696e207175616c69666965642027646f2720626c6f636b206174207372632f536d61727448616e646c65732e68733a3332323a332d3532001635573c0046aae74004dd51aba1357440026ae88004c8d55cf1baa00133225333573466e2000920001533573892011770656c656d41743a206e6567617469766520696e6465780016133225333573466e1c009200013574200226646646444a666ae68cdc38012400026ae840044cc00ccdc0801240046ae880048cc0080080048c8894ccd5cd19b87002480004d5d080089980199b8100248008d5d100091980100100080099b8100248008d5d10008010008071bac357420142a66ae712414d5061747465726e206d61746368206661696c75726520696e207175616c69666965642027646f2720626c6f636b206174207372632f536d61727448616e646c65732e68733a3331383a332d3532001635573c0046aae74004dd5191aba13235573c6ea8004004d5d0800991aab9e37540026ae84d5d1000991aab9e37540026644a666ae68cdc4001240002a66ae712411770656c656d41743a206e6567617469766520696e6465780016133225333573466e1c009200013574200226646646444a666ae68cdc38012400026ae840044cc00ccdc0801240046ae880048cc0080080048c8894ccd5cd19b87002480004d5d080089980199b8100248008d5d100091980100100080099b8100248008d5d10008010008051bac3574200c2a66ae712414d5061747465726e206d61746368206661696c75726520696e207175616c69666965642027646f2720626c6f636b206174207372632f536d61727448616e646c65732e68733a3331343a332d3430001635573c0046aae74004dd51aba135744008646ae88c8d5d1191aba232357446ae88004004004004d5d10009aba235744002646aae78dd50009aba10013235573c6ea8004004dd69aba1001375a6ae84d5d100080209919192999ab9a3370e90000010a999ab9a33232323002233002002001230022330020020012253335573e002294054ccd5cd19baf3574200200629444c008d5d10009aba10013237586ae84c8d5d11aba235744646ae88c8d5d1191aba232357446ae88004004004004004c8d55cf1baa00100135742646aae78dd50008038a4c2c2c6aae78008d55ce8009baa3235742646aae78dd50008009aba13235573c6ea8004018d55cf0011aab9d00137540046464646400ea666ae68cdc3a4000004264646464646464932999aab9f001149854cd5ce2481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f00163574400ca666ae68cdc3a4000004264646464646464646464646464932999aab9f001149854cd5ce2481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f00163574400ca666ae68cdc3a4000004264646464646464932999aab9f001149854cd5ce2481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f00163574400ca666ae68cdc3a4000004264646464646464932999aab9f001149854cd5ce2481317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f00163574400ca666ae68cdc3a400000426464a666ae68cdc39b8d001480e04c8c92653335573e0022930a99ab9c491317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440062a66ae7124012c7074727946726f6d28505075624b657948617368293a206d757374206265203238206279746573206c6f6e670016375c0026ae8400454ccd5cd19b87480080084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452615335738921317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440062a66ae7124012c7074727946726f6d285053637269707448617368293a206d757374206265203238206279746573206c6f6e670016375c0026ae8400454cd5ce24813f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba100115333573466e1d20020021323232323232323232324994ccd55cf8008a4c2a66ae712401317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440066eb4004d5d08009aba2003375a0026ae84004d5d10019bad001357420022a66ae712413f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba100115333573466e1d20020021324994ccd55cf8008a4c2a66ae712401317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f00161533573892013f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba10013574400ca666ae68cdc3a400000426464a666ae68cdc39b8d001480e04c8c92653335573e0022930a99ab9c491317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440062a66ae7124012c7074727946726f6d28505075624b657948617368293a206d757374206265203238206279746573206c6f6e670016375c0026ae8400454ccd5cd19b87480080084c8c94ccd5cd19b87371a002901c0991924ca666aae7c00452615335738921317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440062a66ae7124012c7074727946726f6d285053637269707448617368293a206d757374206265203238206279746573206c6f6e670016375c0026ae8400454cd5ce24813f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba10011533573892013f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50009aba10011533573892013f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd5001991919190032999ab9a3370e900000109919191919191924ca666aae7c004526153357389201317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f0016357440066eb4004d5d08009aba2003375a0026ae8400454ccd5cd19b87480080084c92653335573e0022930a99ab9c4901317074727946726f6d2850446174615265636f72645b5d293a206c697374206973206c6f6e676572207468616e207a65726f00161533573892013f7265616368656420656e64206f662073756d207768696c65207374696c6c206e6f7420686176696e6720666f756e642074686520636f6e7374727563746f72001635573c0046aae74004dd50010009"; diff --git a/offchain/config.ts b/offchain/config.ts deleted file mode 100644 index b9a02f0..0000000 --- a/offchain/config.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { - applyParamsToScript, - Blockfrost, - Lucid, - Script, -} from "lucid"; -import { fromAddressToData, script } from "./common.ts"; - -export const blockFrostKey = "blockfrost api key"; - -export const lucid = await Lucid.new( - new Blockfrost( - "https://cardano-preprod.blockfrost.io/api/v0", - blockFrostKey, - ), - "Preprod", -); - -// your secret key here e.g. "eed25519_.." -lucid.selectWalletFromPrivateKey( - "your secret key here", -); -export const userAddress = - "address belonging to secret key"; - -export const minSwapAddress = - "addr_test1zzn9efv2f6w82hagxqtn62ju4m293tqvw0uhmdl64ch8uwurajt8r8wqtygrfduwgukk73m5gcnplmztc5tl5ngy0upq932hcy"; - -const appliedScript = applyParamsToScript(script, [ - fromAddressToData(minSwapAddress), -]); - -export const routingContract: Script = { - type: "PlutusV2", - script: appliedScript, -}; - -export const routingContractAddress = lucid.utils.validatorToAddress( - routingContract, -); diff --git a/offchain/create-swap-order.ts b/offchain/create-swap-order.ts deleted file mode 100644 index d3b7cf7..0000000 --- a/offchain/create-swap-order.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Data } from "lucid"; -import { lucid, routingContractAddress, userAddress } from "./config.ts"; -import { fromAddress, SmartHandleDatum } from "./common.ts"; - -const datum = Data.to({ owner: fromAddress(userAddress) }, SmartHandleDatum); - -const tx = await lucid - .newTx() - .payToContract(routingContractAddress, { inline: datum }, { - lovelace: BigInt(50_000_000), - }) - .complete(); - -const signedTx = await tx.sign().complete(); -const txHash = await signedTx.submit(); -await lucid.awaitTx(txHash); - -console.log(`Successfully sent swap order with 50 ADA -to routingContract: ${routingContractAddress}, -in tx: ${txHash}`); diff --git a/offchain/deno.json b/offchain/deno.json deleted file mode 100644 index 5a84236..0000000 --- a/offchain/deno.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "lucid": "npm:lucid-cardano@0.10.7", - "minswap": "npm:@minswap/sdk@0.2.2-beta", - "blockfrost": "npm:@blockfrost/blockfrost-js@^5.3.1" - } -} \ No newline at end of file diff --git a/offchain/deno.lock b/offchain/deno.lock deleted file mode 100644 index 3832891..0000000 --- a/offchain/deno.lock +++ /dev/null @@ -1,504 +0,0 @@ -{ - "version": "3", - "packages": { - "specifiers": { - "npm:@blockfrost/blockfrost-js@^5.3.1": "npm:@blockfrost/blockfrost-js@5.4.0", - "npm:@minswap/sdk@0.2.2-beta": "npm:@minswap/sdk@0.2.2-beta", - "npm:crypto-js@4.1.1": "npm:crypto-js@4.1.1", - "npm:lucid-cardano@0.10.7": "npm:lucid-cardano@0.10.7" - }, - "npm": { - "@blockfrost/blockfrost-js@5.4.0": { - "integrity": "sha512-al9rAlwXFsuLOCoY1yG5ib73BqCzY8hP/oVAIbmLlkRwUut+wDOxv8SDkr4jrW80vW7Grom1TbpNEPSWRqgsUg==", - "dependencies": { - "@blockfrost/openapi": "@blockfrost/openapi@0.1.59", - "@emurgo/cardano-serialization-lib-nodejs": "@emurgo/cardano-serialization-lib-nodejs@11.4.0", - "@emurgo/cip14-js": "@emurgo/cip14-js@3.0.1", - "bottleneck": "bottleneck@2.19.5", - "form-data": "form-data@4.0.0", - "got": "got@11.8.6", - "json-bigint": "json-bigint@1.0.0" - } - }, - "@blockfrost/openapi@0.1.59": { - "integrity": "sha512-Ia3pwPekwOFQDYJZtPch6N9ZcL35R0lEoIxqsXun/M4nE89eM09fORCVWnQy9QjaADDFA5tSIJqhg3L7wHtUKA==", - "dependencies": { - "ajv": "ajv@8.12.0", - "cbor": "cbor@8.1.0", - "yaml": "yaml@2.3.4" - } - }, - "@emurgo/cardano-serialization-lib-nodejs@11.4.0": { - "integrity": "sha512-dMiofDcqv+IrAITCgWBZmsMLqwv2xImDsJDSrKiYYG1zRKaL8XfMOxx6S0WEnKVj5/343Q5FFURYcSu3iBRNMQ==", - "dependencies": {} - }, - "@emurgo/cip14-js@3.0.1": { - "integrity": "sha512-u0XobeajNSlmeGBmY3ntA+NE/Vns7hKP0xrFzWyAO7YubETOifTjUddJN4gpvXE4S08DPUcNBVe3sx1m5GPIOg==", - "dependencies": { - "bech32": "bech32@2.0.0", - "blake2b": "blake2b@2.1.3" - } - }, - "@minswap/sdk@0.2.2-beta": { - "integrity": "sha512-reSOFJazuPL9NnTcesb9ycUpfcW4MkatLvbNXOzj2i4JVQjz082ePRfF//lAn/44MZ2Dkp4c73uPEPDfY43LRg==", - "dependencies": { - "@blockfrost/blockfrost-js": "@blockfrost/blockfrost-js@5.4.0", - "@minswap/tiny-invariant": "@minswap/tiny-invariant@1.2.0", - "big.js": "big.js@6.2.1", - "lucid-cardano": "lucid-cardano@0.10.7" - } - }, - "@minswap/tiny-invariant@1.2.0": { - "integrity": "sha512-m4CMTsZ4MDB2WLND6rV0eti+f2WcMPhKvXf9ZHXlQMqvNmgoX1z//84FpEX0D1vVTPfJtNS8XIoIQ9pm6X590A==", - "dependencies": {} - }, - "@peculiar/asn1-schema@2.3.8": { - "integrity": "sha512-ULB1XqHKx1WBU/tTFIA+uARuRoBVZ4pNdOA878RDrRbBfBGcSzi5HBkdScC6ZbHn8z7L8gmKCgPC1LHRrP46tA==", - "dependencies": { - "asn1js": "asn1js@3.0.5", - "pvtsutils": "pvtsutils@1.3.5", - "tslib": "tslib@2.6.2" - } - }, - "@peculiar/json-schema@1.1.12": { - "integrity": "sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==", - "dependencies": { - "tslib": "tslib@2.6.2" - } - }, - "@peculiar/webcrypto@1.4.3": { - "integrity": "sha512-VtaY4spKTdN5LjJ04im/d/joXuvLbQdgy5Z4DXF4MFZhQ+MTrejbNMkfZBp1Bs3O5+bFqnJgyGdPuZQflvIa5A==", - "dependencies": { - "@peculiar/asn1-schema": "@peculiar/asn1-schema@2.3.8", - "@peculiar/json-schema": "@peculiar/json-schema@1.1.12", - "pvtsutils": "pvtsutils@1.3.5", - "tslib": "tslib@2.6.2", - "webcrypto-core": "webcrypto-core@1.7.7" - } - }, - "@sindresorhus/is@4.6.0": { - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", - "dependencies": {} - }, - "@szmarczak/http-timer@4.0.6": { - "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", - "dependencies": { - "defer-to-connect": "defer-to-connect@2.0.1" - } - }, - "@types/cacheable-request@6.0.3": { - "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", - "dependencies": { - "@types/http-cache-semantics": "@types/http-cache-semantics@4.0.4", - "@types/keyv": "@types/keyv@3.1.4", - "@types/node": "@types/node@18.16.19", - "@types/responselike": "@types/responselike@1.0.3" - } - }, - "@types/http-cache-semantics@4.0.4": { - "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", - "dependencies": {} - }, - "@types/keyv@3.1.4": { - "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", - "dependencies": { - "@types/node": "@types/node@18.16.19" - } - }, - "@types/node@18.16.19": { - "integrity": "sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==", - "dependencies": {} - }, - "@types/responselike@1.0.3": { - "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", - "dependencies": { - "@types/node": "@types/node@18.16.19" - } - }, - "ajv@8.12.0": { - "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", - "dependencies": { - "fast-deep-equal": "fast-deep-equal@3.1.3", - "json-schema-traverse": "json-schema-traverse@1.0.0", - "require-from-string": "require-from-string@2.0.2", - "uri-js": "uri-js@4.4.1" - } - }, - "asn1js@3.0.5": { - "integrity": "sha512-FVnvrKJwpt9LP2lAMl8qZswRNm3T4q9CON+bxldk2iwk3FFpuwhx2FfinyitizWHsVYyaY+y5JzDR0rCMV5yTQ==", - "dependencies": { - "pvtsutils": "pvtsutils@1.3.5", - "pvutils": "pvutils@1.1.3", - "tslib": "tslib@2.6.2" - } - }, - "asynckit@0.4.0": { - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dependencies": {} - }, - "bech32@2.0.0": { - "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==", - "dependencies": {} - }, - "big.js@6.2.1": { - "integrity": "sha512-bCtHMwL9LeDIozFn+oNhhFoq+yQ3BNdnsLSASUxLciOb1vgvpHsIO1dsENiGMgbb4SkP5TrzWzRiLddn8ahVOQ==", - "dependencies": {} - }, - "bignumber.js@9.1.2": { - "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", - "dependencies": {} - }, - "blake2b-wasm@1.1.7": { - "integrity": "sha512-oFIHvXhlz/DUgF0kq5B1CqxIDjIJwh9iDeUUGQUcvgiGz7Wdw03McEO7CfLBy7QKGdsydcMCgO9jFNBAFCtFcA==", - "dependencies": { - "nanoassert": "nanoassert@1.1.0" - } - }, - "blake2b@2.1.3": { - "integrity": "sha512-pkDss4xFVbMb4270aCyGD3qLv92314Et+FsKzilCLxDz5DuZ2/1g3w4nmBbu6nKApPspnjG7JcwTjGZnduB1yg==", - "dependencies": { - "blake2b-wasm": "blake2b-wasm@1.1.7", - "nanoassert": "nanoassert@1.1.0" - } - }, - "bottleneck@2.19.5": { - "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==", - "dependencies": {} - }, - "cacheable-lookup@5.0.4": { - "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", - "dependencies": {} - }, - "cacheable-request@7.0.4": { - "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", - "dependencies": { - "clone-response": "clone-response@1.0.3", - "get-stream": "get-stream@5.2.0", - "http-cache-semantics": "http-cache-semantics@4.1.1", - "keyv": "keyv@4.5.4", - "lowercase-keys": "lowercase-keys@2.0.0", - "normalize-url": "normalize-url@6.1.0", - "responselike": "responselike@2.0.1" - } - }, - "cbor@8.1.0": { - "integrity": "sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==", - "dependencies": { - "nofilter": "nofilter@3.1.0" - } - }, - "clone-response@1.0.3": { - "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", - "dependencies": { - "mimic-response": "mimic-response@1.0.1" - } - }, - "combined-stream@1.0.8": { - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "delayed-stream@1.0.0" - } - }, - "crypto-js@4.1.1": { - "integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw==", - "dependencies": {} - }, - "data-uri-to-buffer@4.0.1": { - "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", - "dependencies": {} - }, - "decompress-response@6.0.0": { - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dependencies": { - "mimic-response": "mimic-response@3.1.0" - } - }, - "defer-to-connect@2.0.1": { - "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", - "dependencies": {} - }, - "delayed-stream@1.0.0": { - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dependencies": {} - }, - "end-of-stream@1.4.4": { - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dependencies": { - "once": "once@1.4.0" - } - }, - "fast-deep-equal@3.1.3": { - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dependencies": {} - }, - "fetch-blob@3.2.0": { - "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "dependencies": { - "node-domexception": "node-domexception@1.0.0", - "web-streams-polyfill": "web-streams-polyfill@3.2.1" - } - }, - "form-data@4.0.0": { - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dependencies": { - "asynckit": "asynckit@0.4.0", - "combined-stream": "combined-stream@1.0.8", - "mime-types": "mime-types@2.1.35" - } - }, - "formdata-polyfill@4.0.10": { - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "dependencies": { - "fetch-blob": "fetch-blob@3.2.0" - } - }, - "get-stream@5.2.0": { - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dependencies": { - "pump": "pump@3.0.0" - } - }, - "got@11.8.6": { - "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", - "dependencies": { - "@sindresorhus/is": "@sindresorhus/is@4.6.0", - "@szmarczak/http-timer": "@szmarczak/http-timer@4.0.6", - "@types/cacheable-request": "@types/cacheable-request@6.0.3", - "@types/responselike": "@types/responselike@1.0.3", - "cacheable-lookup": "cacheable-lookup@5.0.4", - "cacheable-request": "cacheable-request@7.0.4", - "decompress-response": "decompress-response@6.0.0", - "http2-wrapper": "http2-wrapper@1.0.3", - "lowercase-keys": "lowercase-keys@2.0.0", - "p-cancelable": "p-cancelable@2.1.1", - "responselike": "responselike@2.0.1" - } - }, - "http-cache-semantics@4.1.1": { - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", - "dependencies": {} - }, - "http2-wrapper@1.0.3": { - "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", - "dependencies": { - "quick-lru": "quick-lru@5.1.1", - "resolve-alpn": "resolve-alpn@1.2.1" - } - }, - "json-bigint@1.0.0": { - "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", - "dependencies": { - "bignumber.js": "bignumber.js@9.1.2" - } - }, - "json-buffer@3.0.1": { - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dependencies": {} - }, - "json-schema-traverse@1.0.0": { - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dependencies": {} - }, - "keyv@4.5.4": { - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dependencies": { - "json-buffer": "json-buffer@3.0.1" - } - }, - "lowercase-keys@2.0.0": { - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dependencies": {} - }, - "lucid-cardano@0.10.7": { - "integrity": "sha512-hxJRMWj8VH+SGFqsVMG6T3LSRuxzwFbWOQ5DTGQQUyR/20FL7bjiVL+2ivMJF52tAbFKcwqpRD4fddR7LbqcAw==", - "dependencies": { - "@peculiar/webcrypto": "@peculiar/webcrypto@1.4.3", - "node-fetch": "node-fetch@3.3.2", - "ws": "ws@8.15.1" - } - }, - "mime-db@1.52.0": { - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dependencies": {} - }, - "mime-types@2.1.35": { - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "mime-db@1.52.0" - } - }, - "mimic-response@1.0.1": { - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dependencies": {} - }, - "mimic-response@3.1.0": { - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "dependencies": {} - }, - "nanoassert@1.1.0": { - "integrity": "sha512-C40jQ3NzfkP53NsO8kEOFd79p4b9kDXQMwgiY1z8ZwrDZgUyom0AHwGegF4Dm99L+YoYhuaB0ceerUcXmqr1rQ==", - "dependencies": {} - }, - "node-domexception@1.0.0": { - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "dependencies": {} - }, - "node-fetch@3.3.2": { - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "dependencies": { - "data-uri-to-buffer": "data-uri-to-buffer@4.0.1", - "fetch-blob": "fetch-blob@3.2.0", - "formdata-polyfill": "formdata-polyfill@4.0.10" - } - }, - "nofilter@3.1.0": { - "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", - "dependencies": {} - }, - "normalize-url@6.1.0": { - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", - "dependencies": {} - }, - "once@1.4.0": { - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dependencies": { - "wrappy": "wrappy@1.0.2" - } - }, - "p-cancelable@2.1.1": { - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", - "dependencies": {} - }, - "pump@3.0.0": { - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dependencies": { - "end-of-stream": "end-of-stream@1.4.4", - "once": "once@1.4.0" - } - }, - "punycode@2.3.1": { - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dependencies": {} - }, - "pvtsutils@1.3.5": { - "integrity": "sha512-ARvb14YB9Nm2Xi6nBq1ZX6dAM0FsJnuk+31aUp4TrcZEdKUlSqOqsxJHUPJDNE3qiIp+iUPEIeR6Je/tgV7zsA==", - "dependencies": { - "tslib": "tslib@2.6.2" - } - }, - "pvutils@1.1.3": { - "integrity": "sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==", - "dependencies": {} - }, - "quick-lru@5.1.1": { - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "dependencies": {} - }, - "require-from-string@2.0.2": { - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dependencies": {} - }, - "resolve-alpn@1.2.1": { - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", - "dependencies": {} - }, - "responselike@2.0.1": { - "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", - "dependencies": { - "lowercase-keys": "lowercase-keys@2.0.0" - } - }, - "tslib@2.6.2": { - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dependencies": {} - }, - "uri-js@4.4.1": { - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dependencies": { - "punycode": "punycode@2.3.1" - } - }, - "web-streams-polyfill@3.2.1": { - "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", - "dependencies": {} - }, - "webcrypto-core@1.7.7": { - "integrity": "sha512-7FjigXNsBfopEj+5DV2nhNpfic2vumtjjgPmeDKk45z+MJwXKKfhPB7118Pfzrmh4jqOMST6Ch37iPAHoImg5g==", - "dependencies": { - "@peculiar/asn1-schema": "@peculiar/asn1-schema@2.3.8", - "@peculiar/json-schema": "@peculiar/json-schema@1.1.12", - "asn1js": "asn1js@3.0.5", - "pvtsutils": "pvtsutils@1.3.5", - "tslib": "tslib@2.6.2" - } - }, - "wrappy@1.0.2": { - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dependencies": {} - }, - "ws@8.15.1": { - "integrity": "sha512-W5OZiCjXEmk0yZ66ZN82beM5Sz7l7coYxpRkzS+p9PP+ToQry8szKh+61eNktr7EA9DOwvFGhfC605jDHbP6QQ==", - "dependencies": {} - }, - "yaml@2.3.4": { - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", - "dependencies": {} - } - } - }, - "remote": { - "https://deno.land/std@0.100.0/encoding/hex.ts": "f952e0727bddb3b2fd2e6889d104eacbd62e92091f540ebd6459317a61932d9b", - "https://deno.land/std@0.148.0/bytes/equals.ts": "3c3558c3ae85526f84510aa2b48ab2ad7bdd899e2e0f5b7a8ffc85acb3a6043a", - "https://deno.land/std@0.148.0/bytes/mod.ts": "763f97d33051cc3f28af1a688dfe2830841192a9fea0cbaa55f927b49d49d0bf", - "https://deno.land/std@0.153.0/hash/sha256.ts": "aa9479c260f41b72c639f36c3e4bc9319940b5d2e52fe793ebe3dc646d12832f", - "https://deno.land/std@0.201.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee", - "https://deno.land/std@0.201.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56", - "https://deno.land/std@0.201.0/crypto/_fnv/fnv32.ts": "e4649dfdefc5c987ed53c3c25db62db771a06d9d1b9c36d2b5cf0853b8e82153", - "https://deno.land/std@0.201.0/crypto/_fnv/fnv64.ts": "bfa0e4702061fdb490a14e6bf5f9168a22fb022b307c5723499469bfefca555e", - "https://deno.land/std@0.201.0/crypto/_fnv/mod.ts": "f956a95f58910f223e420340b7404702ecd429603acd4491fa77af84f746040c", - "https://deno.land/std@0.201.0/crypto/_fnv/util.ts": "accba12bfd80a352e32a872f87df2a195e75561f1b1304a4cb4f5a4648d288f9", - "https://deno.land/std@0.201.0/crypto/_wasm/lib/deno_std_wasm_crypto.generated.mjs": "85b50eee2e511584698c04f1d84155e57452ea963106fee64987c326e9e5d25d", - "https://deno.land/std@0.201.0/crypto/_wasm/mod.ts": "973058e70052c98292b567d1c8396dffc28d6dfc6a44f0763032f6fbdf5222f5", - "https://deno.land/std@0.201.0/crypto/crypto.ts": "c1fac13f11e5150e7690a4d6f09bc09b39d0a13fc5cf129f13617656fea7379e", - "https://deno.land/std@0.201.0/crypto/keystack.ts": "877ab0f19eb7d37ad6495190d3c3e39f58e9c52e0b6a966f82fd6df67ca55f90", - "https://deno.land/std@0.201.0/crypto/mod.ts": "ae384519e85eca9aeff4e7111ed153df8f3dbda7b35b70850ed4b3e9c8cec4d5", - "https://deno.land/std@0.201.0/crypto/timing_safe_equal.ts": "f6edc08d702f660b1ab3505b74d53a9d499e34a1351f6ab70f5ce8653fee8fb7", - "https://deno.land/std@0.201.0/crypto/to_hash_string.ts": "6927c768f3e373a1be4a31555a45ccecf7bd413105455cc334ad3f908cfa986f", - "https://deno.land/std@0.201.0/encoding/base64.ts": "144ae6234c1fbe5b68666c711dc15b1e9ee2aef6d42b3b4345bf9a6c91d70d0d", - "https://deno.land/std@0.201.0/encoding/base64url.ts": "2ed4ba122b20fedf226c5d337cf22ee2024fa73a8f85d915d442af7e9ce1fae1", - "https://deno.land/std@0.201.0/encoding/hex.ts": "7894f92cd271a3df42012798310fe011ae8780d551b6538189937d1712094f14", - "https://deno.land/x/lucid@0.10.7/mod.ts": "9473507398048cb24dbb37b3a220777106c69c28d573898648deb2bb84a7e131", - "https://deno.land/x/lucid@0.10.7/package.json": "402ef25f1bcbf29c57b24f4737637db8470dc9197e80478455ec132a7a08a0cc", - "https://deno.land/x/lucid@0.10.7/src/core/core.ts": "5b2f6d4746933a425bfcb134a55b84c946bc2ddd98b795aa9189f345778b113c", - "https://deno.land/x/lucid@0.10.7/src/core/libs/cardano_message_signing/cardano_message_signing.generated.js": "b3cae6f286d855a1cf9c84987026bfa46f577e9edd6b269127e88c0f41d68bfa", - "https://deno.land/x/lucid@0.10.7/src/core/libs/cardano_multiplatform_lib/cardano_multiplatform_lib.generated.js": "286312109897e46032173ab3a0a233212ea0741051bcba936914ac7af8f22227", - "https://deno.land/x/lucid@0.10.7/src/core/mod.ts": "978b94101791fdad3113e5a9fa3813b1f48a8e505f68da14bcad72668b294926", - "https://deno.land/x/lucid@0.10.7/src/lucid/lucid.ts": "80f06b1965074a6c3504d509df676f2508d49cc0a8050dee1b1f8ea804fb565a", - "https://deno.land/x/lucid@0.10.7/src/lucid/message.ts": "b16bb7c06cbc81c777ac116d95db32959af42bc093ebe86b65f2dbc28b75f9b2", - "https://deno.land/x/lucid@0.10.7/src/lucid/mod.ts": "94bfe48ee683e932a67347786a1253a2e7277e53b1dc192d045d70bc5ce9bc10", - "https://deno.land/x/lucid@0.10.7/src/lucid/tx.ts": "5833f0cb10bcd83439e7caff03c20296b8e646ce1d3797e9db56f3fdcfe33e19", - "https://deno.land/x/lucid@0.10.7/src/lucid/tx_complete.ts": "a687e19df52072fe239af33081cfddf2fba40011324ff86f3352042940a65362", - "https://deno.land/x/lucid@0.10.7/src/lucid/tx_signed.ts": "58edce3295e5fa14977120d887b43796ebd40893caaf012d441a8b56909c8ae1", - "https://deno.land/x/lucid@0.10.7/src/misc/bip39.ts": "7dc0f49f96d43a254a048a956cac31ef8c8045f69f3b8dbc5350bc6c601441eb", - "https://deno.land/x/lucid@0.10.7/src/misc/crc8.ts": "c9abda52851d5c575f6a8714c3600d2e63bb8cfc942e035486b1ab03b780e2f9", - "https://deno.land/x/lucid@0.10.7/src/misc/sign_data.ts": "6f5066d19455ade77615b5cbbf5dd9947ea691a7b764f96c81ba911cc84183e5", - "https://deno.land/x/lucid@0.10.7/src/misc/wallet.ts": "7a8d63c234f0741dc49d3134554b7c455e24f4692ba42a3843aad7e37bcc7d2b", - "https://deno.land/x/lucid@0.10.7/src/mod.ts": "f4156883dc0dc394e9fd9e9e7222537a61ff8b2781a88761d7bcb65123a16bcf", - "https://deno.land/x/lucid@0.10.7/src/plutus/data.ts": "b6eb205124e6f340f47dd789d94d91146b2bf038c6a76b57ede12874b60d5920", - "https://deno.land/x/lucid@0.10.7/src/plutus/mod.ts": "3a7f784e950348d447cd6bcb27546b20902fae167e04fd42e67bfad57216e1a7", - "https://deno.land/x/lucid@0.10.7/src/plutus/time.ts": "f142f03f897a6e57625e8c0752bb73397818090871f3cff123ec64311590b6f9", - "https://deno.land/x/lucid@0.10.7/src/provider/blockfrost.ts": "7cd49ed72464f3faf3c4bc93b54a1c30dbe0f34035b3c5e844adfdeb3ca74e32", - "https://deno.land/x/lucid@0.10.7/src/provider/emulator.ts": "066892a5dfbe27bde86d449650913da18da8025bd618c7cfed0a6fc16e07bb29", - "https://deno.land/x/lucid@0.10.7/src/provider/kupmios.ts": "e15178e252d5a87b6c6123e51c3dc426ec7ebe02bac920dea26213f62eabcbd0", - "https://deno.land/x/lucid@0.10.7/src/provider/maestro.ts": "76c379f946bdc2198ccf6898ce1b09ed5a6ddb1d858f0abe2b39e5300aa7a6c1", - "https://deno.land/x/lucid@0.10.7/src/provider/mod.ts": "76b36094551556045e851fe0ba6012626e1a08c03dec62a21b69d22311266379", - "https://deno.land/x/lucid@0.10.7/src/types/global.ts": "3ea23ebcf9af819a01cbcf682856df2b178929ffec362113d24eb4a80a966ac3", - "https://deno.land/x/lucid@0.10.7/src/types/mod.ts": "2e6e4ffd7077025d1b45af726756455fc9c915666dd7f23a041be058039b49c6", - "https://deno.land/x/lucid@0.10.7/src/types/types.ts": "b637a944c04576c42c2bb5df98aa8128cd4677e04fa0ec911e042ce96e764fa2", - "https://deno.land/x/lucid@0.10.7/src/utils/cost_model.ts": "f04e4d393062b0057f703e37ddcb1aa9fe378b589134c679688f9786235a25ee", - "https://deno.land/x/lucid@0.10.7/src/utils/merkle_tree.ts": "af39a9167eb8b083a19a980916c95ab40332e959ef20bc43fdfef69eef08e594", - "https://deno.land/x/lucid@0.10.7/src/utils/mod.ts": "7e405bfa0db96d9e995e67fb77251e8465843addf141caf4ce64b3efa6077822", - "https://deno.land/x/lucid@0.10.7/src/utils/utils.ts": "177ec0578b788f947f6afb6cc911c4eae776aaf98b5249412a750b8f366b4d11", - "https://deno.land/x/typebox@0.25.13/src/typebox.ts": "9b20b62c0bf31f1a9128b6dc6dfd470a5d956a48f0b0ef0a1ccc4d794fb55dcc" - } -} diff --git a/offchain/route-swap-order.ts b/offchain/route-swap-order.ts deleted file mode 100644 index 69e23e4..0000000 --- a/offchain/route-swap-order.ts +++ /dev/null @@ -1,168 +0,0 @@ -import { Address, Constr, Data, Network } from "lucid"; -import { - blockFrostKey, - lucid, - minSwapAddress, - routingContract, - routingContractAddress, - userAddress, -} from "./config.ts"; -import { - BlockfrostAdapter, - calculateSwapExactIn, - MetadataMessage, - NetworkId, - OrderDatum, - OrderStepType, - PoolDatum, - PoolState, -} from "minswap"; -import { BlockFrostAPI } from "blockfrost"; -import { AddressD, SmartHandleDatum } from "./common.ts"; - -// ID of ADA-MIN Pool on Testnet Preprod -const poolId = - "3bb0079303c57812462dec9de8fb867cef8fd3768de7f12c77f6f0dd80381d0d"; - -const blockfrostAdapter = new BlockfrostAdapter({ - blockFrost: new BlockFrostAPI({ - projectId: blockFrostKey, - network: "preprod", - }), -}); - -const { poolState, poolDatum } = await getPoolById( - "Preprod", - blockfrostAdapter, - poolId, -); - -// After adjusting 2 ADA for Batcher fee and Deposit each from 50 ADA -const swapAmountADA = 46_000_000n; - -const { amountOut } = calculateSwapExactIn({ - amountIn: swapAmountADA, - reserveIn: poolState.reserveA, - reserveOut: poolState.reserveB, -}); - -// Because pool is always fluctuating, so you should determine the impact of amount which you will receive -const slippageTolerance = 20n; -const acceptedAmount = (amountOut * (100n - slippageTolerance)) / 100n; - -const scriptUTxOs = await lucid.utxosAt(routingContractAddress); -// console.log(JSON.stringify(scriptUTxOs, bigIntReplacer)); -const utxo = scriptUTxOs[0]; - -let ownerAddress: string; -try { - const datum = Data.from(utxo.datum!, SmartHandleDatum); - ownerAddress = toAddress(datum?.owner); -} catch (error) { - console.error( - `Error occured while deserializing Script UTxO datum. - Datum: ${utxo.datum}` + error.message, - ); -} - -console.log(`Routing Script UTxO: ${JSON.stringify(utxo, bigIntReplacer)} -ownerAddress: ${ownerAddress!}`); - -const datum: OrderDatum = { - sender: ownerAddress!, - receiver: ownerAddress!, - receiverDatumHash: undefined, - step: { - type: OrderStepType.SWAP_EXACT_IN, - desiredAsset: poolDatum.assetB, - minimumReceived: acceptedAmount, - }, - batcherFee: 2_000_000n, - depositADA: 2_000_000n, -}; -const datumCbor = Data.to(OrderDatum.toPlutusData(datum)); - -// Swap ( { ownIndex, routerIndex } ) -const routerRedeemer = Data.to(new Constr(0, [0n, 0n])); - -const tx = await lucid - .newTx() - .collectFrom([utxo], routerRedeemer) - .payToContract( - minSwapAddress, - datumCbor, - { lovelace: 49_000_000n }, - ) - .attachSpendingValidator(routingContract) - .attachMetadata(674, { msg: [MetadataMessage.SWAP_EXACT_IN_ORDER] }) - .complete({ change: { address: userAddress } }); // (routing fee - tx costs) to user wallet as user is the router here - -const signedTx = await tx.sign().complete(); -const txHash = await signedTx.submit(); -await lucid.awaitTx(txHash); - -console.log(`Successfully sent swap order with 49 ADA -from routingContract: ${routingContractAddress}, -to Minswap address: ${minSwapAddress} -in tx: ${txHash}`); - -async function getPoolById( - network: Network, - blockfrostAdapter: BlockfrostAdapter, - poolId: string, -): Promise<{ poolState: PoolState; poolDatum: PoolDatum }> { - const pool = await blockfrostAdapter.getPoolById({ - id: poolId, - }); - if (!pool) { - throw new Error(`Not found PoolState of ID: ${poolId}`); - } - - const rawRoolDatum = await blockfrostAdapter.getDatumByDatumHash( - pool.datumHash, - ); - const poolDatum = PoolDatum.fromPlutusData( - network === "Mainnet" ? NetworkId.MAINNET : NetworkId.TESTNET, - Data.from(rawRoolDatum) as Constr, - ); - return { - poolState: pool, - poolDatum: poolDatum, - }; -} - -export function toAddress(address: AddressD): Address { - const paymentCredential = (() => { - if ("PublicKeyCredential" in address.paymentCredential) { - return lucid.utils.keyHashToCredential( - address.paymentCredential.PublicKeyCredential[0], - ); - } else { - return lucid.utils.scriptHashToCredential( - address.paymentCredential.ScriptCredential[0], - ); - } - })(); - const stakeCredential = (() => { - if (!address.stakeCredential) return undefined; - if ("Inline" in address.stakeCredential) { - if ("PublicKeyCredential" in address.stakeCredential.Inline[0]) { - return lucid.utils.keyHashToCredential( - address.stakeCredential.Inline[0].PublicKeyCredential[0], - ); - } else { - return lucid.utils.scriptHashToCredential( - address.stakeCredential.Inline[0].ScriptCredential[0], - ); - } - } else { - return undefined; - } - })(); - return lucid.utils.credentialToAddress(paymentCredential, stakeCredential); -} - -// Parameter to 'JSON.stringify()' to help with bigint conversion -export function bigIntReplacer(_k: any, v: any) { - return typeof v === "bigint" ? v.toString() : v; -} diff --git a/smart-handles.cabal b/smart-handles.cabal index f932667..ba71501 100644 --- a/smart-handles.cabal +++ b/smart-handles.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: smart-handles -version: 0.1.0.0 +version: 0.3.0.0 -- A short (one-line) description of the package. -- synopsis: diff --git a/src/BatchValidator.hs b/src/BatchValidator.hs index 09a8468..cb00a1b 100644 --- a/src/BatchValidator.hs +++ b/src/BatchValidator.hs @@ -2,30 +2,29 @@ module BatchValidator where import PlutusTx qualified -import Plutarch.Api.V1.Address (PCredential (..)) import Plutarch.Api.V1.AssocMap qualified as AssocMap -import Plutarch.Api.V2 (PStakingCredential, PValidator) +import Plutarch.Api.V2 (PScriptContext, PStakingCredential, PValidator) import Plutarch.DataRepr import Plutarch.Lift (PConstantDecl, PUnsafeLiftDecl (..)) import Plutarch.Monadic qualified as P import Plutarch.Prelude -import SingleValidator (PSmartHandleDatum) -import Utils (pconvertChecked, pconvertUnsafe) +import SingleValidator (PSmartHandleDatum (PAdvanced, PSimple)) +import Utils (pconvertChecked, pconvertUnsafe, psignedByOwner) data SmartRedeemer - = SwapSmart + = RouteSmart | ReclaimSmart PlutusTx.makeLift ''SmartRedeemer PlutusTx.makeIsDataIndexed ''SmartRedeemer - [ ('SwapSmart, 0) + [ ('RouteSmart, 0) , ('ReclaimSmart, 1) ] data PSmartRedeemer (s :: S) - = PSwapSmart (Term s (PDataRecord '[])) + = PRouteSmart (Term s (PDataRecord '[])) | PReclaimSmart (Term s (PDataRecord '[])) deriving stock (Generic) deriving anyclass (PlutusType, PIsData) @@ -38,23 +37,24 @@ instance PTryFrom PData PSmartRedeemer instance PUnsafeLiftDecl PSmartRedeemer where type PLifted PSmartRedeemer = SmartRedeemer deriving via (DerivePConstantViaData SmartRedeemer PSmartRedeemer) instance PConstantDecl SmartRedeemer +passertStakeScriptIsInvoked :: Term s (PScriptContext :--> PStakingCredential :--> POpaque) +passertStakeScriptIsInvoked = plam $ \ctx stakeScript -> P.do + ctxF <- pletFields @'["txInfo"] ctx + let stakeCerts = pfield @"wdrl" # ctxF.txInfo + pmatch (AssocMap.plookup # stakeScript # stakeCerts) $ \case + PJust _ -> (popaque $ pconstant ()) + PNothing -> perror + smartHandleRouteValidatorW :: Term s (PStakingCredential :--> PValidator) smartHandleRouteValidatorW = phoistAcyclic $ plam $ \stakeScript datum redeemer ctx -> P.do let red = pconvertUnsafe @PSmartRedeemer redeemer dat = pconvertChecked @PSmartHandleDatum datum - ctxF <- pletFields @'["txInfo"] ctx pmatch red $ \case - PSwapSmart _ -> - let stakeCerts = pfield @"wdrl" # ctxF.txInfo - in pmatch (AssocMap.plookup # stakeScript # stakeCerts) $ \case - PJust _ -> (popaque $ pconstant ()) - PNothing -> perror + PRouteSmart _ -> + passertStakeScriptIsInvoked # ctx # stakeScript PReclaimSmart _ -> - pmatch (pfield @"credential" # (pfield @"owner" # dat)) $ \case - PPubKeyCredential ((pfield @"_0" #) -> pkh) -> - ( pif - (pelem @PBuiltinList # pkh # (pfield @"signatories" # ctxF.txInfo)) - (popaque $ pconstant ()) - perror - ) - PScriptCredential _ -> perror -- TODO: is it refundable for a script? + pmatch dat $ \case + PSimple ((pfield @"owner" #) -> owner) -> + popaque $ psignedByOwner # ctx # owner + PAdvanced _ -> + passertStakeScriptIsInvoked # ctx # stakeScript diff --git a/src/Constants.hs b/src/Constants.hs index 1509ac7..7460a89 100644 --- a/src/Constants.hs +++ b/src/Constants.hs @@ -3,8 +3,12 @@ module Constants where import Plutarch.Api.V1.Value (AmountGuarantees (..), KeyGuarantees (..), PValue, padaSymbol, padaToken, psingleton) import Plutarch.Prelude (PInteger, Term, (#)) -routerFeeAsNegativeLovelace :: Term s PInteger -routerFeeAsNegativeLovelace = -1_000_000 +routerFeeForSimpleRoutes :: Term s PInteger +routerFeeForSimpleRoutes = 1_000_000 + +negativeRouterFeeForSimpleRoutes :: Term s PInteger +negativeRouterFeeForSimpleRoutes = -1_000_000 routerFeeAsNegativeValue :: Term s (PValue 'Sorted 'NonZero) -routerFeeAsNegativeValue = psingleton # padaSymbol # padaToken # routerFeeAsNegativeLovelace +routerFeeAsNegativeValue = + psingleton # padaSymbol # padaToken # negativeRouterFeeForSimpleRoutes diff --git a/src/SingleValidator.hs b/src/SingleValidator.hs index 056f930..3a5649f 100644 --- a/src/SingleValidator.hs +++ b/src/SingleValidator.hs @@ -1,19 +1,20 @@ module SingleValidator where -import PlutusLedgerApi.V2 (Address (..)) +import PlutusLedgerApi.V2 (Address) import PlutusTx qualified import Plutarch.Api.V1.Address (PCredential (..)) -import Plutarch.Api.V1.Value (pforgetPositive) -import Plutarch.Api.V2 (PAddress, PDatum, PScriptContext, PScriptHash, PScriptPurpose (..), PTxInInfo, PTxOut, PTxOutRef, PValidator) +import Plutarch.Api.V2 (PAddress, PMaybeData (..), PScriptContext, PScriptHash, PScriptPurpose (..), PTxInInfo, PTxOut, PTxOutRef, PValidator) import Plutarch.DataRepr import Plutarch.Lift (PConstantDecl, PUnsafeLiftDecl (..)) import Plutarch.Monadic qualified as P +import Plutarch.Num (PNum (pnegate)) import Plutarch.Prelude +import Plutarch.Unsafe (punsafeCoerce) import "liqwid-plutarch-extra" Plutarch.Extra.ScriptContext () -import Constants -import Utils +import Constants (negativeRouterFeeForSimpleRoutes, routerFeeForSimpleRoutes) +import Utils (PCustomValidator, PRequiredMint (..), RequiredMint, pand'List, papplyRequiredMintToInputValue, pconvertChecked, pconvertUnsafe, presolveDatum, psignedByOwner, pvalueHasChangedByLovelaces) pcountInputsAtScript :: Term s (PScriptHash :--> PBuiltinList PTxInInfo :--> PInteger) pcountInputsAtScript = @@ -30,26 +31,44 @@ pcountInputsAtScript = n in go # 0 -data SmartHandleDatum = SmartHandleDatum - { owner :: Address - , extraInfo :: PlutusTx.BuiltinData - } +data SmartHandleDatum + = Simple Address -- <-- owner + | Advanced (Maybe Address) Integer Integer RequiredMint RequiredMint PlutusTx.BuiltinData + +-- ^-------------^ ^-----^ ^-----^ ^------------------^ +-- mOwner routerFee reclaimRouterFee extraInfo PlutusTx.makeLift ''SmartHandleDatum -PlutusTx.makeIsDataIndexed ''SmartHandleDatum [('SmartHandleDatum, 0)] +PlutusTx.makeIsDataIndexed + ''SmartHandleDatum + [ ('Simple, 0) + , ('Advanced, 1) + ] data PSmartHandleDatum (s :: S) - = PSmartHandleDatum + = PSimple ( Term s ( PDataRecord '[ "owner" ':= PAddress + ] + ) + ) + | PAdvanced + ( Term + s + ( PDataRecord + '[ "mOwner" ':= PMaybeData PAddress + , "routerFee" ':= PInteger + , "reclaimRouterFee" ':= PInteger + , "routeRequiredMint" ':= PRequiredMint + , "reclaimRequiredMint" ':= PRequiredMint , "extraInfo" ':= PData ] ) ) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PDataFields) + deriving anyclass (PlutusType, PIsData) instance DerivePlutusType PSmartHandleDatum where type DPTStrat _ = PlutusTypeData @@ -60,22 +79,28 @@ instance PUnsafeLiftDecl PSmartHandleDatum where type PLifted PSmartHandleDatum deriving via (DerivePConstantViaData SmartHandleDatum PSmartHandleDatum) instance PConstantDecl SmartHandleDatum data SmartHandleRedeemer - = Swap + = Route { ownIndex :: Integer , routerIndex :: Integer } | Reclaim + | AdvancedReclaim + { ownIndex :: Integer + , routerIndex :: Integer + } PlutusTx.makeLift ''SmartHandleRedeemer PlutusTx.makeIsDataIndexed ''SmartHandleRedeemer - [ ('Swap, 0) + [ ('Route, 0) , ('Reclaim, 1) + , ('AdvancedReclaim, 2) ] data PSmartHandleRedeemer (s :: S) - = PSwap (Term s (PDataRecord '["ownIndex" ':= PInteger, "routerIndex" ':= PInteger])) + = PRoute (Term s (PDataRecord '["ownIndex" ':= PInteger, "routerIndex" ':= PInteger])) | PReclaim (Term s (PDataRecord '[])) + | PAdvancedReclaim (Term s (PDataRecord '["ownIndex" ':= PInteger, "routerIndex" ':= PInteger])) deriving stock (Generic) deriving anyclass (PlutusType, PIsData) @@ -129,48 +154,90 @@ ptryOwnInput = phoistAcyclic $ (const perror) # inputs -psmartHandleValidatorW :: Term s ((PAddress :--> PData :--> PDatum :--> PBool) :--> PAddress :--> PValidator) -psmartHandleValidatorW = phoistAcyclic $ plam $ \validateFn swapAddress dat red ctx -> +psmartHandleValidatorW :: Term s (PCustomValidator :--> PAddress :--> PValidator) +psmartHandleValidatorW = phoistAcyclic $ plam $ \validateFn routeAddress dat red ctx -> let datum = pconvertChecked @PSmartHandleDatum dat redeemer = pconvertUnsafe @PSmartHandleRedeemer red - in popaque $ psmartHandleValidator # validateFn # swapAddress # datum # redeemer # ctx - -psmartHandleValidator :: Term s ((PAddress :--> PData :--> PDatum :--> PBool) :--> PAddress :--> PSmartHandleDatum :--> PSmartHandleRedeemer :--> PScriptContext :--> PUnit) -psmartHandleValidator = phoistAcyclic $ plam $ \validateFn swapAddress dat red ctx -> pmatch red $ \case - PSwap r -> - pletFields @'["ownIndex", "routerIndex"] r $ \redF -> - pswapRouter # validateFn # swapAddress # dat # redF.ownIndex # redF.routerIndex # ctx + in popaque $ psmartHandleValidator # validateFn # routeAddress # datum # redeemer # ctx + +psmartHandleValidator :: Term s (PCustomValidator :--> PAddress :--> PSmartHandleDatum :--> PSmartHandleRedeemer :--> PScriptContext :--> PUnit) +psmartHandleValidator = phoistAcyclic $ plam $ \validateFn routeAddress dat red ctx -> pmatch red $ \case + PRoute r -> + pmatch dat $ \case + PSimple _ -> + pletFields @'["ownIndex", "routerIndex"] r $ \redF -> P.do + prouter # validateFn # routeAddress # dat # redF.ownIndex # redF.routerIndex # pcon PTrue # ctx + PAdvanced _ -> P.do + pletFields @'["ownIndex", "routerIndex", "advancedRedeemer"] r $ \redF -> P.do + prouter # validateFn # routeAddress # dat # redF.ownIndex # redF.routerIndex # pcon PTrue # ctx PReclaim _ -> - pmatch (pfield @"credential" # (pfield @"owner" # dat)) $ \case - PPubKeyCredential ((pfield @"_0" #) -> pkh) -> - ( pif - (pelem @PBuiltinList # pkh # (pfield @"signatories" # (pfield @"txInfo" # ctx))) - (pconstant ()) - perror - ) - _ -> perror - -pswapRouter :: Term s ((PAddress :--> PData :--> PDatum :--> PBool) :--> PAddress :--> PSmartHandleDatum :--> PInteger :--> PInteger :--> PScriptContext :--> PUnit) -pswapRouter = phoistAcyclic $ plam $ \validateFn swapAddress dat ownIndex routerIndex ctx -> P.do - datF <- pletFields @'["owner", "extraInfo"] dat + pmatch dat $ \case + PSimple ((pfield @"owner" #) -> owner) -> + pif (psignedByOwner # ctx # owner) (pconstant ()) perror + PAdvanced _ -> + perror + PAdvancedReclaim r -> + pmatch dat $ \case + PSimple _ -> + perror + PAdvanced dat' -> + pletFields @'["ownIndex", "routerIndex"] r $ \redF -> + pletFields @'["mOwner", "routerFee", "extraInfo"] dat' $ \datF -> P.do + pmatch datF.mOwner $ \case + PDJust ((pfield @"_0" #) -> owner) -> + prouter # validateFn # owner # dat # redF.ownIndex # redF.routerIndex # pcon PFalse # ctx + PDNothing _ -> + perror + +prouter :: + Term + s + ( PCustomValidator + :--> PAddress + :--> PSmartHandleDatum + :--> PInteger + :--> PInteger + :--> PBool + :--> PScriptContext + :--> PUnit + ) +prouter = phoistAcyclic $ plam $ \validateFn routeAddress dat ownIndex routerIndex forRoute ctx -> P.do ctxF <- pletFields @'["txInfo", "purpose"] ctx - infoF <- pletFields @'["inputs", "outputs", "signatories", "datums"] ctxF.txInfo + infoF <- pletFields @'["inputs", "outputs", "signatories", "datums", "mint"] ctxF.txInfo PSpending ((pfield @"_0" #) -> ownRef) <- pmatch ctxF.purpose indexedInput <- pletFields @'["outRef", "resolved"] (pelemAt @PBuiltinList # ownIndex # infoF.inputs) ownInputF <- pletFields @'["value", "address"] indexedInput.resolved PScriptCredential ((pfield @"_0" #) -> ownValHash) <- pmatch (pfield @"credential" # ownInputF.address) - swapOutputF <- pletFields @'["datum", "value", "address"] (pelemAt @PBuiltinList # routerIndex # infoF.outputs) + routerOutputF <- pletFields @'["datum", "value", "address"] (pelemAt @PBuiltinList # routerIndex # infoF.outputs) - let outputDatum = presolveDatum # swapOutputF.datum # infoF.datums + let outputDatum = presolveDatum # routerOutputF.datum # infoF.datums pif ( pand'List - [ ptraceIfFalse "Incorrect indexed input" (ownRef #== indexedInput.outRef) - , ptraceIfFalse "Incorrect Swap Address" (swapOutputF.address #== swapAddress) - , ptraceIfFalse "Incorrect Swap Output Value" (pforgetPositive swapOutputF.value #== (pforgetPositive ownInputF.value <> routerFeeAsNegativeValue)) - , ptraceIfFalse "Multiple script inputs spent" (pcountInputsAtScript # ownValHash # infoF.inputs #== 1) - , validateFn # datF.owner # datF.extraInfo # outputDatum + [ ptraceIfFalse "Incorrect Indexed Input" (ownRef #== indexedInput.outRef) + , ptraceIfFalse "Incorrect Route Address" (routerOutputF.address #== routeAddress) + , ptraceIfFalse "Multiple Script Inputs Spent" (pcountInputsAtScript # ownValHash # infoF.inputs #== 1) + , pmatch dat $ \case + PSimple ((pfield @"owner" #) -> owner) -> + pand'List + [ validateFn # pcon (PDJust $ pdcons # pdata owner # pdnil) # routerFeeForSimpleRoutes # ownInputF.value # punsafeCoerce (pconstant ()) # outputDatum # forRoute # ctx + , ptraceIfFalse "Incorrect Route Output Value" (pvalueHasChangedByLovelaces # ownInputF.value # routerOutputF.value # negativeRouterFeeForSimpleRoutes) + ] + PAdvanced dat' -> P.do + datF <- pletFields @'["mOwner", "routerFee", "reclaimRouterFee", "routeRequiredMint", "reclaimRequiredMint", "extraInfo"] dat' + let inputIncludingMint = + papplyRequiredMintToInputValue + infoF.mint + (pif forRoute datF.routeRequiredMint datF.reclaimRequiredMint) + ownInputF.value + routerFee <- plet $ pif forRoute datF.routerFee datF.reclaimRouterFee + pand'List + [ validateFn # datF.mOwner # routerFee # ownInputF.value # datF.extraInfo # outputDatum # forRoute # ctx + , ptraceIfFalse + "Incorrect Route Output Value" + (pvalueHasChangedByLovelaces # inputIncludingMint # routerOutputF.value # (pnegate # routerFee)) + ] ] ) (pconstant ()) diff --git a/src/Specialized/Minswap.hs b/src/Specialized/Minswap.hs index ce5115a..eb9fdce 100644 --- a/src/Specialized/Minswap.hs +++ b/src/Specialized/Minswap.hs @@ -4,7 +4,7 @@ import PlutusLedgerApi.V1.Value (AssetClass) import PlutusLedgerApi.V2 (Address (..), Credential (..), CurrencySymbol, DatumHash, PubKeyHash, StakingCredential (..), TokenName) import PlutusTx qualified -import Plutarch.Api.V2 (PAddress, PCurrencySymbol, PDatum, PDatumHash, PMaybeData (..), PPubKeyHash, PScriptContext, PStakeValidator, PTokenName) +import Plutarch.Api.V2 (PAddress, PCurrencySymbol, PDatumHash, PMaybeData (..), PPubKeyHash, PScriptContext, PStakeValidator, PTokenName) import Plutarch.DataRepr import Plutarch.Lift (PConstantDecl, PUnsafeLiftDecl (..)) import Plutarch.Monadic qualified as P @@ -101,6 +101,8 @@ deriving via (DerivePConstantViaData MinswapRequestDatum PMinswapRequestDatum) i data MinswapRequestInfo = MinswapRequestInfo { desiredAssetSymbol :: CurrencySymbol , desiredAssetTokenName :: TokenName + , receiverDatumHash :: Maybe DatumHash + , minimumReceive :: Integer } PlutusTx.makeLift ''MinswapRequestInfo @@ -113,6 +115,8 @@ data PMinswapRequestInfo (s :: S) ( PDataRecord '[ "desiredAssetSymbol" ':= PCurrencySymbol , "desiredAssetTokenName" ':= PTokenName + , "receiverDatumHash" ':= PMaybeData (PAsData PDatumHash) + , "minimumReceive" ':= PInteger ] ) ) @@ -159,28 +163,34 @@ minSwapAddress = orderAddr = Address (ScriptCredential orderCred) (Just (StakingHash orderStakeCred)) in pconstant orderAddr -validateFn :: Term s (PAddress :--> PData :--> PDatum :--> PBool) -validateFn = plam $ \owner extraInfoData outputDatum -> P.do - let extraInfo = pconvertUnsafe @PMinswapRequestInfo extraInfoData - outDatum = pconvertChecked @PMinswapRequestDatum (pto outputDatum) - extraInfoF <- pletFields @'["desiredAssetSymbol", "desiredAssetTokenName"] extraInfo - outDatumF <- pletFields @'["sender", "receiver", "receiverDatumHash", "step", "batcherFee", "outputAda"] outDatum - orderStepF <- pletFields @'["desiredAsset", "minReceive"] outDatumF.step - desiredAssetF <- pletFields @'["cs", "tn"] orderStepF.desiredAsset - pand'List - [ ptraceIfFalse "Incorrect Swap Sender" (outDatumF.sender #== owner) - , ptraceIfFalse "Incorrect Swap Receiver" (outDatumF.receiver #== owner) - , ptraceIfFalse - "Incorrect ReceiverDatumHash" - ( pmatch outDatumF.receiverDatumHash $ \case - PDJust _ -> pconstant False - PDNothing _ -> pconstant True +validateFn :: Term s PCustomValidator +validateFn = plam $ \mOwner _routingFee _inputValue extraInfoData outputDatum forRoute ctx -> + pmatch mOwner $ \case + PDJust ((pfield @"_0" #) -> owner) -> + pif + forRoute + ( let + extraInfo = pconvertUnsafe @PMinswapRequestInfo extraInfoData + outDatum = pconvertChecked @PMinswapRequestDatum (pto outputDatum) + in + P.do + extraInfoF <- pletFields @'["desiredAssetSymbol", "desiredAssetTokenName", "receiverDatumHash", "minimumReceive"] extraInfo + outDatumF <- pletFields @'["sender", "receiver", "receiverDatumHash", "step", "batcherFee", "outputAda"] outDatum + orderStepF <- pletFields @'["desiredAsset", "minReceive"] outDatumF.step + desiredAssetF <- pletFields @'["cs", "tn"] orderStepF.desiredAsset + pand'List + [ ptraceIfFalse "Incorrect Swap Sender" (outDatumF.sender #== owner) + , ptraceIfFalse "Incorrect Swap Receiver" (outDatumF.receiver #== owner) + , ptraceIfFalse "Incorrect ReceiverDatumHash" (outDatumF.receiverDatumHash #== extraInfoF.receiverDatumHash) + , ptraceIfFalse "Incorrect Target Policy Id" (desiredAssetF.cs #== extraInfoF.desiredAssetSymbol) + , ptraceIfFalse "Incorrect Target Token Name" (desiredAssetF.tn #== extraInfoF.desiredAssetTokenName) + , ptraceIfFalse "Incorrect Minimum Receive" (orderStepF.minReceive #== extraInfoF.minimumReceive) + , ptraceIfFalse "Incorrect Batcher Fee" (pfromData outDatumF.batcherFee #== pconstant 2_000_000) + , ptraceIfFalse "Incorrect Output ADA" (pfromData outDatumF.outputAda #== pconstant 2_000_000) + ] ) - , ptraceIfFalse "Incorrect Target Policy Id" (desiredAssetF.cs #== extraInfoF.desiredAssetSymbol) - , ptraceIfFalse "Incorrect Target Token Name" (desiredAssetF.tn #== extraInfoF.desiredAssetTokenName) - , ptraceIfFalse "Incorrect Batcher Fee" (pfromData outDatumF.batcherFee #== pconstant 2_000_000) - , ptraceIfFalse "Incorrect Output ADA" (pfromData outDatumF.outputAda #== pconstant 2_000_000) - ] + (psignedByOwner # ctx # owner) + PDNothing _ -> pconstant False psingleValidator :: Term s (PAddress :--> PSmartHandleDatum :--> PSmartHandleRedeemer :--> PScriptContext :--> PUnit) psingleValidator = psmartHandleValidator # validateFn diff --git a/src/StakingValidator.hs b/src/StakingValidator.hs index 60ebf4b..ea43f61 100644 --- a/src/StakingValidator.hs +++ b/src/StakingValidator.hs @@ -4,6 +4,7 @@ module StakingValidator where import PlutusLedgerApi.V1 (Address (..), Credential (..), DatumHash, PubKeyHash (..), ScriptHash, StakingCredential (..)) import PlutusLedgerApi.V1.Value (AssetClass, CurrencySymbol (..), TokenName (..)) +import PlutusLedgerApi.V2 (Redeemer) import PlutusTx qualified import Plutarch.Api.V1 (PCredential (PPubKeyCredential, PScriptCredential), PDatumHash) @@ -15,6 +16,7 @@ import Plutarch.Bool import Plutarch.DataRepr import Plutarch.Lift (DerivePConstantViaBuiltin, PConstantDecl, PUnsafeLiftDecl (..)) import Plutarch.Monadic qualified as P +import Plutarch.Num (PNum (pnegate)) import Plutarch.Prelude import Plutarch.TryFrom (PTryFrom (PTryFromExcess, ptryFrom')) import Plutarch.Unsafe @@ -24,7 +26,8 @@ import "liqwid-plutarch-extra" Plutarch.Extra.ScriptContext (pfromPDatum, ptryFr import "liqwid-plutarch-extra" Plutarch.Extra.TermCont import BatchValidator (PSmartRedeemer (..)) -import Constants (routerFeeAsNegativeValue) +import Constants (negativeRouterFeeForSimpleRoutes, routerFeeForSimpleRoutes) +import Plutarch.Builtin (PIsData (pdataImpl), ppairDataBuiltin) import SingleValidator (PSmartHandleDatum (..)) import Utils @@ -51,6 +54,7 @@ data RouterRedeemer = RouterRedeemer PlutusTx.makeLift ''RouterRedeemer PlutusTx.makeIsDataIndexed ''RouterRedeemer [('RouterRedeemer, 0)] +-- TODO: Switch to: '[ "indices" ':= PBuiltinList (PAsData (PBuiltinPair (PAsData PInteger) (PAsData PInteger))) data PRouterRedeemer (s :: S) = PRouterRedeemer ( Term @@ -62,7 +66,7 @@ data PRouterRedeemer (s :: S) ) ) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PDataFields) + deriving anyclass (PlutusType, PIsData, PDataFields, PShow) instance DerivePlutusType PRouterRedeemer where type DPTStrat _ = PlutusTypeData @@ -73,44 +77,89 @@ instance PUnsafeLiftDecl PRouterRedeemer where type PLifted PRouterRedeemer = Ro deriving via (DerivePConstantViaData RouterRedeemer PRouterRedeemer) instance PConstantDecl RouterRedeemer pfoldCorrespondingUTxOs :: - Term s (PAddress :--> PData :--> PDatum :--> PBool) -> + Term s PCustomValidator -> Term s (PMap any PDatumHash PDatum) -> + Term s PScriptContext -> Term s PAddress -> Term s PInteger -> - Term s (PBuiltinList PTxOut) -> + Term s (PBuiltinList (PBuiltinPair (PAsData PTxOut) (PAsData PBool))) -> Term s (PBuiltinList PTxOut) -> Term s PInteger -pfoldCorrespondingUTxOs validateFn datMap swapAddress acc la lb = +pfoldCorrespondingUTxOs validateFn datMap ctx routeAddress acc la lb = pfoldl2 # plam - ( \acc_ utxoIn utxoOut -> - acc_ + psmartHandleSuccessor validateFn datMap swapAddress utxoIn utxoOut + ( \acc_ utxoInRouteFlagPair utxoOut -> + acc_ + psmartHandleSuccessor validateFn datMap ctx routeAddress utxoInRouteFlagPair utxoOut ) # acc # la # lb psmartHandleSuccessor :: - Term s (PAddress :--> PData :--> PDatum :--> PBool) -> + Term s PCustomValidator -> Term s (PMap any PDatumHash PDatum) -> + Term s PScriptContext -> Term s PAddress -> - Term s PTxOut -> + Term s (PBuiltinPair (PAsData PTxOut) (PAsData PBool)) -> Term s PTxOut -> Term s PInteger -psmartHandleSuccessor validateFn datums swapAddress smartInput swapOutput = P.do +psmartHandleSuccessor validateFn datums ctx routeAddress smartInputRouteFlagPair routeOutput = P.do + let smartInput = pfstBuiltin # smartInputRouteFlagPair + forRoute = pfromData $ psndBuiltin # smartInputRouteFlagPair smartInputF <- pletFields @'["address", "value", "datum"] smartInput - swapOutputF <- pletFields @'["address", "value", "datum"] swapOutput + routeOutputF <- pletFields @'["address", "value", "datum"] routeOutput let smartInputDatum = pconvertChecked @PSmartHandleDatum $ presolveDatumData # smartInputF.datum # datums - datF <- pletFields @'["owner", "extraInfo"] smartInputDatum - let swapOutputDatum = presolveDatum # swapOutputF.datum # datums + routeOutputDatum = presolveDatum # routeOutputF.datum # datums pif - ( pand'List - [ ptraceIfFalse "Incorrect Swap Address" (swapOutputF.address #== swapAddress) - , ptraceIfFalse "Incorrect Swap Output Value" (pforgetPositive swapOutputF.value #== (pforgetPositive smartInputF.value <> routerFeeAsNegativeValue)) - , validateFn # datF.owner # datF.extraInfo # swapOutputDatum - ] + ( pmatch smartInputDatum $ \case + PSimple ((pfield @"owner" #) -> owner) -> + pif + forRoute + ( pand'List + [ validateFn # pcon (PDJust $ pdcons # pdata owner # pdnil) # routerFeeForSimpleRoutes # smartInputF.value # punsafeCoerce (pconstant ()) # routeOutputDatum # pcon PTrue # ctx + , ptraceIfFalse "Incorrect Route Output Value" (pvalueHasChangedByLovelaces # smartInputF.value # routeOutputF.value # negativeRouterFeeForSimpleRoutes) + , ptraceIfFalse "Incorrect Route Address" (routeOutputF.address #== routeAddress) + ] + ) + (psignedByOwner # ctx # owner) + PAdvanced dat' -> P.do + let txInfo = pfield @"txInfo" # ctx + mint = pfield @"mint" # txInfo + datF <- pletFields @'["mOwner", "routerFee", "reclaimRouterFee", "routeRequiredMint", "reclaimRequiredMint", "extraInfo"] dat' + pif + forRoute + ( let + inputIncludingMint = + papplyRequiredMintToInputValue + mint + datF.routeRequiredMint + smartInputF.value + in + pand'List + [ validateFn # datF.mOwner # datF.routerFee # smartInputF.value # datF.extraInfo # routeOutputDatum # forRoute # ctx + , ptraceIfFalse "Incorrect Route Output Value" (pvalueHasChangedByLovelaces # inputIncludingMint # routeOutputF.value # (pnegate # datF.routerFee)) + , ptraceIfFalse "Incorrect Route Address" (routeOutputF.address #== routeAddress) + ] + ) + ( pmatch (pfield @"mOwner" # dat') $ \case + PDJust ((pfield @"_0" #) -> owner) -> + let + inputIncludingMint = + papplyRequiredMintToInputValue + mint + datF.reclaimRequiredMint + smartInputF.value + in + pand'List + [ validateFn # datF.mOwner # datF.reclaimRouterFee # smartInputF.value # datF.extraInfo # routeOutputDatum # forRoute # ctx + , ptraceIfFalse "Incorrect Reclaim Output Value" (pvalueHasChangedByLovelaces # inputIncludingMint # routeOutputF.value # (pnegate # datF.reclaimRouterFee)) + , ptraceIfFalse "Incorrect Reclaim Address" (routeOutputF.address #== owner) + ] + PDNothing _ -> + perror + ) ) (pconstant 1) perror @@ -136,18 +185,61 @@ puniqueOrdered = ) in go -smartHandleStakeValidatorW :: Term s ((PAddress :--> PData :--> PDatum :--> PBool) :--> PAddress :--> PStakeValidator) -smartHandleStakeValidatorW = phoistAcyclic $ plam $ \validateFn swapAddress redeemer ctx -> P.do +smartHandleStakeValidatorW :: Term s (PCustomValidator :--> PAddress :--> PStakeValidator) +smartHandleStakeValidatorW = phoistAcyclic $ plam $ \validateFn routeAddress redeemer ctx -> P.do let red = pconvertUnsafe @PRouterRedeemer redeemer redF <- pletFields @'["inputIdxs", "outputIdxs"] red ctxF <- pletFields @'["txInfo", "purpose"] ctx - infoF <- pletFields @'["inputs", "outputs", "signatories", "datums"] ctxF.txInfo + PRewarding _ <- pmatch ctxF.purpose + infoF <- pletFields @'["inputs", "outputs", "redeemers", "datums"] ctxF.txInfo txInputs <- plet infoF.inputs txOuts <- plet infoF.outputs - let smartInputs = puniqueOrdered # plam (\idx -> pfield @"resolved" #$ pelemAt @PBuiltinList # idx # txInputs) # 0 # redF.inputIdxs - swapOutputs = puniqueOrdered # plam (\idx -> pelemAt @PBuiltinList # idx # txOuts) # 0 # redF.outputIdxs - foldCount = pfoldCorrespondingUTxOs validateFn infoF.datums swapAddress 0 smartInputs swapOutputs + -- let smartInputs = puniqueOrdered # plam (\idx -> pfield @"resolved" #$ pelemAt @PBuiltinList # idx # txInputs) # 0 # redF.inputIdxs + let smartInputs = puniqueOrdered # plam (\idx -> pelemAt @PBuiltinList # idx # txInputs) # 0 # redF.inputIdxs + routeOutputs = puniqueOrdered # plam (\idx -> pelemAt @PBuiltinList # idx # txOuts) # 0 # redF.outputIdxs + rdmrs = pto $ pfromData infoF.redeemers + filteredRdmrs = + pfilter + # plam + ( \prPair -> + let purpose = pfromData $ pfstBuiltin # prPair + in pmatch purpose $ \case + PSpending _ -> pcon PTrue + _ -> pcon PFalse + ) + # rdmrs + inUTxORouteFlagPairs = + pzipWith + # plam + ( \smartInput prPair -> P.do + let purpose = pfromData $ pfstBuiltin # prPair + r = pfromData $ psndBuiltin # prPair + smartRedeemer = pconvertUnsafe @PSmartRedeemer (pto r) + inputF <- pletFields @'["outRef", "resolved"] smartInput + -- inputRef = pfield @"outRef" # smartInput + PSpending ((pfield @"_0" #) -> rdmrRef) <- pmatch purpose + pif + (inputF.outRef #== rdmrRef) + ( pmatch smartRedeemer $ \case + PRouteSmart _ -> + ppairDataBuiltin # inputF.resolved # pdata (pcon PTrue) + PReclaimSmart _ -> + ppairDataBuiltin # inputF.resolved # pdata (pcon PFalse) + ) + perror + ) + # smartInputs + # filteredRdmrs + foldCount = + pfoldCorrespondingUTxOs + validateFn + infoF.datums + ctx + routeAddress + 0 + inUTxORouteFlagPairs + routeOutputs let scInpCount = pcountScriptInputs # txInputs foldChecks = diff --git a/src/Utils.hs b/src/Utils.hs index 2b5a995..acb1db2 100644 --- a/src/Utils.hs +++ b/src/Utils.hs @@ -2,16 +2,35 @@ module Utils where +import PlutusLedgerApi.V2 (CurrencySymbol, TokenName) +import PlutusTx qualified + +import Plutarch.Api.V1.Address (PCredential (..)) import Plutarch.Api.V1.AssocMap (plookup) +import Plutarch.Api.V1.Value (padaSymbol, padaToken, pforgetPositive, psingleton) +import Plutarch.Api.V1.Value qualified as Value import Plutarch.Api.V2 import Plutarch.Bool import Plutarch.DataRepr +import Plutarch.Lift (PConstantDecl, PUnsafeLiftDecl (..)) import Plutarch.Maybe (pfromJust) -import Plutarch.Prelude +import Plutarch.Monadic qualified as P +import Plutarch.Prelude hiding (psingleton) import Plutarch.Unsafe (punsafeCoerce) import "liqwid-plutarch-extra" Plutarch.Extra.List (plookupAssoc) import "liqwid-plutarch-extra" Plutarch.Extra.TermCont +type PCustomValidator = + ( PMaybeData PAddress -- possible owner + :--> PInteger -- routing fee + :--> PValue 'Sorted 'Positive -- value of the input utxo + :--> PData -- extraInfo from the `Advanced` datum + :--> PDatum -- routing address output datum (resolved hash, or inline) + :--> PBool -- routing flag (`True` for routing, `False` for reclaiming) + :--> PScriptContext -- script context + :--> PBool + ) + data PAssetClass (s :: S) = PAssetClass (Term s (PDataRecord '["cs" ':= PCurrencySymbol, "tn" ':= PTokenName])) deriving stock (Generic) deriving anyclass (PlutusType, PIsData, PDataFields) @@ -21,6 +40,46 @@ instance DerivePlutusType PAssetClass where instance PTryFrom PData PAssetClass +data PTriple (a :: PType) (b :: PType) (c :: PType) (s :: S) + = PTriple (Term s a) (Term s b) (Term s c) + deriving stock (Generic) + deriving anyclass (PlutusType, PEq, PShow) + +instance DerivePlutusType (PTriple a b c) where type DPTStrat _ = PlutusTypeScott + +data RequiredMint + = Singleton CurrencySymbol TokenName + | None + +PlutusTx.makeLift ''RequiredMint +PlutusTx.makeIsDataIndexed + ''RequiredMint + [ ('Singleton, 0) + , ('None, 1) + ] + +data PRequiredMint (s :: S) + = PSingleton + ( Term + s + ( PDataRecord + '[ "policy" ':= PCurrencySymbol + , "name" ':= PTokenName + ] + ) + ) + | PNone (Term s (PDataRecord '[])) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData) + +instance DerivePlutusType PRequiredMint where + type DPTStrat _ = PlutusTypeData + +instance PTryFrom PData PRequiredMint + +instance PUnsafeLiftDecl PRequiredMint where type PLifted PRequiredMint = RequiredMint +deriving via (DerivePConstantViaData RequiredMint PRequiredMint) instance PConstantDecl RequiredMint + pexpectJust :: Term s r -> Term s (PMaybe a) -> TermCont @r s (Term s a) pexpectJust escape ma = tcont $ \f -> pmatch ma $ \case PJust v -> f v @@ -145,3 +204,124 @@ pconvertChecked x = ptryFrom x fst pconvertUnsafe :: forall (b :: PType) (a :: PType) (s :: S). (PTryFrom a b) => Term s a -> Term s b pconvertUnsafe = punsafeCoerce + +psignedByOwner :: Term s (PScriptContext :--> PAddress :--> PBool) +psignedByOwner = plam $ \ctx owner -> + pmatch (pfield @"credential" # owner) $ \case + PPubKeyCredential ((pfield @"_0" #) -> pkh) -> + pelem @PBuiltinList # pkh # (pfield @"signatories" # (pfield @"txInfo" # ctx)) + _ -> + pcon PFalse + +pvalueHasChangedByLovelaces :: Term s (PValue 'Sorted 'Positive :--> PValue 'Sorted 'Positive :--> PInteger :--> PBool) +pvalueHasChangedByLovelaces = plam $ \inVal outVal change -> + pif + (change #== 0) + (outVal #== inVal) + (pforgetPositive outVal #== (pforgetPositive inVal <> (psingleton # padaSymbol # padaToken # change))) + +presolveMapToList :: + forall + (anyOrder :: KeyGuarantees) + (a :: PType) + (b :: PType) + (s :: S). + Term s (PMap anyOrder a b) -> + Term s (PBuiltinList (PBuiltinPair (PAsData a) (PAsData b))) +presolveMapToList m = pmatch m $ \(PMap l) -> l + +{- | Converts a `PValue` to a `PBuiltinList`. Does not convert the inner `PMap` +of token names and quantities to a list. +-} +presolveValueToList :: + forall + (anyOrder :: KeyGuarantees) + (anyAmount :: AmountGuarantees) + (s :: S). + Term s (PValue anyOrder anyAmount) -> + Term s (PBuiltinList (PBuiltinPair (PAsData PCurrencySymbol) (PAsData (PMap anyOrder PTokenName PInteger)))) +presolveValueToList v = + pmatch v $ \(PValue v') -> + pmatch (presolveMapToList v') $ \kvs -> pcon kvs + +{- | Get the head of the list if the list contains exactly one element, +otherwise error. +-} +pheadSingleton :: + (PListLike list, PElemConstraint list a) => + Term s (list a) -> + Term s a +pheadSingleton = + pelimList + (pelimList (\_ _ -> ptraceError "List contains more than one element.")) + (ptraceError "List is empty.") + +-- | Helper function for converting intermediary datatypes. +psingleAssetToTriple :: + forall + (anyOrder :: KeyGuarantees) + (s :: S). + Term + s + ( PBuiltinPair + (PAsData PCurrencySymbol) + (PAsData (PMap anyOrder PTokenName PInteger)) + :--> PTriple PCurrencySymbol PTokenName PInteger + ) +psingleAssetToTriple = plam $ \asset -> + let + cs = pfstBuiltin # asset + tnQtyMap = psndBuiltin # asset + tnQtyPairs = presolveMapToList $ pfromData tnQtyMap + in + plet (pheadSingleton tnQtyPairs) $ \tnQtyPair -> + let + tn = pfstBuiltin # tnQtyPair + qty = psndBuiltin # tnQtyPair + in + pcon (PTriple (pfromData cs) (pfromData tn) (pfromData qty)) + +-- | Grabs the singular asset in a given `PValue`, ignoring its ADA. +pgetSingleAssetApartFromADA :: + forall + (anyAmount :: AmountGuarantees) + (s :: S). + Term s (PValue 'Sorted anyAmount) -> + Term s (PTriple PCurrencySymbol PTokenName PInteger) +pgetSingleAssetApartFromADA v = + -- not using `pelimList` as it would've lead to evaluation of the head + psingleAssetToTriple #$ pheadSingleton $ ptail # presolveValueToList v + +{- | Check if the mint field contains exactly the provided singleton. Returns + the mint amount. +-} +pgetMintQuantityOfSingleton :: + Term s PCurrencySymbol -> + Term s PTokenName -> + Term s (PValue 'Sorted 'NoGuarantees) -> + Term s PInteger +pgetMintQuantityOfSingleton policy name mintVal = + pmatch (pgetSingleAssetApartFromADA mintVal) $ \(PTriple mintCS mintTN mintQty) -> + pif + ( ptraceIfFalse + "Tx mint doesn't match the reclaim mint" + (pand'List [policy #== mintCS, name #== mintTN]) + ) + mintQty + perror + +papplyRequiredMintToInputValue :: + Term s (PValue 'Sorted 'NoGuarantees) -> + Term s PRequiredMint -> + Term s (PValue 'Sorted 'Positive) -> + Term s (PValue 'Sorted 'Positive) +papplyRequiredMintToInputValue mint requiredMint inputValue = + pmatch requiredMint $ \case + PSingleton rm -> P.do + rmF <- pletFields @'["policy", "name"] rm + let mintQty = pgetMintQuantityOfSingleton rmF.policy rmF.name mint + requiredMintValue = Value.psingleton # rmF.policy # rmF.name # mintQty + inputAppendedWithMint = requiredMintValue <> pforgetPositive inputValue + Value.passertPositive # inputAppendedWithMint + PNone _ -> + inputValue diff --git a/test/SmartHandlesSpec.hs b/test/SmartHandlesSpec.hs index 045d9ac..50517f8 100644 --- a/test/SmartHandlesSpec.hs +++ b/test/SmartHandlesSpec.hs @@ -3,12 +3,12 @@ module SmartHandlesSpec (tests) where import Data.Either (fromRight) import PlutusLedgerApi.V1.Value (AssetClass (..), assetClass) -import PlutusLedgerApi.V2 (Address (..), Credential (..), ScriptContext, StakingCredential (..), adaSymbol, adaToken, singleton) +import PlutusLedgerApi.V2 (Address (..), Credential (..), ScriptContext, ScriptPurpose (Rewarding, Spending), StakingCredential (..), TxId (TxId), TxOutRef (TxOutRef), adaSymbol, adaToken, singleton) import PlutusTx (toBuiltinData, toData) import Plutarch import Plutarch.Api.V2 (scriptHash) -import Plutarch.Context (Builder, address, buildRewarding', input, output, script, withDatum, withRedeemer, withValue, withdrawal) +import Plutarch.Context (Builder, address, buildRewarding', extraRedeemer, input, output, script, withDatum, withRedeemer, withRef, withValue, withdrawal) import Plutarch.Prelude import Plutarch.Test.Precompiled (tryFromPTerm, (@!>), (@>)) import Plutarch.Test.QuickCheck (TestableTerm (..), fromFailingPPartial, fromPFun) @@ -18,9 +18,11 @@ import Test.Tasty.QuickCheck (Gen, Property, chooseInt, chooseInteger, forAll, s import BatchValidator (SmartRedeemer (..), smartHandleRouteValidatorW) import Compilation +import Debug.Trace (trace) import SingleValidator (SmartHandleDatum (..)) import Specialized.Minswap import StakingValidator (RouterRedeemer (..), puniqueOrdered) +import Utils (RequiredMint (..)) tests :: TestTree tests = testGroup "Smart handles" [uniqueOrderedTests, stakingValidatorTests] @@ -89,20 +91,33 @@ stakingCredential = StakingHash $ ScriptCredential $ scriptHash $ stakingScript minAssetClass :: AssetClass minAssetClass = assetClass "e16c2dc8ae937e8d3790c7fd7168d7b994621ba14ca11415f39fed72" "MIN" +inputTxOutRef :: TxOutRef +inputTxOutRef = TxOutRef (TxId "0000000000000000") 0 + +inputRedeemer :: SmartRedeemer +inputRedeemer = RouteSmart + scriptInput :: (Builder a) => a scriptInput = input $ mconcat [ script $ scriptHash routerScript + , withRef inputTxOutRef , withValue (singleton adaSymbol adaToken 10_000_000) - , withRedeemer SwapSmart + , withRedeemer inputRedeemer , withDatum $ - SmartHandleDatum - (Address alice Nothing) + Advanced + (Just $ Address alice Nothing) + 1_000_000 + 0 + None + None ( toBuiltinData $ MinswapRequestInfo (fst $ unAssetClass minAssetClass) (snd $ unAssetClass minAssetClass) + Nothing + 10 ) ] @@ -112,7 +127,7 @@ scriptOutput = mconcat [ address $ plift minSwapAddress , withValue (singleton adaSymbol adaToken 9_000_000) - , withRedeemer SwapSmart + , withRedeemer RouteSmart , withDatum $ MinswapRequestDatum { sender = Address alice Nothing @@ -124,16 +139,18 @@ scriptOutput = } ] -scriptContextWithNegativeIndex :: ScriptContext -scriptContextWithNegativeIndex = +scriptContextWithNegativeIndex :: RouterRedeemer -> ScriptContext +scriptContextWithNegativeIndex withdrawRedeemer = buildRewarding' $ mconcat - [ withdrawal stakingCredential 0 + [ extraRedeemer (Rewarding stakingCredential) withdrawRedeemer + , extraRedeemer (Spending inputTxOutRef) inputRedeemer + , withdrawal stakingCredential 0 , scriptInput , scriptOutput ] stakingValidatorTests :: TestTree stakingValidatorTests = tryFromPTerm "Staking validator" (pstakeValidator # minSwapAddress) $ do - [toData correctRouterRedeemer, toData scriptContextWithNegativeIndex] @> "accepts correct index" - [toData negativeIndicesRouterRedeemer, toData scriptContextWithNegativeIndex] @!> "does not accept negative index" + [toData correctRouterRedeemer, toData (trace (show (scriptContextWithNegativeIndex correctRouterRedeemer)) (scriptContextWithNegativeIndex correctRouterRedeemer))] @> "accepts correct index" + [toData negativeIndicesRouterRedeemer, toData (scriptContextWithNegativeIndex negativeIndicesRouterRedeemer)] @!> "does not accept negative index"