From ea96690e6abf48be0ce186294d7ba8d0e3f53d6f Mon Sep 17 00:00:00 2001 From: Emily Martins Date: Thu, 13 Jan 2022 00:06:37 +0100 Subject: [PATCH] initial commit --- .gitignore | 18 + .hlint.yaml | 7 + Makefile | 20 + README.md | 19 + agora.cabal | 88 +++ cabal.project | 31 + flake.lock | 1303 +++++++++++++++++++++++++++++++++++ flake.nix | 254 +++++++ fourmolu.yaml | 8 + hie.yaml | 4 + shell.nix | 6 + src/Agora/AuthorityToken.hs | 32 + 12 files changed, 1790 insertions(+) create mode 100644 .gitignore create mode 100644 .hlint.yaml create mode 100644 Makefile create mode 100644 README.md create mode 100644 agora.cabal create mode 100644 cabal.project create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 fourmolu.yaml create mode 100644 hie.yaml create mode 100644 shell.nix create mode 100644 src/Agora/AuthorityToken.hs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a82f4b1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +# Cabal builds +dist/ +dist-newstyle/ + +# Nix build results +result +result-* + +# Editors +.vscode/ +.idea +tags +.nvimrc + +*.tix + +# Plutus dumped .flat files +*.flat diff --git a/.hlint.yaml b/.hlint.yaml new file mode 100644 index 0000000..3cfdc99 --- /dev/null +++ b/.hlint.yaml @@ -0,0 +1,7 @@ +# Ignored Rules +- ignore: {name: "Unused LANGUAGE pragma"} +- ignore: {name: "Use <$>"} + +# Extra warnings +- warn: {name: Use explicit module import list} +- warn: {name: Use module export list} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d5774b3 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +SHELL := /usr/bin/env bash + +.PHONY: hoogle format usage + +usage: + @echo "usage: make [OPTIONS]" + @echo + @echo "Available commands:" + @echo " hoogle -- Start local hoogle" + @echo " format -- Format the project" + +HOOGLE_PORT=8081 +hoogle: + hoogle server --local --port $(HOOGLE_PORT) + +FORMAT_EXTENSIONS := -o -XQuasiQuotes -o -XTemplateHaskell -o -XTypeApplications -o -XImportQualifiedPost -o -XPatternSynonyms -o -fplugin=RecordDotPreprocessor +format: + find -name '*.hs' -not -path './dist-*/*' | xargs fourmolu $(FORMAT_EXTENSIONS) -m inplace + git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.nix' | xargs nixfmt + git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.cabal' | xargs cabal-fmt diff --git a/README.md b/README.md new file mode 100644 index 0000000..8b4c7b5 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# `agora` + +Agora is a set of Plutus scripts that compose together to form a Governance system. + +### What is Agora + +Goals: +- Agora aims to reduce duplication in Liqwid and LiqwidX and to serve as a one-size-fits-all governance library for projects on the Cardano Network. +- Agora aims to be modular and allow customizing specific needs, but presents an opinionated architecture. + +Non-goals: +- Agora is not a DAO. It doesn't have tokenomics or even a token. It is simply a library for governance. +- Agora doesn't aim to provide any primitive tools for plutus that are not governance-specific. For this, see [plutus-extra](see github.com/Liqwid-Labs/plutus-extra/). + +## Project setup + +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`. diff --git a/agora.cabal b/agora.cabal new file mode 100644 index 0000000..d2b3745 --- /dev/null +++ b/agora.cabal @@ -0,0 +1,88 @@ +cabal-version: 2.4 +name: agora +version: 0.1.0.0 +extra-source-files: CHANGELOG.md + +-------------------------------------------------------------------------------- +-- Common Stanza Declarations + +-- Language options, warnings, some options for plutus +common lang + default-language: Haskell2010 + default-extensions: + NoImplicitPrelude + BangPatterns + BinaryLiterals + ConstraintKinds + DataKinds + DeriveAnyClass + DeriveFunctor + DeriveGeneric + DeriveTraversable + DerivingStrategies + DerivingVia + DuplicateRecordFields + EmptyCase + FlexibleContexts + FlexibleInstances + GADTs + GeneralizedNewtypeDeriving + HexFloatLiterals + ImportQualifiedPost + InstanceSigs + KindSignatures + LambdaCase + MultiParamTypeClasses + NumericUnderscores + OverloadedStrings + QuasiQuotes + ScopedTypeVariables + StandaloneDeriving + TupleSections + TypeApplications + TypeFamilies + TypeOperators + TypeSynonymInstances + UndecidableInstances + + ghc-options: + -Wall -Wcompat -Wincomplete-uni-patterns -Wredundant-constraints + -Wmissing-export-lists -Werror -Wincomplete-record-updates + -fno-ignore-interface-pragmas -fno-omit-interface-pragmas + -fobject-code -fno-strictness -fplugin=RecordDotPreprocessor + -fplugin-opt PlutusTx.Plugin:dump-uplc + +-- Common external deps +common deps + build-depends: + , base >=4.9 && <5 + , ansi-terminal + , aeson + , base-compat + , bytestring + , cardano-prelude + , containers + , data-default + , data-default-class + , plutarch + , plutus-core + , plutus-ledger-api + , plutus-tx + , prettyprinter + , record-dot-preprocessor + , record-hasfield + , recursion-schemes + , template-haskell + , text + +-------------------------------------------------------------------------------- + +library + import: lang + import: deps + exposed-modules: + Agora.AuthorityToken + + other-modules: + + hs-source-dirs: src \ No newline at end of file diff --git a/cabal.project b/cabal.project new file mode 100644 index 0000000..4cb7523 --- /dev/null +++ b/cabal.project @@ -0,0 +1,31 @@ +index-state: 2021-10-20T00:00:00Z + +packages: ./. + +-- Always build tests and benchmarks. +tests: true +benchmarks: true + +-- The only sensible test display option +test-show-details: direct + +allow-newer: + -- Pins to an old version of Template Haskell, unclear if/when it will be updated + size-based:template-haskell + , ouroboros-consensus-byron:formatting + , beam-core:aeson + , beam-sqlite:aeson + , beam-sqlite:dlist + , beam-migrate:aeson + +package cardano-ledger-alonzo + optimization: False +package ouroboros-consensus-shelley + optimization: False +package ouroboros-consensus-cardano + optimization: False +package cardano-api + optimization: False + +package plutarch + flags: +development \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..0678be8 --- /dev/null +++ b/flake.lock @@ -0,0 +1,1303 @@ +{ + "nodes": { + "HTTP": { + "flake": false, + "locked": { + "lastModified": 1451647621, + "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", + "owner": "phadej", + "repo": "HTTP", + "rev": "9bc0996d412fef1787449d841277ef663ad9a915", + "type": "github" + }, + "original": { + "owner": "phadej", + "repo": "HTTP", + "type": "github" + } + }, + "HTTP_2": { + "flake": false, + "locked": { + "lastModified": 1451647621, + "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", + "owner": "phadej", + "repo": "HTTP", + "rev": "9bc0996d412fef1787449d841277ef663ad9a915", + "type": "github" + }, + "original": { + "owner": "phadej", + "repo": "HTTP", + "type": "github" + } + }, + "Shrinker": { + "flake": false, + "locked": { + "lastModified": 1641477919, + "narHash": "sha256-D6Rl2/2ABrHwBdoU8U4iNU8gVC4MTy14heh4ouCjQE4=", + "owner": "Plutonomicon", + "repo": "Shrinker", + "rev": "37bf56e83d0d568232ff2be1ae4daf1946a81189", + "type": "github" + }, + "original": { + "owner": "Plutonomicon", + "repo": "Shrinker", + "type": "github" + } + }, + "Win32-network": { + "flake": false, + "locked": { + "lastModified": 1627315969, + "narHash": "sha256-Hesb5GXSx0IwKSIi42ofisVELcQNX6lwHcoZcbaDiqc=", + "owner": "input-output-hk", + "repo": "Win32-network", + "rev": "3825d3abf75f83f406c1f7161883c438dac7277d", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "Win32-network", + "rev": "3825d3abf75f83f406c1f7161883c438dac7277d", + "type": "github" + } + }, + "Win32-network_2": { + "flake": false, + "locked": { + "lastModified": 1627315969, + "narHash": "sha256-Hesb5GXSx0IwKSIi42ofisVELcQNX6lwHcoZcbaDiqc=", + "owner": "input-output-hk", + "repo": "Win32-network", + "rev": "3825d3abf75f83f406c1f7161883c438dac7277d", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "Win32-network", + "rev": "3825d3abf75f83f406c1f7161883c438dac7277d", + "type": "github" + } + }, + "cabal-32": { + "flake": false, + "locked": { + "lastModified": 1603716527, + "narHash": "sha256-sDbrmur9Zfp4mPKohCD8IDZfXJ0Tjxpmr2R+kg5PpSY=", + "owner": "haskell", + "repo": "cabal", + "rev": "94aaa8e4720081f9c75497e2735b90f6a819b08e", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.2", + "repo": "cabal", + "type": "github" + } + }, + "cabal-32_2": { + "flake": false, + "locked": { + "lastModified": 1603716527, + "narHash": "sha256-sDbrmur9Zfp4mPKohCD8IDZfXJ0Tjxpmr2R+kg5PpSY=", + "owner": "haskell", + "repo": "cabal", + "rev": "94aaa8e4720081f9c75497e2735b90f6a819b08e", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.2", + "repo": "cabal", + "type": "github" + } + }, + "cabal-34": { + "flake": false, + "locked": { + "lastModified": 1622475795, + "narHash": "sha256-chwTL304Cav+7p38d9mcb+egABWmxo2Aq+xgVBgEb/U=", + "owner": "haskell", + "repo": "cabal", + "rev": "b086c1995cdd616fc8d91f46a21e905cc50a1049", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.4", + "repo": "cabal", + "type": "github" + } + }, + "cabal-34_2": { + "flake": false, + "locked": { + "lastModified": 1622475795, + "narHash": "sha256-chwTL304Cav+7p38d9mcb+egABWmxo2Aq+xgVBgEb/U=", + "owner": "haskell", + "repo": "cabal", + "rev": "b086c1995cdd616fc8d91f46a21e905cc50a1049", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "3.4", + "repo": "cabal", + "type": "github" + } + }, + "cardano-addresses": { + "flake": false, + "locked": { + "lastModified": 1631515399, + "narHash": "sha256-XgXQKJHRKAFwIjONh19D/gKE0ARlhMXXcV74eZpd0lw=", + "owner": "input-output-hk", + "repo": "cardano-addresses", + "rev": "d2f86caa085402a953920c6714a0de6a50b655ec", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-addresses", + "rev": "d2f86caa085402a953920c6714a0de6a50b655ec", + "type": "github" + } + }, + "cardano-base": { + "flake": false, + "locked": { + "lastModified": 1633939430, + "narHash": "sha256-zbjq43Bnhv1/LhJCFlI8gdd61dGvVlkEa6wkCvLqEFg=", + "owner": "input-output-hk", + "repo": "cardano-base", + "rev": "4ea7e2d927c9a7f78ddc69738409a5827ab66b98", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-base", + "rev": "4ea7e2d927c9a7f78ddc69738409a5827ab66b98", + "type": "github" + } + }, + "cardano-base_2": { + "flake": false, + "locked": { + "lastModified": 1637324835, + "narHash": "sha256-puxNINdEFC2fdIH68nNjDJ4J/GiX3SbQ8bhOTepwKP0=", + "owner": "input-output-hk", + "repo": "cardano-base", + "rev": "0b1b5b37e305c4bb10791f843bc8c81686a0cba4", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-base", + "rev": "0b1b5b37e305c4bb10791f843bc8c81686a0cba4", + "type": "github" + } + }, + "cardano-crypto": { + "flake": false, + "locked": { + "lastModified": 1621376239, + "narHash": "sha256-oxIOVlgm07FAEmgGRF1C2me9TXqVxQulEOcJ22zpTRs=", + "owner": "input-output-hk", + "repo": "cardano-crypto", + "rev": "07397f0e50da97eaa0575d93bee7ac4b2b2576ec", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-crypto", + "rev": "07397f0e50da97eaa0575d93bee7ac4b2b2576ec", + "type": "github" + } + }, + "cardano-crypto_2": { + "flake": false, + "locked": { + "lastModified": 1621376239, + "narHash": "sha256-oxIOVlgm07FAEmgGRF1C2me9TXqVxQulEOcJ22zpTRs=", + "owner": "input-output-hk", + "repo": "cardano-crypto", + "rev": "07397f0e50da97eaa0575d93bee7ac4b2b2576ec", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-crypto", + "rev": "07397f0e50da97eaa0575d93bee7ac4b2b2576ec", + "type": "github" + } + }, + "cardano-ledger-specs": { + "flake": false, + "locked": { + "lastModified": 1634701482, + "narHash": "sha256-HTPOmVOXgBD/3uAxZip/HSttaKcJ+uImYDbuwANAw1c=", + "owner": "input-output-hk", + "repo": "cardano-ledger-specs", + "rev": "bf008ce028751cae9fb0b53c3bef20f07c06e333", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-ledger-specs", + "rev": "bf008ce028751cae9fb0b53c3bef20f07c06e333", + "type": "github" + } + }, + "cardano-prelude": { + "flake": false, + "locked": { + "lastModified": 1617239936, + "narHash": "sha256-BtbT5UxOAADvQD4qTPNrGfnjQNgbYNO4EAJwH2ZsTQo=", + "owner": "input-output-hk", + "repo": "cardano-prelude", + "rev": "fd773f7a58412131512b9f694ab95653ac430852", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-prelude", + "rev": "fd773f7a58412131512b9f694ab95653ac430852", + "type": "github" + } + }, + "cardano-prelude_2": { + "flake": false, + "locked": { + "lastModified": 1617239936, + "narHash": "sha256-BtbT5UxOAADvQD4qTPNrGfnjQNgbYNO4EAJwH2ZsTQo=", + "owner": "input-output-hk", + "repo": "cardano-prelude", + "rev": "fd773f7a58412131512b9f694ab95653ac430852", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-prelude", + "rev": "fd773f7a58412131512b9f694ab95653ac430852", + "type": "github" + } + }, + "cardano-repo-tool": { + "flake": false, + "locked": { + "lastModified": 1624584417, + "narHash": "sha256-YSepT97PagR/1jTYV/Yer8a2GjFe9+tTwaTCHxuK50M=", + "owner": "input-output-hk", + "repo": "cardano-repo-tool", + "rev": "30e826ed8f00e3e154453b122a6f3d779b2f73ec", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-repo-tool", + "type": "github" + } + }, + "cardano-repo-tool_2": { + "flake": false, + "locked": { + "lastModified": 1624584417, + "narHash": "sha256-YSepT97PagR/1jTYV/Yer8a2GjFe9+tTwaTCHxuK50M=", + "owner": "input-output-hk", + "repo": "cardano-repo-tool", + "rev": "30e826ed8f00e3e154453b122a6f3d779b2f73ec", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-repo-tool", + "type": "github" + } + }, + "cardano-shell": { + "flake": false, + "locked": { + "lastModified": 1608537748, + "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", + "owner": "input-output-hk", + "repo": "cardano-shell", + "rev": "9392c75087cb9a3d453998f4230930dea3a95725", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-shell", + "type": "github" + } + }, + "cardano-shell_2": { + "flake": false, + "locked": { + "lastModified": 1608537748, + "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", + "owner": "input-output-hk", + "repo": "cardano-shell", + "rev": "9392c75087cb9a3d453998f4230930dea3a95725", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "cardano-shell", + "type": "github" + } + }, + "flake-compat-ci": { + "locked": { + "lastModified": 1641672839, + "narHash": "sha256-Bdwv+DKeEMlRNPDpZxSz0sSrqQBvdKO5fZ8LmvrgCOU=", + "owner": "hercules-ci", + "repo": "flake-compat-ci", + "rev": "e832114bc18376c0f3fa13c19bf5ff253cc6570a", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-compat-ci", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1623875721, + "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1623875721, + "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flat": { + "flake": false, + "locked": { + "lastModified": 1630339624, + "narHash": "sha256-5TokQ8IgZYUI6YsfUB4FovwD3xAv1ky/MpY8XmOnd4U=", + "owner": "Quid2", + "repo": "flat", + "rev": "d32c2c0c0c3c38c41177684ade9febe92d279b06", + "type": "github" + }, + "original": { + "owner": "Quid2", + "repo": "flat", + "rev": "d32c2c0c0c3c38c41177684ade9febe92d279b06", + "type": "github" + } + }, + "flat_2": { + "flake": false, + "locked": { + "lastModified": 1630339624, + "narHash": "sha256-5TokQ8IgZYUI6YsfUB4FovwD3xAv1ky/MpY8XmOnd4U=", + "owner": "Quid2", + "repo": "flat", + "rev": "d32c2c0c0c3c38c41177684ade9febe92d279b06", + "type": "github" + }, + "original": { + "owner": "Quid2", + "repo": "flat", + "rev": "d32c2c0c0c3c38c41177684ade9febe92d279b06", + "type": "github" + } + }, + "ghc-8.6.5-iohk": { + "flake": false, + "locked": { + "lastModified": 1600920045, + "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", + "owner": "input-output-hk", + "repo": "ghc", + "rev": "95713a6ecce4551240da7c96b6176f980af75cae", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "release/8.6.5-iohk", + "repo": "ghc", + "type": "github" + } + }, + "ghc-8.6.5-iohk_2": { + "flake": false, + "locked": { + "lastModified": 1600920045, + "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", + "owner": "input-output-hk", + "repo": "ghc", + "rev": "95713a6ecce4551240da7c96b6176f980af75cae", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "release/8.6.5-iohk", + "repo": "ghc", + "type": "github" + } + }, + "gitignore-nix": { + "flake": false, + "locked": { + "lastModified": 1611672876, + "narHash": "sha256-qHu3uZ/o9jBHiA3MEKHJ06k7w4heOhA+4HCSIvflRxo=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "211907489e9f198594c0eb0ca9256a1949c9d412", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore-nix_2": { + "flake": false, + "locked": { + "lastModified": 1611672876, + "narHash": "sha256-qHu3uZ/o9jBHiA3MEKHJ06k7w4heOhA+4HCSIvflRxo=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "211907489e9f198594c0eb0ca9256a1949c9d412", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "goblins": { + "flake": false, + "locked": { + "lastModified": 1598362523, + "narHash": "sha256-z9ut0y6umDIjJIRjz9KSvKgotuw06/S8QDwOtVdGiJ0=", + "owner": "input-output-hk", + "repo": "goblins", + "rev": "cde90a2b27f79187ca8310b6549331e59595e7ba", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "goblins", + "rev": "cde90a2b27f79187ca8310b6549331e59595e7ba", + "type": "github" + } + }, + "hackage": { + "flake": false, + "locked": { + "lastModified": 1638407533, + "narHash": "sha256-ja9xIX8eMQz1zFaqHuoeGztxVnUPqIpebfFPXQCtCmU=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "5786405063958e417fdbcf7e75686f35d63708ac", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, + "hackage-nix": { + "flake": false, + "locked": { + "lastModified": 1637291070, + "narHash": "sha256-hTX2Xo36i9MR6PNwA/89C8daKjxmx5ZS5lwR2Cbp8Yo=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "6ea4ad5f4a5e2303cd64974329ba90ccc410a012", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, + "hackage-nix_2": { + "flake": false, + "locked": { + "lastModified": 1637291070, + "narHash": "sha256-hTX2Xo36i9MR6PNwA/89C8daKjxmx5ZS5lwR2Cbp8Yo=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "6ea4ad5f4a5e2303cd64974329ba90ccc410a012", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, + "hackage_2": { + "flake": false, + "locked": { + "lastModified": 1641604316, + "narHash": "sha256-yadiTlqUcS7f5ANmjjunh1xh1vjGdfAlkOwBq/4Slls=", + "owner": "input-output-hk", + "repo": "hackage.nix", + "rev": "f71140013b530aaa38cc3769976c6b2bdb248891", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "hackage.nix", + "type": "github" + } + }, + "haskell-language-server": { + "flake": false, + "locked": { + "lastModified": 1638136578, + "narHash": "sha256-Reo9BQ12O+OX7tuRfaDPZPBpJW4jnxZetm63BxYncoM=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "745ef26f406dbdd5e4a538585f8519af9f1ccb09", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "1.5.1", + "repo": "haskell-language-server", + "type": "github" + } + }, + "haskell-language-server_2": { + "flake": false, + "locked": { + "lastModified": 1638136578, + "narHash": "sha256-Reo9BQ12O+OX7tuRfaDPZPBpJW4jnxZetm63BxYncoM=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "745ef26f406dbdd5e4a538585f8519af9f1ccb09", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "1.5.1", + "repo": "haskell-language-server", + "type": "github" + } + }, + "haskell-nix": { + "inputs": { + "HTTP": "HTTP", + "cabal-32": "cabal-32", + "cabal-34": "cabal-34", + "cardano-shell": "cardano-shell", + "flake-utils": "flake-utils", + "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", + "hackage": "hackage", + "hpc-coveralls": "hpc-coveralls", + "nix-tools": "nix-tools", + "nixpkgs": [ + "haskell-nix", + "nixpkgs-2105" + ], + "nixpkgs-2003": "nixpkgs-2003", + "nixpkgs-2009": "nixpkgs-2009", + "nixpkgs-2105": "nixpkgs-2105", + "nixpkgs-unstable": "nixpkgs-unstable", + "old-ghc-nix": "old-ghc-nix", + "stackage": "stackage" + }, + "locked": { + "lastModified": 1641511340, + "narHash": "sha256-cdw4HbqukogROTYG4i9LarwN6+xtRRikO0g35tvAtYk=", + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "4aeeba8d713d0b98c92c8c717df24da17d463c1d", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "4aeeba8d713d0b98c92c8c717df24da17d463c1d", + "type": "github" + } + }, + "haskell-nix_2": { + "inputs": { + "HTTP": "HTTP_2", + "cabal-32": "cabal-32_2", + "cabal-34": "cabal-34_2", + "cardano-shell": "cardano-shell_2", + "flake-utils": "flake-utils_2", + "ghc-8.6.5-iohk": "ghc-8.6.5-iohk_2", + "hackage": "hackage_2", + "hpc-coveralls": "hpc-coveralls_2", + "nix-tools": "nix-tools_2", + "nixpkgs": [ + "plutarch", + "haskell-nix", + "nixpkgs-2105" + ], + "nixpkgs-2003": "nixpkgs-2003_2", + "nixpkgs-2009": "nixpkgs-2009_2", + "nixpkgs-2105": "nixpkgs-2105_2", + "nixpkgs-unstable": "nixpkgs-unstable_2", + "old-ghc-nix": "old-ghc-nix_2", + "stackage": "stackage_2" + }, + "locked": { + "lastModified": 1641511340, + "narHash": "sha256-cdw4HbqukogROTYG4i9LarwN6+xtRRikO0g35tvAtYk=", + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "4aeeba8d713d0b98c92c8c717df24da17d463c1d", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "4aeeba8d713d0b98c92c8c717df24da17d463c1d", + "type": "github" + } + }, + "haskell-nix_3": { + "flake": false, + "locked": { + "lastModified": 1629380841, + "narHash": "sha256-gWOWCfX7IgVSvMMYN6rBGK6EA0pk6pmYguXzMvGte+Q=", + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "7215f083b37741446aa325b20c8ba9f9f76015eb", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "haskell.nix", + "type": "github" + } + }, + "haskell-nix_4": { + "flake": false, + "locked": { + "lastModified": 1629380841, + "narHash": "sha256-gWOWCfX7IgVSvMMYN6rBGK6EA0pk6pmYguXzMvGte+Q=", + "owner": "input-output-hk", + "repo": "haskell.nix", + "rev": "7215f083b37741446aa325b20c8ba9f9f76015eb", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "haskell.nix", + "type": "github" + } + }, + "hpc-coveralls": { + "flake": false, + "locked": { + "lastModified": 1607498076, + "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", + "type": "github" + }, + "original": { + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "type": "github" + } + }, + "hpc-coveralls_2": { + "flake": false, + "locked": { + "lastModified": 1607498076, + "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", + "type": "github" + }, + "original": { + "owner": "sevanspowell", + "repo": "hpc-coveralls", + "type": "github" + } + }, + "iohk-monitoring-framework": { + "flake": false, + "locked": { + "lastModified": 1624367860, + "narHash": "sha256-QE3QRpIHIABm+qCP/wP4epbUx0JmSJ9BMePqWEd3iMY=", + "owner": "input-output-hk", + "repo": "iohk-monitoring-framework", + "rev": "46f994e216a1f8b36fe4669b47b2a7011b0e153c", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "iohk-monitoring-framework", + "rev": "46f994e216a1f8b36fe4669b47b2a7011b0e153c", + "type": "github" + } + }, + "iohk-nix": { + "flake": false, + "locked": { + "lastModified": 1626953580, + "narHash": "sha256-iEI9aTOaZMGsjWzcrctrC0usmiagwKT2v1LSDe9/tMU=", + "owner": "input-output-hk", + "repo": "iohk-nix", + "rev": "cbd497f5844249ef8fe617166337d59f2a6ebe90", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "iohk-nix", + "type": "github" + } + }, + "iohk-nix_2": { + "flake": false, + "locked": { + "lastModified": 1626953580, + "narHash": "sha256-iEI9aTOaZMGsjWzcrctrC0usmiagwKT2v1LSDe9/tMU=", + "owner": "input-output-hk", + "repo": "iohk-nix", + "rev": "cbd497f5844249ef8fe617166337d59f2a6ebe90", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "iohk-nix", + "type": "github" + } + }, + "nix-tools": { + "flake": false, + "locked": { + "lastModified": 1636018067, + "narHash": "sha256-ng306fkuwr6V/malWtt3979iAC4yMVDDH2ViwYB6sQE=", + "owner": "input-output-hk", + "repo": "nix-tools", + "rev": "ed5bd7215292deba55d6ab7a4e8c21f8b1564dda", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "nix-tools", + "type": "github" + } + }, + "nix-tools_2": { + "flake": false, + "locked": { + "lastModified": 1636018067, + "narHash": "sha256-ng306fkuwr6V/malWtt3979iAC4yMVDDH2ViwYB6sQE=", + "owner": "input-output-hk", + "repo": "nix-tools", + "rev": "ed5bd7215292deba55d6ab7a4e8c21f8b1564dda", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "nix-tools", + "type": "github" + } + }, + "nixpkgs": { + "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-2003": { + "locked": { + "lastModified": 1620055814, + "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.03-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2003_2": { + "locked": { + "lastModified": 1620055814, + "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.03-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2009": { + "locked": { + "lastModified": 1624271064, + "narHash": "sha256-qns/uRW7MR2EfVf6VEeLgCsCp7pIOjDeR44JzTF09MA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "46d1c3f28ca991601a53e9a14fdd53fcd3dd8416", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.09-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2009_2": { + "locked": { + "lastModified": 1635350005, + "narHash": "sha256-tAMJnUwfaDEB2aa31jGcu7R7bzGELM9noc91L2PbVjg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1c1f5649bb9c1b0d98637c8c365228f57126f361", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-20.09-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2105": { + "locked": { + "lastModified": 1630481079, + "narHash": "sha256-leWXLchbAbqOlLT6tju631G40SzQWPqaAXQG3zH1Imw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "110a2c9ebbf5d4a94486854f18a37a938cfacbbb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-2105_2": { + "locked": { + "lastModified": 1640283157, + "narHash": "sha256-6Ddfop+rKE+Gl9Tjp9YIrkfoYPzb8F80ergdjcq3/MY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "dde1557825c5644c869c5efc7448dc03722a8f09", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-21.05-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1635295995, + "narHash": "sha256-sGYiXjFlxTTMNb4NSkgvX+knOOTipE6gqwPUQpxNF+c=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "22a500a3f87bbce73bd8d777ef920b43a636f018", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable_2": { + "locked": { + "lastModified": 1641285291, + "narHash": "sha256-KYaOBNGar3XWTxTsYPr9P6u74KAqNq0wobEC236U+0c=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0432195a4b8d68faaa7d3d4b355260a3120aeeae", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "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" + } + }, + "old-ghc-nix": { + "flake": false, + "locked": { + "lastModified": 1631092763, + "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", + "owner": "angerman", + "repo": "old-ghc-nix", + "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", + "type": "github" + }, + "original": { + "owner": "angerman", + "ref": "master", + "repo": "old-ghc-nix", + "type": "github" + } + }, + "old-ghc-nix_2": { + "flake": false, + "locked": { + "lastModified": 1631092763, + "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", + "owner": "angerman", + "repo": "old-ghc-nix", + "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", + "type": "github" + }, + "original": { + "owner": "angerman", + "ref": "master", + "repo": "old-ghc-nix", + "type": "github" + } + }, + "optparse-applicative": { + "flake": false, + "locked": { + "lastModified": 1628901899, + "narHash": "sha256-uQx+SEYsCH7JcG3xAT0eJck9yq3y0cvx49bvItLLer8=", + "owner": "input-output-hk", + "repo": "optparse-applicative", + "rev": "7497a29cb998721a9068d5725d49461f2bba0e7a", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "optparse-applicative", + "rev": "7497a29cb998721a9068d5725d49461f2bba0e7a", + "type": "github" + } + }, + "ouroboros-network": { + "flake": false, + "locked": { + "lastModified": 1634917006, + "narHash": "sha256-lwTgyoZBQAaU6Sh7BouGJGUvK1tSVrWhJP63v7MpwKA=", + "owner": "input-output-hk", + "repo": "ouroboros-network", + "rev": "1f4973f36f689d6da75b5d351fb124d66ef1057d", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "ouroboros-network", + "rev": "1f4973f36f689d6da75b5d351fb124d66ef1057d", + "type": "github" + } + }, + "plutarch": { + "inputs": { + "Shrinker": "Shrinker", + "Win32-network": "Win32-network_2", + "cardano-base": "cardano-base_2", + "cardano-crypto": "cardano-crypto_2", + "cardano-prelude": "cardano-prelude_2", + "flake-compat-ci": "flake-compat-ci", + "flat": "flat_2", + "haskell-nix": "haskell-nix_2", + "nixpkgs": [ + "haskell-nix", + "nixpkgs-unstable" + ], + "plutus": "plutus" + }, + "locked": { + "lastModified": 1642004626, + "narHash": "sha256-HXrBQnMwuPB/mwAxZvMHZzspOI4/BBSrvBhUK4g4L2g=", + "owner": "Plutonomicon", + "repo": "plutarch", + "rev": "c9a6760f780046018536dc088afaa0657d130ba2", + "type": "github" + }, + "original": { + "owner": "Plutonomicon", + "repo": "plutarch", + "rev": "c9a6760f780046018536dc088afaa0657d130ba2", + "type": "github" + } + }, + "plutus": { + "inputs": { + "cardano-repo-tool": "cardano-repo-tool", + "gitignore-nix": "gitignore-nix", + "hackage-nix": "hackage-nix", + "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", + "sphinxcontrib-haddock": "sphinxcontrib-haddock", + "stackage-nix": "stackage-nix" + }, + "locked": { + "lastModified": 1641470019, + "narHash": "sha256-o8m86TkI1dTo74YbE9CPPNrBfSDSrf//DMq+v2+woEY=", + "owner": "input-output-hk", + "repo": "plutus", + "rev": "6d8d25d1e84b2a4278da1036aab23da4161b8df8", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "plutus", + "rev": "6d8d25d1e84b2a4278da1036aab23da4161b8df8", + "type": "github" + } + }, + "plutus_2": { + "inputs": { + "cardano-repo-tool": "cardano-repo-tool_2", + "gitignore-nix": "gitignore-nix_2", + "hackage-nix": "hackage-nix_2", + "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", + "sphinxcontrib-haddock": "sphinxcontrib-haddock_2", + "stackage-nix": "stackage-nix_2" + }, + "locked": { + "lastModified": 1641470019, + "narHash": "sha256-o8m86TkI1dTo74YbE9CPPNrBfSDSrf//DMq+v2+woEY=", + "owner": "input-output-hk", + "repo": "plutus", + "rev": "6d8d25d1e84b2a4278da1036aab23da4161b8df8", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "plutus", + "rev": "6d8d25d1e84b2a4278da1036aab23da4161b8df8", + "type": "github" + } + }, + "pre-commit-hooks-nix": { + "flake": false, + "locked": { + "lastModified": 1624971177, + "narHash": "sha256-Amf/nBj1E77RmbSSmV+hg6YOpR+rddCbbVgo5C7BS0I=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "397f0713d007250a2c7a745e555fa16c5dc8cadb", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "pre-commit-hooks-nix_2": { + "flake": false, + "locked": { + "lastModified": 1624971177, + "narHash": "sha256-Amf/nBj1E77RmbSSmV+hg6YOpR+rddCbbVgo5C7BS0I=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "397f0713d007250a2c7a745e555fa16c5dc8cadb", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "Win32-network": "Win32-network", + "cardano-addresses": "cardano-addresses", + "cardano-base": "cardano-base", + "cardano-crypto": "cardano-crypto", + "cardano-ledger-specs": "cardano-ledger-specs", + "cardano-prelude": "cardano-prelude", + "flat": "flat", + "goblins": "goblins", + "haskell-nix": "haskell-nix", + "iohk-monitoring-framework": "iohk-monitoring-framework", + "nixpkgs": [ + "haskell-nix", + "nixpkgs-unstable" + ], + "optparse-applicative": "optparse-applicative", + "ouroboros-network": "ouroboros-network", + "plutarch": "plutarch", + "plutus": "plutus_2" + } + }, + "sphinxcontrib-haddock": { + "flake": false, + "locked": { + "lastModified": 1594136664, + "narHash": "sha256-O9YT3iCUBHP3CEF88VDLLCO2HSP3HqkNA2q2939RnVY=", + "owner": "michaelpj", + "repo": "sphinxcontrib-haddock", + "rev": "f3956b3256962b2d27d5a4e96edb7951acf5de34", + "type": "github" + }, + "original": { + "owner": "michaelpj", + "repo": "sphinxcontrib-haddock", + "type": "github" + } + }, + "sphinxcontrib-haddock_2": { + "flake": false, + "locked": { + "lastModified": 1594136664, + "narHash": "sha256-O9YT3iCUBHP3CEF88VDLLCO2HSP3HqkNA2q2939RnVY=", + "owner": "michaelpj", + "repo": "sphinxcontrib-haddock", + "rev": "f3956b3256962b2d27d5a4e96edb7951acf5de34", + "type": "github" + }, + "original": { + "owner": "michaelpj", + "repo": "sphinxcontrib-haddock", + "type": "github" + } + }, + "stackage": { + "flake": false, + "locked": { + "lastModified": 1638062215, + "narHash": "sha256-1kOXkElNdsUOQ0RKVHWpfxh8Tl4I0rwwusESEDkrasI=", + "owner": "input-output-hk", + "repo": "stackage.nix", + "rev": "17d51e4b25d266beee4f5038258269b5f87a1551", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "stackage.nix", + "type": "github" + } + }, + "stackage-nix": { + "flake": false, + "locked": { + "lastModified": 1597712578, + "narHash": "sha256-c/pcfZ6w5Yp//7oC0hErOGVVphBLc5vc4IZlWKZ/t6E=", + "owner": "input-output-hk", + "repo": "stackage.nix", + "rev": "e32c8b06d56954865725514ce0d98d5d1867e43a", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "stackage.nix", + "type": "github" + } + }, + "stackage-nix_2": { + "flake": false, + "locked": { + "lastModified": 1597712578, + "narHash": "sha256-c/pcfZ6w5Yp//7oC0hErOGVVphBLc5vc4IZlWKZ/t6E=", + "owner": "input-output-hk", + "repo": "stackage.nix", + "rev": "e32c8b06d56954865725514ce0d98d5d1867e43a", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "stackage.nix", + "type": "github" + } + }, + "stackage_2": { + "flake": false, + "locked": { + "lastModified": 1641518807, + "narHash": "sha256-aEULsFF9b0vNLUzaj4lnbci8UL6r/6UvuJsY9x04ZJ0=", + "owner": "input-output-hk", + "repo": "stackage.nix", + "rev": "52fe0717d7e436fdeb6032f1ca342d1d73351716", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "stackage.nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..9af1431 --- /dev/null +++ b/flake.nix @@ -0,0 +1,254 @@ +{ + description = "agora"; + + inputs.haskell-nix.url = + "github:input-output-hk/haskell.nix?rev=4aeeba8d713d0b98c92c8c717df24da17d463c1d"; + inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; + inputs.haskell-nix.inputs.nixpkgs.follows = "haskell-nix/nixpkgs-2105"; + + inputs.plutus.url = + "github:input-output-hk/plutus?rev=6d8d25d1e84b2a4278da1036aab23da4161b8df8"; + + inputs.plutarch.url = + "github:Plutonomicon/plutarch?rev=c9a6760f780046018536dc088afaa0657d130ba2"; + + inputs.goblins.url = + "github:input-output-hk/goblins?rev=cde90a2b27f79187ca8310b6549331e59595e7ba"; + inputs.goblins.flake = false; + + inputs.cardano-addresses.url = + "github:input-output-hk/cardano-addresses?rev=d2f86caa085402a953920c6714a0de6a50b655ec"; + inputs.cardano-addresses.flake = false; + + inputs.optparse-applicative.url = + "github:input-output-hk/optparse-applicative?rev=7497a29cb998721a9068d5725d49461f2bba0e7a"; + inputs.optparse-applicative.flake = false; + + inputs.ouroboros-network.url = + "github:input-output-hk/ouroboros-network?rev=1f4973f36f689d6da75b5d351fb124d66ef1057d"; + inputs.ouroboros-network.flake = false; + + inputs.cardano-ledger-specs.url = + "github:input-output-hk/cardano-ledger-specs?rev=bf008ce028751cae9fb0b53c3bef20f07c06e333"; + inputs.cardano-ledger-specs.flake = false; + + inputs.iohk-monitoring-framework.url = + "github:input-output-hk/iohk-monitoring-framework?rev=46f994e216a1f8b36fe4669b47b2a7011b0e153c"; + inputs.iohk-monitoring-framework.flake = false; + + inputs.cardano-prelude.url = + "github:input-output-hk/cardano-prelude?rev=fd773f7a58412131512b9f694ab95653ac430852"; + inputs.cardano-prelude.flake = false; + + inputs.cardano-base.url = + "github:input-output-hk/cardano-base?rev=4ea7e2d927c9a7f78ddc69738409a5827ab66b98"; + inputs.cardano-base.flake = false; + + inputs.cardano-crypto.url = + "github:input-output-hk/cardano-crypto?rev=07397f0e50da97eaa0575d93bee7ac4b2b2576ec"; + inputs.cardano-crypto.flake = false; + + inputs.flat.url = + "github:Quid2/flat?rev=d32c2c0c0c3c38c41177684ade9febe92d279b06"; + inputs.flat.flake = false; + + inputs.Win32-network.url = + "github:input-output-hk/Win32-network?rev=3825d3abf75f83f406c1f7161883c438dac7277d"; + inputs.Win32-network.flake = false; + + outputs = inputs@{ self, nixpkgs, haskell-nix, plutus, ... }: + let + supportedSystems = with nixpkgs.lib.systems.supported; + tier1 ++ tier2 ++ tier3; + + perSystem = nixpkgs.lib.genAttrs supportedSystems; + + nixpkgsFor = system: + import nixpkgs { + inherit system; + overlays = [ haskell-nix.overlay ]; + inherit (haskell-nix) config; + }; + + deferPluginErrors = true; + + projectFor = system: + let pkgs = nixpkgsFor system; + in (nixpkgsFor system).haskell-nix.cabalProject' { + src = ./.; + compiler-nix-name = "ghc8107"; + cabalProjectFileName = "cabal.project"; + + # This essentially replaces 'cabal-haskell.nix.project' + extraSources = [ + { + src = inputs.cardano-prelude; + subdirs = [ "cardano-prelude" "cardano-prelude-test" ]; + } + { + src = inputs.cardano-base; + subdirs = [ + "base-deriving-via" + "binary" + "binary/test" + "cardano-crypto-class" + "cardano-crypto-praos" + "cardano-crypto-tests" + "measures" + "orphans-deriving-via" + "slotting" + "strict-containers" + ]; + } + + { + src = inputs.iohk-monitoring-framework; + subdirs = [ + "iohk-monitoring" + "tracer-transformers" + "contra-tracer" + "plugins/backend-aggregation" + "plugins/backend-ekg" + "plugins/backend-monitoring" + "plugins/backend-trace-forwarder" + "plugins/scribe-systemd" + ]; + } + { + src = inputs.cardano-ledger-specs; + subdirs = [ + "byron/ledger/impl" + "cardano-ledger-core" + "cardano-protocol-tpraos" + "eras/alonzo/impl" + "eras/byron/chain/executable-spec" + "eras/byron/crypto" + "eras/byron/crypto/test" + "eras/byron/ledger/executable-spec" + "eras/byron/ledger/impl/test" + "eras/shelley/impl" + "eras/shelley-ma/impl" + "eras/shelley/chain-and-ledger/executable-spec" + "eras/shelley/test-suite" + "shelley/chain-and-ledger/shelley-spec-ledger-test" + "libs/non-integral" + "libs/small-steps" + "libs/cardano-ledger-pretty" + "semantics/small-steps-test" + ]; + } + { + src = inputs.ouroboros-network; + subdirs = [ + "monoidal-synchronisation" + "typed-protocols" + "typed-protocols-cborg" + "typed-protocols-examples" + "ouroboros-network" + "ouroboros-network-testing" + "ouroboros-network-framework" + "ouroboros-consensus" + "ouroboros-consensus-byron" + "ouroboros-consensus-cardano" + "ouroboros-consensus-shelley" + "io-sim" + "io-classes" + "network-mux" + "ntp-client" + ]; + } + + { + src = inputs.plutarch; + subdirs = [ "." ]; + } + { + src = inputs.cardano-addresses; + subdirs = [ "core" "command-line" ]; + } + { + src = inputs.goblins; + subdirs = [ "." ]; + } + { + src = inputs.optparse-applicative; + subdirs = [ "." ]; + } + { + src = inputs.cardano-crypto; + subdirs = [ "." ]; + } + { + src = inputs.Win32-network; + subdirs = [ "." ]; + } + { + src = inputs.flat; + subdirs = [ "." ]; + } + { + src = inputs.plutus; + subdirs = [ + "plutus-benchmark" + "plutus-core" + "plutus-errors" + "plutus-ledger-api" + "plutus-metatheory" + "plutus-tx" + "plutus-tx-plugin" + "prettyprinter-configurable" + "word-array" + "stubs/plutus-ghc-stub" + ]; + } + ]; + modules = [{ + packages = { + plutus-ledger.flags.defer-plugin-errors = deferPluginErrors; + cardano-crypto-praos.components.library.pkgconfig = + nixpkgs.lib.mkForce + [ [ (import plutus { inherit system; }).pkgs.libsodium-vrf ] ]; + cardano-crypto-class.components.library.pkgconfig = + nixpkgs.lib.mkForce + [ [ (import plutus { inherit system; }).pkgs.libsodium-vrf ] ]; + }; + }]; + shell = { + withHoogle = true; + + exactDeps = true; + + nativeBuildInputs = with pkgs; [ + cabal-install + hlint + haskellPackages.fourmolu + nixfmt + haskellPackages.cabal-fmt + haskellPackages.apply-refact + haskellPackages.record-dot-preprocessor + entr + gnumake + ]; + + additional = ps: [ ps.plutarch ]; + }; + }; + in { + project = perSystem projectFor; + flake = perSystem (system: (projectFor system).flake { }); + + packages = perSystem (system: self.flake.${system}.packages); + checks = perSystem (system: self.flake.${system}.checks); + check = perSystem (system: + (nixpkgsFor system).runCommand "combined-test" { + nativeBuildInputs = builtins.attrValues self.checks.${system}; + } "touch $out"); + apps = perSystem (system: self.flake.${system}.apps); + devShell = perSystem (system: + self.flake.${system}.devShell.overrideAttrs (oldAttrs: { + buildInputs = (nixpkgsFor system).lib.unique oldAttrs.buildInputs; + })); + defaultPackage = perSystem + (system: self.flake.${system}.packages."liqwid-agora:lib:liqwid-agora"); + }; +} diff --git a/fourmolu.yaml b/fourmolu.yaml new file mode 100644 index 0000000..ef5582d --- /dev/null +++ b/fourmolu.yaml @@ -0,0 +1,8 @@ +indentation: 2 +comma-style: leading +record-brace-space: true +indent-wheres: true +diff-friendly-import-export: true +respectful: true +haddock-style: multi-line +newlines-between-decls: 1 \ No newline at end of file diff --git a/hie.yaml b/hie.yaml new file mode 100644 index 0000000..2a1e864 --- /dev/null +++ b/hie.yaml @@ -0,0 +1,4 @@ +cradle: + cabal: + - path: "./src" + component: "lib:agora" diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..3dc01ba --- /dev/null +++ b/shell.nix @@ -0,0 +1,6 @@ +# This file is no longer useful for normal nix-shell, as it has +# been superseded by flake.nix However, this is still useful for +# lorri to use automatically. +{ system ? builtins.currentSystem }: + +(builtins.getFlake (toString ./.)).devShell.${system} diff --git a/src/Agora/AuthorityToken.hs b/src/Agora/AuthorityToken.hs new file mode 100644 index 0000000..eccae13 --- /dev/null +++ b/src/Agora/AuthorityToken.hs @@ -0,0 +1,32 @@ +module Agora.AuthorityToken (authorityTokenPolicy, AuthorityToken (..)) where + +-------------------------------------------------------------------------------- + +import Prelude + +-------------------------------------------------------------------------------- + +import Plutus.V1.Ledger.Value (AssetClass) + +-------------------------------------------------------------------------------- + +import Plutarch +import Plutarch.Bool +import Plutarch.Builtin +import Plutarch.ScriptContext +import Plutarch.Trace +import Plutarch.Unit (PUnit (..)) + +-------------------------------------------------------------------------------- + +data AuthorityToken = AuthorityToken + { -- | Token that must move in order for minting this to be valid. + authorityAssetClass :: AssetClass + } + +-------------------------------------------------------------------------------- + +authorityTokenPolicy :: AuthorityToken -> Term s (PData :--> PData :--> PScriptContext :--> PUnit) +authorityTokenPolicy _params = + plam $ \_datum _redeemer _ctx -> + pif (pcon PTrue) (pcon PUnit) (ptraceError "Constraint failed")