NFT
distributor
distributorThere are 2 distributor files, one in internal and one in external.
internalcontains abstracted functions used inclaimexternalcontains functions get the NFT and merkle roots from the distribution store. It also checks if an NFT is already claimed
library
libraryThe library directory contains the NFTLib, which help link with the NFT and App storage while also adding functionalities. Functions include:
stakestakes an NFT by transferring it to the diamond and adding it to the list of claimed NFTs by the ownerunstakeunstakes the NFT by removing the NFT from the owner's list of claimed NFTsstakedNFTsretrieves the list of staked NFTs from the ownerliquidateNFTif the user fails to pay the loan, it liquidates the NFT by transferring it to the NFT liquidation controllerapplyToLoanunstakes an NFT and uses it to apply to a loanrestakeLinkedretrieves the loan's NFTs and adds them back to the list of owner's staked NFTsverifyLoanSizeit verifies the NFT id to base loan size using the merkle proof
ITellerNFT
ITellerNFTThe interface that defines functions to do the following:
getTierreturns information about a Tier with from a tier indexgetTokenTierreturns information about a Tier for a token IDgetTierHashesreturns an array of image hashes stored on IPFS in a tiergetOwnedTokensreturns an array of token IDs owned by an addressmintmints a new token for a Tier indexaddTieradds a new Tier to be minted with the given informationsetContractURIHashsets the contract level metadata URI hashinitializeinitializes the TellerNFT
NFTFacet
NFTFacetThe NFT facet uses the NFTLib functionalities to help with:
getStakedNFTswhich gets the staked NFTs mapped to an owner's addressgetLoanNFTsreturns the NFTs mapped to a loanstakeNFTstransfers multiple Teller NFTs to Diamond and applies user stakesetNFTMerkleRootsets a merkle root that is used to verify an NFT ID to its predetermined base loan size
Last updated
Was this helpful?