diff --git a/explanations/contract.txt b/explanations/contract.txt index 17a03fb..46445d8 100644 --- a/explanations/contract.txt +++ b/explanations/contract.txt @@ -1 +1 @@ -This function is included in the smart contract so that anyone can create a vault resource and then save it to their account. \ No newline at end of file +The createEmptyVault function is a simple utility within the ExampleToken contract that creates and returns a new instance of the Vault resource. This new Vault is initialized with a balance of 0.0 tokens, meaning it starts empty. The function uses the create Vault(balance: 0.0) syntax to create this new Vault resource. The resulting Vault is then returned as a reference (@Vault), which can be used to store and manage tokens later. This function is typically used when setting up a new account or when a fresh vault is needed to hold tokens, ensuring that the vault starts with no tokens in it. \ No newline at end of file diff --git a/explanations/transaction.txt b/explanations/transaction.txt index 29a9712..20530c2 100644 --- a/explanations/transaction.txt +++ b/explanations/transaction.txt @@ -1,5 +1,6 @@ -Here we are creating a new Vault resource into an account. -When that is created and stored into their private storage, we then create public capabilities that others can use to check balance, or deposit tokens. +This transaction sets up an account to store and manage tokens using the ExampleToken contract. It begins by creating a new, empty Vault to hold tokens, which is initialized with a balance of 0.0. This vault is then stored in the account's private storage. -Once we do that, we check to make sure that the capabilities were indeed created and then we are done with the transaction. +After that, the transaction creates two public capabilities: one for the Receiver interface, allowing others to deposit tokens into the vault, and another for the Balance interface, enabling others to check the vault's balance. These capabilities are published to public paths so they can be accessed externally. + +Finally, the transaction checks that the public capability for receiving tokens was correctly created by attempting to borrow it from the account. \ No newline at end of file