chore: convert gift card tutorial to v3

This commit is contained in:
rvcas 2024-08-26 15:41:01 -04:00
parent 3521a8c921
commit c87f459ce7
No known key found for this signature in database
GPG Key ID: C09B64E263F7D68C
2 changed files with 7 additions and 7 deletions

View File

@ -17,8 +17,8 @@ type Action {
type SpendTokenName =
ByteArray
validator(creator: ByteArray) {
fn redeem(
validator redeem(creator: ByteArray) {
spend(
// Each spend input checks for a token name matching the datum being burned
datum: SpendTokenName,
_r: Data,
@ -47,7 +47,7 @@ validator(creator: ByteArray) {
) == -1
}
fn gift_card(rdmr: Action, ctx: ScriptContext) -> Bool {
mint(rdmr: Action, ctx: ScriptContext) -> Bool {
// get values from transaction and purpose
let ScriptContext { transaction, purpose } = ctx

View File

@ -8,8 +8,8 @@ type Action {
Burn
}
validator(token_name: ByteArray, utxo_ref: OutputReference) {
fn gift_card(rdmr: Action, ctx: ScriptContext) -> Bool {
validator gift_card(token_name: ByteArray, utxo_ref: OutputReference) {
mint(rdmr: Action, ctx: ScriptContext) -> Bool {
let ScriptContext { transaction, purpose } = ctx
expect tx.Mint(policy_id) = purpose
@ -33,8 +33,8 @@ validator(token_name: ByteArray, utxo_ref: OutputReference) {
}
}
validator(token_name: ByteArray, policy_id: ByteArray) {
fn redeem(_d: Data, _r: Data, ctx: ScriptContext) -> Bool {
validator redeem(token_name: ByteArray, policy_id: ByteArray) {
spend(_d: Data, _r: Data, ctx: ScriptContext) -> Bool {
let ScriptContext { transaction, .. } = ctx
let Transaction { mint, .. } = transaction