I’m testing/learning about ICRC2 tokens. I understand there’s no mint() function, but you mint new tokens using icrc2_transfer_from() when called by the minting account.
My result as shown always burns and never creates tokens. If using a principal other than the ‘minter’ for ‘from’ or ‘to’, canister becomes trapped: the minter account cannot delegate mints
For minting, use the ICRC-1 transfer method instead of the ICRC-2 transfer from method.
The ICRC-2 method is meant for transferring tye allowance given by another account. The minter account cannot give an allowance to another account.
Just to clarify, ICRC-2 is an extension of ICRC-1, not a newer version or replacement. Similarly there’s also the ICRC-3 extension for ICRC-1 for history blocks and other extensions for ICRC-1 that adds additional methods on top of ICRC-1.
This is not my area of expertise, but in order to perform a mint, the minting account principal would need to be the caller of icrc1_transfer, and the to field would need to be set to an account which is not the minting account, so that you’re transferring from the minting account to a different account.