Skip to content

Commit

Permalink
Repo structure
Browse files Browse the repository at this point in the history
  • Loading branch information
lealobanov committed Dec 11, 2024
1 parent e93c2fa commit fb3533d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions explanations/contract.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
This is a NFT resource that abides by the NFT standard and the Metadata standard. It imports both interfaces into the resource.
This contract defines an NFT resource that fully complies with both the Flow NFT standard and the Metadata standard. The NFT resource includes metadata fields such as id, name, thumbnail, description, power, will, and determination, which are all initialized during the resource's creation.

From there, metadata such as id, name, thumbnail, description, power, will, and determination are defined and initialized. The functions to resolveView and getViews are also included to make viewing the metadata easy.
To facilitate access to this metadata, the contract includes a resolveView function that retrieves specific views based on client requests and a getViews function that lists all the supported views. These functions streamline the process of retrieving and displaying metadata, ensuring that the NFT's information can be easily accessed and used by external applications.
7 changes: 5 additions & 2 deletions explanations/transaction.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Because the above smart contract has metadata in the NFT that is initialized, when minting the NFT you will need to send in those parameters in your transaction.

Here we borrow the minter from the account that holds the NFT Minter. We then take the address of the recepient and make sure they have the capability to store the NFT. Afterwards we mint the NFT with the parameters specified.
Since the smart contract requires metadata to be initialized for each NFT, the minting transaction must include these metadata parameters. This ensures that every NFT created is properly defined with the necessary information.

n the transaction, we first borrow the NFTMinter resource from the account's storage that holds it. Then, we verify that the recipient's account has the capability to store NFTs by checking their collection. If the capability is missing, the transaction will fail to prevent the NFT from being lost.

Finally, we mint the NFT by calling the mintNFT function on the NFTMinter, passing in the required metadata parameters (such as name, description, thumbnail, and custom attributes). Once minted, the NFT is deposited into the recipient's collection, completing the process securely and ensuring that the NFT is properly stored in the intended account.

0 comments on commit fb3533d

Please sign in to comment.