assist/minting

This module incorporates code for various minting and burning validations.

Functions

by_prefix(
  flat: List<(PolicyId, AssetName, Int)>,
  pid: PolicyId,
  prefix: AssetName,
  amt: Int,
) -> Bool

This checks if a specific policy id, prefix, and amount exist inside the flattened exact value. Instead of searching for exact match, it checks if the token name has the correct prefix. This works if every token name on the policy id is unique. If found then it returns True else False.

minting.by_prefix(flatten_mint_value, pid, tkn, 1)

exact(
  flat: List<(PolicyId, AssetName, Int)>,
  pid: PolicyId,
  tkn: AssetName,
  amt: Int,
) -> Bool

This checks if a specific policy id, token name, and amount exist inside the flattened exact value. It is searching for an exact match. If found then it returns True else False.

minting.exact(flatten_mint_value, pid, tkn, 1)

is_occurring(
  flat: List<(PolicyId, AssetName, Int)>,
  pid: PolicyId,
  tkn: AssetName,
) -> Bool

Prove that a transaction is minting something from a specific policy id and token name but the amount does not matter. This is great for lock-n-mint style contracts where some logic just needs to check if a mint is occuring but not the specifics of the amount being minted or burned. If a mint is occurring then it will return True else False.

minting.is_occurring(flatten_mint_value, pid, tkn)
Search Document