Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add a section on simple scripts #96

Merged
merged 5 commits into from
Oct 7, 2024
Merged

docs: add a section on simple scripts #96

merged 5 commits into from
Oct 7, 2024

Conversation

sourabhxyz
Copy link
Member

No description provided.

@sourabhxyz sourabhxyz marked this pull request as ready for review October 7, 2024 11:33
@sourabhxyz sourabhxyz requested a review from a team as a code owner October 7, 2024 11:33
@@ -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).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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).
Atlas supports simple scripts, also known as native and timelock scripts. The functionality of simple scripts is explained in the ledger design documents from the Shelley and Mary eras, which you can find [here](https://github.com/IntersectMBO/cardano-ledger) and in the [cardano-node wiki](https://github.com/input-output-hk/cardano-node-wiki/blob/main/docs/reference/simple-scripts.md).


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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 be specified using the exposed constructors of [`GYSimpleScript`](https://haddock.atlas-app.io/GeniusYield-Types-Script-SimpleScript.html#t:GYSimpleScript). They can also be loaded from their JSON representation, as `GYSimpleScript` implements a [`FromJSON`](https://hackage.haskell.org/package/aeson-2.2.3.0/docs/Data-Aeson.html#t:FromJSON) instance. Additionally, we provide the utility function [`readSimpleScript`](https://haddock.atlas-app.io/GeniusYield-Types-Script-SimpleScript.html#v:readSimpleScript), which reads the JSON representation from a file.


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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Simple scripts can also be attached to UTxO outputs, allowing them to be used later as reference scripts when building transactions. You can find an example [here](https://github.com/geniusyield/atlas/blob/main/tests-privnet/GeniusYield/Test/Privnet/SimpleScripts.hs), that demonstrates how to interact with simple scripts, both as reference scripts and in other scenarios.

Copy link
Contributor

@4TT1L4 4TT1L4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. Please see my suggestions.

@@ -0,0 +1,7 @@
# Simple Scripts
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just prefer "Simple Scripts", why ".. in Atlas"? And Native/Timelock are just other names of simple scripts.

@@ -0,0 +1,7 @@
# Simple Scripts

Atlas supports simple scripts, also known as native and timelock scripts. The functionality of simple scripts is explained in the 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).
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd avoid " which are key components in building transactions on the Cardano blockchain. These scripts are critical for establishing spending conditions, such as multisig requirements or timelocks."


Atlas supports simple scripts, also known as native and timelock scripts. The functionality of simple scripts is explained in the 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.
Copy link
Member Author

@sourabhxyz sourabhxyz Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This suggestion, "...type, which represents native and timelock scripts in Atlas. This data type can be used for both creating and interacting with simple scripts programmatically. " is unnecessary. It is already mentioned in beginning of sentence that this is used to specify simple scripts. And the later part "used for both creating and interacting with simple scripts programmatically" is not required as it is not limited to this way of specifying simple script inside Atlas and it is also clear with other paras in this doc.

@sourabhxyz sourabhxyz requested a review from a team as a code owner October 7, 2024 12:07
Copy link
Contributor

@4TT1L4 4TT1L4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for considering my suggestions.

@4TT1L4 4TT1L4 merged commit 0918e59 into main Oct 7, 2024
3 checks passed
@4TT1L4 4TT1L4 deleted the simple-script branch October 7, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants