-
Notifications
You must be signed in to change notification settings - Fork 322
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
CIP-0069 | add Datum to ScriptContext #784
Changes from 1 commit
91c0493
21c2670
39005ff
7296a6a
048158b
a8ae527
2b85ccd
2d9e392
ffc4c8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,12 +41,29 @@ This primarily manifests in the ability to use a single validator for both minti | |
All the script purposes have a form of `Redeemer -> ScriptContext -> a` except the `Spending` one. | ||
It has the following form: `Datum -> Redeemer -> ScriptContext -> a`. This is enforced by the Cardano ledger. | ||
|
||
We modify the general signature to be `ScriptArgs -> ScriptContext -> a`. | ||
We make the following modification: | ||
|
||
- The signature of all scripts will be `Redeemer -> ScriptContext -> a`. | ||
- The `ScriptPurpose` type is modified such that the `Spending` variant contains a `Datum`: | ||
|
||
```hs | ||
data ScriptPurpose | ||
= ... | ||
| Spending TxOutRef Datum | ||
... | ||
``` | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest we also specify somewhere here maybe that we need enforce a single argumet to plutus evaluating function, which at the very least means changing type signatures for these two functions for |
||
- A new data type `ScriptIdentifier` is created. | ||
It is identical to the original `ScriptPurpose` and is used in the `txInfoRedeemers` map to uniquely identify a script within a transaction. | ||
|
||
```hs | ||
data ScriptArgs = | ||
RedeemerOnly Redeemer | ||
| RedeemerAndDatum Redeemer Datum | ||
data ScriptIdentifier | ||
= MintingScript CurrencySymbol | ||
| SpendingScript TxOutRef | ||
| RewardingScript Credential | ||
| CertifyingScript Integer TxCert | ||
| VotingScript Voter | ||
| ProposingScript Integer ProposalProcedure | ||
``` | ||
|
||
## Rationale: how does this CIP achieve its goals? | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be Maybe Datum instead of Datum? Or is this a Datum field containing
Datum Hash, InlineDatum, No Datum?