Skip to content

Commit

Permalink
docs: add a section on simple scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabhxyz committed Oct 7, 2024
1 parent ba82f9a commit a57d61f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/additional-features/_meta.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"blueprint": "Blueprint"
}
"blueprint": "Blueprint",
"simple-scripts": "Simple Scripts"
}
7 changes: 7 additions & 0 deletions src/pages/additional-features/simple-scripts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Simple Scripts

Atlas supports simple scripts, aka native and timelock scripts. The functionality of simple scripts is explained in ledger design document of Shelley & Mary era [here](https://github.com/IntersectMBO/cardano-ledger) and also in [cardano-node-wiki](https://github.com/input-output-hk/cardano-node-wiki/blob/main/docs/reference/simple-scripts.md).

Simple scripts can be specified via exposed constructors of [`GYSimpleScript`](https://haddock.atlas-app.io/GeniusYield-Types-Script-SimpleScript.html#t:GYSimpleScript). They can also be read from their JSON representation as `GYSimpleScript` has a [`FromJSON`](https://hackage.haskell.org/package/aeson-2.2.3.0/docs/Data-Aeson.html#t:FromJSON) instance, we also provide a utility function, [`readSimpleScript`](https://haddock.atlas-app.io/GeniusYield-Types-Script-SimpleScript.html#v:readSimpleScript), to read JSON representation from a file.

Simple scripts can also be attached to UTxO outputs to be used as reference script inputs later when building transaction. We have an example [here](https://github.com/geniusyield/atlas/blob/main/tests-privnet/GeniusYield/Test/Privnet/SimpleScripts.hs), demonstrating interaction with simple scripts in both scenarios, when being used as reference and otherwise.

0 comments on commit a57d61f

Please sign in to comment.