GotchiLendingFacet

AddGotchiListing

struct AddGotchiListing {
  uint32 tokenId;
  uint96 initialCost;
  uint32 period;
  uint8[3] revenueSplit;
  address originalOwner;
  address thirdParty;
  uint32 whitelistId;
  address[] revenueTokens;
  uint256 permissions;
}

addGotchiListing

function addGotchiListing(struct GotchiLendingFacet.AddGotchiListing p) public

Allow an aavegotchi lender (msg sender) or their lending operator to add request for lending

If the lending request exist, cancel it and replaces it with the new one If the lending is active, unable to cancel

cancelGotchiLending

function cancelGotchiLending(uint32 _listingId) public

Allow an aavegotchi lender or lending operator to cancel his NFT lending through the listingId

Parameters

NameTypeDescription

_listingId

uint32

The identifier of the lending to be cancelled

agreeGotchiLending

function agreeGotchiLending(uint32 _listingId, uint32 _erc721TokenId, uint96 _initialCost, uint32 _period, uint8[3] _revenueSplit) external

Allow a borrower to agree an lending for the NFT

Will throw if the NFT has been lent or if the lending has been canceled already

Parameters

NameTypeDescription

_listingId

uint32

The identifier of the lending to agree

_erc721TokenId

uint32

_initialCost

uint96

_period

uint32

_revenueSplit

uint8[3]

claimGotchiLending

function claimGotchiLending(uint32 _tokenId) public

Allow to claim revenue from the lending

Will throw if the NFT has not been lent or if the lending has been canceled already

Parameters

NameTypeDescription

_tokenId

uint32

The identifier of the lent aavegotchi to claim

claimAndEndGotchiLending

function claimAndEndGotchiLending(uint32 _tokenId) public

Allow a lender or borrower or lending operator to claim revenue from the lending and end the listing

Will throw if the NFT has not been lent or if the lending has been canceled already

Parameters

NameTypeDescription

_tokenId

uint32

The identifier of the lent aavegotchi to claim

extendGotchiLending

function extendGotchiLending(uint32 _tokenId, uint32 extension) public

Allows a lender or lending operator to extend a current listing

addGotchiLending

function addGotchiLending(uint32 _erc721TokenId, uint96 _initialCost, uint32 _period, uint8[3] _revenueSplit, address _originalOwner, address _thirdParty, uint32 _whitelistId, address[] _revenueTokens, uint256 _permissions) external

Exists to keep the same function signature as previous

cancelGotchiLendingByToken

function cancelGotchiLendingByToken(uint32 _erc721TokenId) public

Allow an aavegotchi lender to cancel his NFT lending by providing the NFT contract address and identifier

Parameters

NameTypeDescription

_erc721TokenId

uint32

The identifier of the NFT to be delisted from lending

claimAndEndAndRelistGotchiLending

function claimAndEndAndRelistGotchiLending(uint32 _tokenId) public

Allows a lender or pet operator to end the listing and relist with the same parameters

batchAddGotchiListing

function batchAddGotchiListing(struct GotchiLendingFacet.AddGotchiListing[] listings) external

Add gotchi listings in batch

batchCancelGotchiLending

function batchCancelGotchiLending(uint32[] _listingIds) external

Cancel gotchi listings in batch by listing ID

batchCancelGotchiLendingByToken

function batchCancelGotchiLendingByToken(uint32[] _erc721TokenIds) external

Cancel gotchi listings in batch by token ID

batchClaimGotchiLending

function batchClaimGotchiLending(uint32[] _tokenIds) external

Claim gotchi lendings in batch by token ID

batchClaimAndEndGotchiLending

function batchClaimAndEndGotchiLending(uint32[] _tokenIds) external

Claim and end gotchi lendings in batch by token ID

batchClaimAndEndAndRelistGotchiLending

function batchClaimAndEndAndRelistGotchiLending(uint32[] _tokenIds) external

Claim and end and relist gotchi lendings in batch by token ID

BatchRenew

struct BatchRenew {
  uint32 tokenId;
  uint32 extension;
}

batchExtendGotchiLending

function batchExtendGotchiLending(struct GotchiLendingFacet.BatchRenew[] _batchRenewParams) external

Extend gotchi listings in batch by token ID