-
Notifications
You must be signed in to change notification settings - Fork 722
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
Update example-reference-script-usage.sh to also use inline datums #4006
Conversation
ff26f83
to
9d1ae5e
Compare
c2cd1af
to
a2234f9
Compare
+ spending ada at the Plutus script address using the Plutus reference script | ||
|
||
In this example we will use the [Required Redeemer](scripts/plutus/scripts/v2/required-redeemer.plutus) Plutus spending script. In order to execute a reference Plutus spending script, we require the following: | ||
|
||
- Collateral tx input(s) - these are provided and are forfeited in the event the Plutus script fails to execute. | ||
- A Plutus tx output with accompanying datum hash. This is the tx output that sits at the Plutus script address. It must have a datum hash, otherwise, it is unspendable. | ||
- A Plutus tx output. This is the tx output that sits at the Plutus script address. Note because we are using an inline datum, it is not mandatory that the utxo at the plutus script address has a datum hash. |
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.
it is not mandatory
Actually, it strictly cannot have a datum hash because the inline datum we reference cannot witness it. It would then need the datum to be attached to the tx, which means we cannot also reference the inline datum!
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.
We should stress this point, how about: "Note because we are using an inline datum, the utxo at the plutus script address must not have a datum hash because datum witnessing requirements cannot be satisfied with reference inputs. Outputs with datum hashes must have datum included in transaction body as witness."
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.
Actually, it strictly cannot have a datum hash because the inline datum we reference cannot witness it. It would then need the datum to be attached to the tx, which means we cannot also reference the inline datum!
Yep my wording is poor. "it is not mandatory that the utxo at the plutus script address has a datum hash" what I mean to say here is you can use an inline datum instead of a datum hash.
4817c30
to
85439b4
Compare
85439b4
to
96b6144
Compare
Bit scary. It would only fail local validation so we could say that. |
96fa588
to
620705d
Compare
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.
looks good to me!
Add documentation for inline datum usage Implement inline-datum-present cli parser to indicate that an inline datum is present
620705d
to
be290c5
Compare
bors r+ |
Build succeeded: |
We introduce
--reference-tx-in-inline-datum-present
and--tx-in-inline-datum-present
to indicate when we are using an inline datum.