This showcase project contains 4 minting validators:
always_truecheck_redeemercheck_redeemer_2nft
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
This is an introduction to minting validator, akin to hello-world in other programming languages. This validator will allow anyone to mint/burn tokens at anytime.
This is a trivial minting validator, anyone is allowed to mint/burn tokens at anytime as long as they provide the redeemer value of 42.
This is similar to check_redeemer but the redeemer is a custom type instead of a primitive type, defined as:
pub type MyRedeemer {
key: ByteArray,
value: Int,
}Take a look at the offchain code to see how we can construct a redeemer of this type.
We explore the concept of "One-shot" Minting policies to enforce token uniqueness.
See: https://aiken-lang.org/fundamentals/common-design-patterns#one-shot-minting-policies