This project answers the:
adminspending validatorcip_68validator
Install pnpm if you have not by running npm i -g pnpm, and then go to offchain:
- Run
pnpm iif you have never run theoffchain - Run
pnpm devto run theoffchain
When there's no datum, the validator will allow spending if the Transaction is signed by the pkh as specified in the script param;
otherwise the Transaction must be signed by the datum's provided VerificationKeyHash.
let signer = datum |> option.or_else(pkh)
list.has(tx.extra_signatories, signer)?Added insufficient-staking-control vulnerability prevention during token minting by enforcing the ref_token to be sent to self address with no staking part;
and during metadata updating, the ref_token must be resent to the same address.
/// During minting:
mint(..) {
..
pub fn must_send_ref_token_to_self_script(..) {
..
// output self address must not have a stake credential
expect None = ref_token_utxo.address.stake_credential
..
}
..
}
/// During updating:
spend(..) {
..
output.address == input.output.address
..
}