diff --git a/README.md b/README.md index 33628c4..a8e8e57 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,7 @@ Non-goals: An up to date `nix` (>=2.3) is required to build this project. For information on how to install, see the [nixos website](https://nixos.org/download.html). Important: See also [this section](https://github.com/input-output-hk/plutus#nix-advice) on binary caches. Open a dev-shell with `nix develop`, and build with `cabal build`. + +## Documentation + +See documentation of the agora architecture in [docs](./docs). diff --git a/flake.lock b/flake.lock index 0f70909..8312ec8 100644 --- a/flake.lock +++ b/flake.lock @@ -417,6 +417,22 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1641205782, + "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-compat-ci": { "locked": { "lastModified": 1641672839, @@ -432,6 +448,39 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1606424373, + "narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", + "type": "github" + }, + "original": { + "owner": "edolstra", + "ref": "master", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1606424373, + "narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1623875721, @@ -802,6 +851,50 @@ "type": "github" } }, + "hercules-ci-agent": { + "inputs": { + "flake-compat": "flake-compat_3", + "nix-darwin": "nix-darwin", + "nixos-20_09": "nixos-20_09", + "nixos-unstable": "nixos-unstable", + "pre-commit-hooks-nix": "pre-commit-hooks-nix" + }, + "locked": { + "lastModified": 1642766877, + "narHash": "sha256-EXvI+1cKZHWfAaRV1PrSrQe0knc4rg5vMF4qz6/5bkI=", + "owner": "hercules-ci", + "repo": "hercules-ci-agent", + "rev": "0aa916f487be7da03bc2a6dec2ac7149b05499c5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "ref": "master", + "repo": "hercules-ci-agent", + "type": "github" + } + }, + "hercules-ci-effects": { + "inputs": { + "flake-compat": "flake-compat_2", + "hercules-ci-agent": "hercules-ci-agent", + "nixpkgs": "nixpkgs_2", + "nixpkgs-nixops": "nixpkgs-nixops" + }, + "locked": { + "lastModified": 1641914281, + "narHash": "sha256-3qJ6tDPkrsFqm4E74JROZlQbnKKLNTHV7QOD1LdcVqs=", + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "rev": "2e165352d92782e7ae149f4f1a9b3174f718a3af", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "type": "github" + } + }, "hpc-coveralls": { "flake": false, "locked": { @@ -900,6 +993,24 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1622060422, + "narHash": "sha256-hPVlvrAyf6zL7tTx0lpK+tMxEfZeMiIZ/A2xaJ41WOY=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "007d700e644ac588ad6668e6439950a5b6e2ff64", + "type": "github" + }, + "original": { + "owner": "LnL7", + "repo": "nix-darwin", + "type": "github" + } + }, "nix-tools": { "flake": false, "locked": { @@ -932,23 +1043,52 @@ "type": "github" } }, - "nixpkgs": { - "flake": false, + "nixos-20_09": { "locked": { - "lastModified": 1628785280, - "narHash": "sha256-2B5eMrEr6O8ff2aQNeVxTB+9WrGE80OB4+oM6T7fOcc=", + "lastModified": 1623585158, + "narHash": "sha256-AjK7M1/six8IBPOI28nm7yC2k8mZIR2F9QrOwFYHAS0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6525bbc06a39f26750ad8ee0d40000ddfdc24acb", + "rev": "115dbbe82eb4ec8aabf959068286468a68e0b244", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-20.09", "repo": "nixpkgs", "type": "github" } }, + "nixos-unstable": { + "locked": { + "lastModified": 1630248577, + "narHash": "sha256-9d/yq96TTrnF7qjA6wPYk+rYjWAXwfUmwk3qewezSeg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8d8a28b47b7c41aeb4ad01a2bd8b7d26986c3512", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1602411953, + "narHash": "sha256-gbupmxRpoQZqL5NBQCJN2GI5G7XDEHHHYKhVwEj5+Ps=", + "owner": "LnL7", + "repo": "nixpkgs", + "rev": "f780534ea2d0c12e62607ff254b6b45f46653f7a", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, "nixpkgs-2003": { "locked": { "lastModified": 1620055814, @@ -1045,6 +1185,22 @@ "type": "github" } }, + "nixpkgs-nixops": { + "locked": { + "lastModified": 1630248577, + "narHash": "sha256-9d/yq96TTrnF7qjA6wPYk+rYjWAXwfUmwk3qewezSeg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8d8a28b47b7c41aeb4ad01a2bd8b7d26986c3512", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "8d8a28b47b7c41aeb4ad01a2bd8b7d26986c3512", + "type": "github" + } + }, "nixpkgs-unstable": { "locked": { "lastModified": 1635295995, @@ -1078,6 +1234,39 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1633463774, + "narHash": "sha256-y3GjapcRzd42NgebQ4sx5GFJ53dYqNdF3UQu7/t6mUg=", + "owner": "hercules-ci", + "repo": "nixpkgs", + "rev": "c70f908fd1f129aede2744d4385fae57d2e252b1", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "ref": "init-nixops-hercules-ci", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "flake": false, + "locked": { + "lastModified": 1628785280, + "narHash": "sha256-2B5eMrEr6O8ff2aQNeVxTB+9WrGE80OB4+oM6T7fOcc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6525bbc06a39f26750ad8ee0d40000ddfdc24acb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { "flake": false, "locked": { "lastModified": 1628785280, @@ -1170,10 +1359,12 @@ "cardano-crypto": "cardano-crypto_2", "cardano-prelude": "cardano-prelude_2", "cryptonite": "cryptonite", + "flake-compat": "flake-compat", "flake-compat-ci": "flake-compat-ci", "flat": "flat_2", "foundation": "foundation", "haskell-nix": "haskell-nix_2", + "hercules-ci-effects": "hercules-ci-effects", "hs-memory": "hs-memory", "nixpkgs": [ "haskell-nix", @@ -1185,17 +1376,17 @@ "th-extras": "th-extras" }, "locked": { - "lastModified": 1642116894, - "narHash": "sha256-KEJp8wkonolfwfQOtWsZh1bs6JROWZKO5vmpalAvBcA=", - "owner": "emiflake", + "lastModified": 1642778520, + "narHash": "sha256-wLWcjeuGUcH8rYz/LXIxUTO/Wnfvq/5GBS55cqof6nE=", + "owner": "Plutonomicon", "repo": "plutarch", - "rev": "fc81238aca3d9305347fe38471194e809f262e39", + "rev": "d845c2ad3292d141b61024dc24c9ab305540dc98", "type": "github" }, "original": { - "owner": "emiflake", + "owner": "Plutonomicon", "repo": "plutarch", - "rev": "fc81238aca3d9305347fe38471194e809f262e39", + "rev": "d845c2ad3292d141b61024dc24c9ab305540dc98", "type": "github" } }, @@ -1207,8 +1398,8 @@ "haskell-language-server": "haskell-language-server", "haskell-nix": "haskell-nix_3", "iohk-nix": "iohk-nix", - "nixpkgs": "nixpkgs", - "pre-commit-hooks-nix": "pre-commit-hooks-nix", + "nixpkgs": "nixpkgs_3", + "pre-commit-hooks-nix": "pre-commit-hooks-nix_2", "sphinxcontrib-haddock": "sphinxcontrib-haddock", "stackage-nix": "stackage-nix" }, @@ -1252,8 +1443,8 @@ "haskell-language-server": "haskell-language-server_2", "haskell-nix": "haskell-nix_4", "iohk-nix": "iohk-nix_2", - "nixpkgs": "nixpkgs_2", - "pre-commit-hooks-nix": "pre-commit-hooks-nix_2", + "nixpkgs": "nixpkgs_4", + "pre-commit-hooks-nix": "pre-commit-hooks-nix_3", "sphinxcontrib-haddock": "sphinxcontrib-haddock_2", "stackage-nix": "stackage-nix_2" }, @@ -1273,6 +1464,22 @@ } }, "pre-commit-hooks-nix": { + "flake": false, + "locked": { + "lastModified": 1622650193, + "narHash": "sha256-qSzUpJDv04ajS9FXoCq6NjVF3qOt9IiGIiGh0P8amyw=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "0398f0649e0a741660ac5e8216760bae5cc78579", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "pre-commit-hooks-nix_2": { "flake": false, "locked": { "lastModified": 1624971177, @@ -1288,7 +1495,7 @@ "type": "github" } }, - "pre-commit-hooks-nix_2": { + "pre-commit-hooks-nix_3": { "flake": false, "locked": { "lastModified": 1624971177, diff --git a/flake.nix b/flake.nix index 6b00c58..b1cdb6a 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,7 @@ "github:input-output-hk/plutus?rev=65bad0fd53e432974c3c203b1b1999161b6c2dce"; inputs.plutarch.url = - "github:emiflake/plutarch?rev=fc81238aca3d9305347fe38471194e809f262e39"; + "github:Plutonomicon/plutarch?rev=d845c2ad3292d141b61024dc24c9ab305540dc98"; inputs.goblins.url = "github:input-output-hk/goblins?rev=cde90a2b27f79187ca8310b6549331e59595e7ba"; diff --git a/src/Agora/AuthorityToken.hs b/src/Agora/AuthorityToken.hs index d555c67..477c8e8 100644 --- a/src/Agora/AuthorityToken.hs +++ b/src/Agora/AuthorityToken.hs @@ -24,16 +24,17 @@ import Plutus.V1.Ledger.Value (AssetClass (..)) -------------------------------------------------------------------------------- -import Plutarch import Plutarch.Api.V1 hiding (PMaybe (..)) -import Plutarch.Bool (PBool (..), PEq, pif, (#<), (#==)) -import Plutarch.Builtin -import Plutarch.DataRepr +import Plutarch.Bool (PBool, PEq, pif, (#<), (#==)) +import Plutarch.Builtin (PBuiltinPair, PData, pdata, pfromData, pfstBuiltin, psndBuiltin) +import Plutarch.DataRepr (pindexDataList) import Plutarch.Integer (PInteger) -import Plutarch.List -import Plutarch.Maybe +import Plutarch.Lift (pconstant) +import Plutarch.List (PIsListLike, pfoldr', precList) +import Plutarch.Maybe (PMaybe (PJust, PNothing)) +import Plutarch.Prelude import Plutarch.Trace (ptraceError) -import Plutarch.Unit (PUnit (..)) +import Plutarch.Unit (PUnit) --------------------------------------------------------------------------------