NFT
distributor
distributor
There are 2 distributor files, one in internal
and one in external
.
internal
contains abstracted functions used inclaim
external
contains functions get the NFT and merkle roots from the distribution store. It also checks if an NFT is already claimed
library
library
The library directory contains the NFTLib
, which help link with the NFT and App storage while also adding functionalities. Functions include:
stake
stakes an NFT by transferring it to the diamond and adding it to the list of claimed NFTs by the ownerunstake
unstakes the NFT by removing the NFT from the owner's list of claimed NFTsstakedNFTs
retrieves the list of staked NFTs from the ownerliquidateNFT
if the user fails to pay the loan, it liquidates the NFT by transferring it to the NFT liquidation controllerapplyToLoan
unstakes an NFT and uses it to apply to a loanrestakeLinked
retrieves the loan's NFTs and adds them back to the list of owner's staked NFTsverifyLoanSize
it verifies the NFT id to base loan size using the merkle proof
ITellerNFT
ITellerNFT
The interface that defines functions to do the following:
getTier
returns information about a Tier with from a tier indexgetTokenTier
returns information about a Tier for a token IDgetTierHashes
returns an array of image hashes stored on IPFS in a tiergetOwnedTokens
returns an array of token IDs owned by an addressmint
mints a new token for a Tier indexaddTier
adds a new Tier to be minted with the given informationsetContractURIHash
sets the contract level metadata URI hashinitialize
initializes the TellerNFT
NFTFacet
NFTFacet
The NFT facet uses the NFTLib functionalities to help with:
getStakedNFTs
which gets the staked NFTs mapped to an owner's addressgetLoanNFTs
returns the NFTs mapped to a loanstakeNFTs
transfers multiple Teller NFTs to Diamond and applies user stakesetNFTMerkleRoot
sets a merkle root that is used to verify an NFT ID to its predetermined base loan size
Last updated