Skip to content

Commit

Permalink
Onchain code for programmable tokens (#4)
Browse files Browse the repository at this point in the history
* onchain code and export scripts

* onchain code and export scripts

* onchain code and export scripts

* Use library from input-output-hk/catalyst-onchain-libs

* Clean up cabal file, export lists, warnings

* Run export-smart-tokens

* Include nixconfig to to use cache (#6)

* Otherwise ghc and friends will be compiled from source.

* There is a nix failure independent of this change which can be fixed
  by deleting the .pre-commit-config.yaml. This should be checked.

* Remove pre-commit-config yaml (#7)

* This file should be auto-generated and its existence prevents nix
  flake development environments being created.

* Add catalyst-onchain-libs to sha256map; ignore pre-commit-yaml

* fix scripts and finish directory linked list implementation

* fix scripts after rebase

* Quality of life changes (#8)

* Stylish Haskell configuration included

* Disabled nixpkgs-fmt (currently no idea why it breaks in the hook)

* nonix pre-commit-hook (not tested myself)

* Delete txt file, address warnings

* Update dependency

---------

Co-authored-by: Jann Müller <[email protected]>
Co-authored-by: Christian Hoener zu Siederdissen <[email protected]>
  • Loading branch information
3 people authored Dec 18, 2024
1 parent d4832e7 commit 992309b
Show file tree
Hide file tree
Showing 35 changed files with 4,424 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ haddocks/
.envrc
get-protocol-parameters.sh
protocol-parameters-mainnet.json
.pre-commit-config.yaml
tags
58 changes: 58 additions & 0 deletions .pre-commit-config.yaml.nonix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# DO NOT MODIFY
# This file was generated by git-hooks.nix
{
"default_stages": [
"pre-commit"
],
"repos": [
{
"hooks": [
{
"always_run": false,
"args": [],
"entry": "/nix/store/l85yyds9b2jzv5swfq4hpjwv21dq7ylr-cabal-fmt-exe-cabal-fmt-0.1.12/bin/cabal-fmt --inplace ",
"exclude": "^$",
"exclude_types": [],
"fail_fast": false,
"files": "\\.(cabal)$",
"id": "cabal-fmt",
"language": "system",
"name": "cabal-fmt",
"pass_filenames": true,
"require_serial": false,
"stages": [
"pre-commit"
],
"types": [
"file"
],
"types_or": [],
"verbose": false
},
{
"always_run": false,
"args": [],
"entry": "/nix/store/in4rzg7z6mkblbasxxsg6dik44jkngbj-stylish-haskell-exe-stylish-haskell-0.14.6.0/bin/stylish-haskell --inplace --config .stylish-haskell.yaml ",
"exclude": "^$",
"exclude_types": [],
"fail_fast": false,
"files": "\\.(hs|lhs)$",
"id": "stylish-haskell",
"language": "system",
"name": "stylish-haskell",
"pass_filenames": true,
"require_serial": false,
"stages": [
"pre-commit"
],
"types": [
"file"
],
"types_or": [],
"verbose": false
}
],
"repo": "local"
}
]
}
32 changes: 32 additions & 0 deletions .stylish-haskell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
steps:

- simple_align:
cases: never
top_level_patterns: never
records: never
multi_way_if: never

- imports:
align: none
post_qualify: true

- language_pragmas:
remove_redundant: false

- trailing_whitespace: {}

columns: 80

newline: native

language_extensions:
- GeneralizedNewtypeDeriving
- ImportQualifiedPost
- NumericUnderscores
- OverloadedStrings
- BangPatterns ## stylish-haskell reports an error when and expression starts with `!`
- TypeOperators ## stylish-haskell reports an error when importing type operators such as `import Prelude (type (~))`

# stylish-haskell doesn't understand Cabal common-stanzas, so let's just
# disable it.
cabal: false
9 changes: 8 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@ packages:
source-repository-package
type: git
location: https://github.com/colll78/plutarch-plutus
tag: 548cb641378b4c00bc02abfdcd723821b08141f5
tag: b2379767c7f1c70acf28206bf922f128adc02f28
subdir:
.
plutarch-ledger-api
plutarch-extra

source-repository-package
type: git
location: https://github.com/input-output-hk/catalyst-onchain-libs
tag: 650a3435f8efbd4bf36e58768fac266ba5beede4
subdir:
src/plutarch-onchain-lib
5 changes: 5 additions & 0 deletions compiled/alwaysFail.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cborHex": "5840583e010000225335738921314c5b6c69622f536d617274546f6b656e732f436f6e7472616374732f50726f746f636f6c506172616d732e68733a36395d001601",
"description": "Always Fail",
"type": "PlutusScriptV3"
}
5 changes: 5 additions & 0 deletions compiled/directoryNodeMintingPolicy.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions compiled/directorySpending.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cborHex": "5906e05906dd010000225335738921324c5b6c69622f536d617274546f6b656e732f4c696e6b65644c6973742f5370656e644469726563746f72792e68733a36385d00132323232325333573466e1d20040021533357346644a66ae71241214c5b6c69622f506c7574617263682f436f72652f5574696c732e68733a3437365d0013325335738921194c5b2e2f506c7574617263682f4c6973742e68733a3330335d0013232300223300200200123002233002002001225335738921194c5b2e2f506c7574617263682f4c6973742e68733a3139375d00153335573e002294054cc94cd5ce2481194c5b2e2f506c7574617263682f426f6f6c2e68733a3134375d0013357340022944c00cd5d0800898011aba2001253357389201214c5b6c69622f506c7574617263682f436f72652f5574696c732e68733a3437375d0013375e6aae7400400c004d5d099299ab9c4901194c5b2e2f506c7574617263682f4c6973742e68733a3234345d0010013758a66ae712412c4c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2f4669656c642e68733a3237385d00135742a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234345d00100137566ae84c94cd5ce249194c5b2e2f506c7574617263682f4c6973742e68733a3234345d001001325335738921194c5b2e2f506c7574617263682f4c6973742e68733a3234365d001357446ae88004d5d10020a4c2c2a66ae71241655061747465726e206d61746368206661696c75726520696e207175616c69666965642027646f2720626c6f636b206174206c69622f536d617274546f6b656e732f4c696e6b65644c6973742f5370656e644469726563746f72792e68733a37393a332d3535001635573c0046aae74004dd519299ab9c49012c4c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2f4669656c642e68733a3237385d0013574264a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234365d001357446ae88004c94cd5ce2481264c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2e68733a3431325d00135573c6ea8004004c94cd5ce2492c4c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2f4669656c642e68733a3237385d001357426ae88c94cd5ce249264c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2e68733a3431325d00135573c6ea8004004cc94cd5ce2481214c5b6c69622f506c7574617263682f436f72652f5574696c732e68733a3634375d0013232300223300200200123002233002002001225335738921214c5b6c69622f506c7574617263682f436f72652f5574696c732e68733a3634375d00153335573e0022c2a666ae68c00cd5d080089aba100113002357440024a66ae71241324c5b6c69622f536d617274546f6b656e732f4c696e6b65644c6973742f5370656e644469726563746f72792e68733a37345d001332253357389201214c5b6c69622f506c7574617263682f436f72652f5574696c732e68733a3437365d0013325335738921194c5b2e2f506c7574617263682f4c6973742e68733a3330335d0013232300223300200200123002233002002001225335738921194c5b2e2f506c7574617263682f4c6973742e68733a3139375d00153335573e002294054cc94cd5ce2481194c5b2e2f506c7574617263682f426f6f6c2e68733a3134375d0013357340022944c00cd5d0800898011aba2001253357389201214c5b6c69622f506c7574617263682f436f72652f5574696c732e68733a3437375d0013375e6aae7400400c004014c94cd5ce24812c4c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2f4669656c642e68733a3237385d00137566ae84d5d119299ab9c491264c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2e68733a3431325d00135573c6ea80040054cd5ce2492c4c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2f4669656c642e68733a3237385d001357426ae88c94cd5ce249264c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2e68733a3431325d00135573c6ea8004004dd61aba153357389201194c5b2e2f506c7574617263682f4c6973742e68733a3234345d0010013574464a66ae712401264c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2e68733a3431325d00135573c6ea8004d5d0a99ab9c491194c5b2e2f506c7574617263682f4c6973742e68733a3234345d001001325335738921264c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2e68733a3431325d00135573c6ea80040041",
"description": "Directory Spending",
"type": "PlutusScriptV3"
}
5 changes: 5 additions & 0 deletions compiled/freezeAndSeizeTransfer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cborHex": "5908f65908f3010000225335738921384c5b6c69622f536d617274546f6b656e732f436f6e7472616374732f4578616d706c655472616e736665724c6f6769632e68733a3138325d00132323232323232533357346644a66ae712401194c5b2e2f506c7574617263682f426f6f6c2e68733a3134335d0013335734004002940cdc39aab9d37546ae84c94cd5ce2481194c5b2e2f506c7574617263682f4c6973742e68733a3234345d0010013574400c9002199911299ab9c491384c5b6c69622f536d617274546f6b656e732f436f6e7472616374732f4578616d706c655472616e736665724c6f6769632e68733a3133325d0013233323230022330020020012300223300200200122253357389201384c5b6c69622f536d617274546f6b656e732f436f6e7472616374732f4578616d706c655472616e736665724c6f6769632e68733a3133345d00153335573e00229444c8c8c8c94ccd5cd19b87480100084c8c8c8c94ccd5cd1991299ab9c491194c5b2e2f506c7574617263682f426f6f6c2e68733a3134335d0013335734004002940cc894cd5ce249194c5b2e2f506c7574617263682f426f6f6c2e68733a3134335d0013335734004002940cdc8001001a999299ab9c4901194c5b2e2f506c7574617263682f426f6f6c2e68733a3134375d0013357340022944cdc8001800899b8f00148900325335738921214c5b6c69622f506c7574617263682f436f72652f5574696c732e68733a3437365d0013325335738921194c5b2e2f506c7574617263682f4c6973742e68733a3330335d0013232300223300200200123002233002002001225335738921194c5b2e2f506c7574617263682f4c6973742e68733a3139375d00153335573e002294054cc94cd5ce2481194c5b2e2f506c7574617263682f426f6f6c2e68733a3134375d0013357340022944c00cd5d0800898011aba2001253357389201214c5b6c69622f506c7574617263682f436f72652f5574696c732e68733a3437375d0013375e6aae74004068004dd59aba153357389201194c5b2e2f506c7574617263682f4c6973742e68733a3234345d00100813300b357440146ae8802458dd719299ab9c4901214c5b6c69622f506c7574617263682f436f72652f5574696c732e68733a3635365d00153335573e0022a66ae712410e4c69737420697320656d7074792e001613253335573e00226ae8400854cd5ce249244c69737420636f6e7461696e73206d6f7265207468616e206f6e6520656c656d656e742e0016357440026ae8800cdd71aba1002375c6ae84018dd6299ab9c4912c4c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2f4669656c642e68733a3237385d00135742a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234345d0010011533573892016c5061747465726e206d61746368206661696c75726520696e207175616c69666965642027646f2720626c6f636b206174206c69622f536d617274546f6b656e732f436f6e7472616374732f4578616d706c655472616e736665724c6f6769632e68733a3134313a31352d3730001635573c0046aae74004dd51aba1325335738921194c5b2e2f506c7574617263682f4c6973742e68733a3234345d001001357440026ae88c94cd5ce249264c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2e68733a3431325d00135573c6ea8004c94cd5ce24812c4c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2f4669656c642e68733a3237385d001357426ae88c94cd5ce249264c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2e68733a3431325d00135573c6ea8004004c010dd69aba13253357389201194c5b2e2f506c7574617263682f4c6973742e68733a3234345d001001325335738921264c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2e68733a3431325d00135573c6ea8004d5d080100200119919180111980100100091801119801001000911299ab9c491214c5b6c69622f506c7574617263682f436f72652f5574696c732e68733a3537335d0015333573466e21201400113300353357389201224c5b6c69622f506c7574617263682f436f72652f5574696c732e68733a313038355d001357446ae88d5d11aba2357446ae88d5d11aba2357446ae88008cdc0800a40282a666ae68cdc4240140022660066ae88d5d11aba2357446ae88008cdc0800a40142666464600446600400400246004466004004002444a66ae712401214c5b6c69622f506c7574617263682f436f72652f5574696c732e68733a3536355d0015333573466e1c00520001357420042660066ae88008cdc0800a40040040020046eb0d5d0a99ab9c4901194c5b2e2f506c7574617263682f4c6973742e68733a3234345d00100637586ae854cd5ce249194c5b2e2f506c7574617263682f4c6973742e68733a3234345d00100433232300223300200200123002233002002001225335738921384c5b6c69622f536d617274546f6b656e732f436f6e7472616374732f4578616d706c655472616e736665724c6f6769632e68733a3138385d00153335573e002200626644a66ae712411c4c5b2e2f506c7574617263682f4275696c74696e2e68733a3231335d0013357400040026ae84d55cf1baa35573a6ae84004c008d5d10009bab35742a66ae712401194c5b2e2f506c7574617263682f4c6973742e68733a3234345d001002149858dd61aba1325335738921194c5b2e2f506c7574617263682f4c6973742e68733a3234345d001001357446ae88004c94cd5ce249194c5b2e2f506c7574617263682f4c6973742e68733a3234365d00135744a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234365d001357446ae88004d5d10009aba20013574400264a66ae712401264c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2e68733a3431325d00135573c6ea8004d5d0a99ab9c491194c5b2e2f506c7574617263682f4c6973742e68733a3234345d0010023574400264a66ae71241264c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2e68733a3431325d00135573c6ea80040041",
"description": "Freeze and Seize Transfer",
"type": "PlutusScriptV3"
}
5 changes: 5 additions & 0 deletions compiled/permissionedMinting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cborHex": "5902b15902ae010000225335738921314c5b6c69622f536d617274546f6b656e732f436f6e7472616374732f50726f746f636f6c506172616d732e68733a36305d001533357346a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3231365d0013232300223300200200123002233002002001225335738921194c5b2e2f506c7574617263682f4c6973742e68733a3139375d00153335573e002294054ccd5cd19baf3574200200829444c008d5d100099299ab9c49012c4c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2f4669656c642e68733a3237385d00137586ae84c94cd5ce2481194c5b2e2f506c7574617263682f4c6973742e68733a3234365d00135744a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234365d00135744a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234365d00135744a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234365d00135744a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234365d00135744a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234365d00135744a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234365d001357446ae88004c94cd5ce2481264c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2e68733a3431325d00135573c6ea80040054cd5ce2492c4c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2f4669656c642e68733a3237385d0013574264a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234345d001001325335738921264c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2e68733a3431325d00135573c6ea80040045261601",
"description": "Permissioned Minting",
"type": "PlutusScriptV3"
}
5 changes: 5 additions & 0 deletions compiled/permissionedTransfer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cborHex": "5902b75902b4010000225335738921374c5b6c69622f536d617274546f6b656e732f436f6e7472616374732f4578616d706c655472616e736665724c6f6769632e68733a39375d001533357346a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3231365d0013232300223300200200123002233002002001225335738921194c5b2e2f506c7574617263682f4c6973742e68733a3139375d00153335573e002294054ccd5cd19baf3574200200829444c008d5d100099299ab9c49012c4c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2f4669656c642e68733a3237385d00137586ae84c94cd5ce2481194c5b2e2f506c7574617263682f4c6973742e68733a3234365d00135744a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234365d00135744a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234365d00135744a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234365d00135744a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234365d00135744a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234365d00135744a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234365d001357446ae88004c94cd5ce2481264c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2e68733a3431325d00135573c6ea80040054cd5ce2492c4c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2f4669656c642e68733a3237385d0013574264a66ae71241194c5b2e2f506c7574617263682f4c6973742e68733a3234345d001001325335738921264c5b2e2f506c7574617263682f44617461526570722f496e7465726e616c2e68733a3431325d00135573c6ea80040045261601",
"description": "Permissioned Transfer",
"type": "PlutusScriptV3"
}
5 changes: 5 additions & 0 deletions compiled/programmableLogicBase.json

Large diffs are not rendered by default.

Loading

0 comments on commit 992309b

Please sign in to comment.