Skip to content

Commit

Permalink
Debug tx
Browse files Browse the repository at this point in the history
  • Loading branch information
lealobanov committed Dec 12, 2024
1 parent 4f77b75 commit 89dc167
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions explanations/contract.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
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.
The VaultMinter resource is designed to allow the controlled minting of new tokens. Access to this resource should be strictly limited, ideally to admins or other highly trusted entities, to maintain the integrity of the token supply.

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.
The VaultMinter provides a mintTokens function that takes two arguments: the amount of tokens to mint and a capability that implements the Receiver interface. Before proceeding, it validates that the provided capability can accept deposits. Once the capability is verified, the specified amount of tokens is added to the total minted supply, ensuring accurate tracking of the token supply.

Afterwards that newly created balance is deposited into the receivers account.
Finally, the newly minted tokens are encapsulated in a Vault resource and deposited directly into the account associated with the provided Receiver capability.
4 changes: 2 additions & 2 deletions explanations/transaction.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
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.
To execute this transaction, the first step is to verify that the signer of the transaction has access to a VaultMinter resource. This resource is required for minting new tokens. If the VaultMinter is available, you then retrieve the account that will receive the minted tokens. This account must have a valid Receiver capability to accept the tokens.

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.
During the execution phase of the transaction, you specify the amount of tokens to be minted and provide the recipient's Receiver capability as arguments. The VaultMinter will mint the specified tokens, validate the recipient's capability, and securely deposit the newly minted tokens into the recipient's account.

0 comments on commit 89dc167

Please sign in to comment.