01 Apr 2022
Contributed by Flow Blockchain
This resource is used by the admin to mint more tokens.
Smart Contract Example
This resource is created so that more tokens may be minted. Ideally not many people should have access to this, only admins.
The VaultMinter resource takes in an amount as well as a capability that implements the Receiver interface as its arguments.
It checks to make sure the capability exists to receive, and once it does that it adds the amount in the parameters to the total minted supply.
Afterwards that newly created balance is deposited into the receivers account.
When doing the transaction, you first need to check to see if there is a VaultMinter that can be referenced by the signer of the transaction.
If so, then you get an account that has the capability to receive tokens and once you execute the transaction you include the amount of tokens to be minted, as well as the receivers capability in the arguments.