Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions validators/ask.ak
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Datum {
payouts: List<Payout>,
/// Flexible to allow discounts
/// The key that listed the NFT
owner: VerificationKeyHash,
owner: PaymentCredential,
}

/// A user can either buy a token
Expand All @@ -44,8 +44,9 @@ validator {
fn spend(datum: Datum, redeemer: Redeemer, ctx: ScriptContext) -> Bool {
let ScriptContext { transaction, purpose } = ctx

let Transaction { outputs, extra_signatories, .. } = transaction
let Transaction { outputs, inputs , .. } = transaction


// Match on the action.
when redeemer is {
Buy { payout_outputs_offset } -> {
Expand Down Expand Up @@ -81,8 +82,8 @@ validator {
// at any time.
WithdrawOrUpdate ->
// is signed by owner
list.has(extra_signatories, datum.owner)
}
list.any(inputs, fn(input) { input.output.address.payment_credential == datum.owner })
}
}
}

Expand Down