Skip to content

Commit

Permalink
switch contract execution check to check for spending instead of with…
Browse files Browse the repository at this point in the history
…drawing
  • Loading branch information
MicroProofs committed May 7, 2024
1 parent d2fd4ea commit dc48316
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions validators/tunav2.ak
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,16 @@ validator(fortuna_v1_hash: Data, fork_script_hash: Data) {
}

NominateUpgrade(script_hash, output_index) -> {
let Transaction { mint, outputs, withdrawals, validity_range, .. } = tx
let Transaction { inputs, mint, outputs, validity_range, .. } = tx

let valid_cred = ScriptCredential(script_hash)

// Check contract is executable
expect Some(_) =
alist.get_first(withdrawals, Inline(ScriptCredential(script_hash)))
list.find(
inputs,
fn(input) { input.output.address.payment_credential == valid_cred },
)

// Mint nomination token
expect [Pair(nominated_contract_token, 1)] =
Expand Down

0 comments on commit dc48316

Please sign in to comment.