Functions

whitelistToken(): Allows the contract owner to add or remove a token from the whitelist of tokens allowed for loan repayment.

depositNFT(): Enables lenders to deposit their Uniswap V3 NFT positions and set the loan terms (tokenId, loanAmount, loanDuration, and acceptedToken). The function transfers the NFT from the lender to the contract and stores the loan information in the _loans array. It also updates the _loanByLenders mapping.

borrowNFT(): Allows borrowers to take available NFT positions on loan by paying the loan amount to the lender in the accepted token. It updates the loan information in the _loans array and the _loanByBorrowers mapping.

canClaimFees(): A view function that checks if the borrower can claim the fees generated by the NFT position.

claimFees(): Enables borrowers to claim the trading fees generated by their borrowed NFT positions. It calls the collect() function from the Uniswap V3 Position Manager to collect the fees and transfer them to the borrower.

_getTokenForPosition(): A private view function that retrieves token0 and token1 addresses for a given NFT tokenId.

withdrawNFT(): Allows lenders to withdraw their NFT positions once the loan period has ended or if the position has not been borrowed. It transfers the NFT from the contract back to the lender and updates the loan information in the _loans array and the _loanByLenders mapping.

reactivateLoan(): Enables lenders to reactivate a loan by setting new loan terms and depositing their NFT position back into the contract. It updates the loan information in the _loans array and the _loanByLenders mapping.

Last updated