LendingGetterAndSetterFacet

LendingOperatorSet

event LendingOperatorSet(address lender, address lendingOperator, uint32 tokenId, bool isLendingOperator)

allowRevenueTokens

function allowRevenueTokens(address[] tokens) external

disallowRevenueTokens

function disallowRevenueTokens(address[] tokens) external

setLendingOperator

function setLendingOperator(address _lendingOperator, uint32 _tokenId, bool _isLendingOperator) public

Set the lending operator for a given token

Only the aavegotchi owner can set a lending operator Can only be called when the token is unlocked to prevent borrowers from setting operators

LendingOperatorInputs

struct LendingOperatorInputs {
  uint32 _tokenId;
  bool _isLendingOperator;
}

batchSetLendingOperator

function batchSetLendingOperator(address _lendingOperator, struct LendingGetterAndSetterFacet.LendingOperatorInputs[] _inputs) external

revenueTokenAllowed

function revenueTokenAllowed(address token) external view returns (bool)

getTokenBalancesInEscrow

function getTokenBalancesInEscrow(uint32 _tokenId, address[] _revenueTokens) external view returns (uint256[] revenueBalances)

isLendingOperator

function isLendingOperator(address _lender, address _lendingOperator, uint32 _tokenId) external view returns (bool)

getGotchiLendingListingInfo

function getGotchiLendingListingInfo(uint32 _listingId) external view returns (struct GotchiLending listing_, struct AavegotchiInfo aavegotchiInfo_)

Get an aavegotchi lending details through an identifier

Will throw if the lending does not exist

Parameters

NameTypeDescription

_listingId

uint32

The identifier of the lending to query

Return Values

NameTypeDescription

listing_

struct GotchiLending

A struct containing certain details about the lending like timeCreated etc

aavegotchiInfo_

struct AavegotchiInfo

A struct containing details about the aavegotchi

getLendingListingInfo

function getLendingListingInfo(uint32 _listingId) external view returns (struct GotchiLending listing_)

Get an ERC721 lending details through an identifier

Will throw if the lending does not exist

Parameters

NameTypeDescription

_listingId

uint32

The identifier of the lending to query

Return Values

NameTypeDescription

listing_

struct GotchiLending

A struct containing certain details about the ERC721 lending like timeCreated etc

getGotchiLendingFromToken

function getGotchiLendingFromToken(uint32 _erc721TokenId) external view returns (struct GotchiLending listing_)

Get an aavegotchi lending details through an NFT

Will throw if the lending does not exist

Parameters

NameTypeDescription

_erc721TokenId

uint32

The identifier of the NFT associated with the lending

Return Values

NameTypeDescription

listing_

struct GotchiLending

A struct containing certain details about the lending associated with an NFT of contract identifier _erc721TokenId

getGotchiLendingIdByToken

function getGotchiLendingIdByToken(uint32 _erc721TokenId) external view returns (uint32)

getOwnerGotchiLendings

function getOwnerGotchiLendings(address _lender, bytes32 _status, uint256 _length) external view returns (struct GotchiLending[] listings_)

Query a certain amount of aavegotchi lending listings created by an address

Parameters

NameTypeDescription

_lender

address

Creator of the listings to query

_status

bytes32

Status of the listings to query, "listed" or "agreed"

_length

uint256

How many aavegotchi listings to return

Return Values

NameTypeDescription

listings_

struct GotchiLending[]

An array of lending

getOwnerGotchiLendingsLength

function getOwnerGotchiLendingsLength(address _lender, bytes32 _status) external view returns (uint256)

Query a certain amount of aavegotchi lending listings created by an address

We don't care that this can loop forever since it's just an external view function

getGotchiLendings

function getGotchiLendings(bytes32 _status, uint256 _length) external view returns (struct GotchiLending[] listings_)

Query a certain amount of aavegotchi lending listings

Parameters

NameTypeDescription

_status

bytes32

Status of the listings to query, "listed" or "agreed"

_length

uint256

How many listings to return

Return Values

NameTypeDescription

listings_

struct GotchiLending[]

An array of lending

getLentTokenIdsOfLender

function getLentTokenIdsOfLender(address _lender) external view returns (uint32[] tokenIds_)

balanceOfLentGotchis

function balanceOfLentGotchis(address _lender) external view returns (uint256 balance_)

getGotchiLendingsLength

function getGotchiLendingsLength() external view returns (uint256)

isAavegotchiLent

function isAavegotchiLent(uint32 _erc721TokenId) external view returns (bool)

isAavegotchiListed

function isAavegotchiListed(uint32 _erc721TokenId) external view returns (bool)

getLendingPermissionBitmap

function getLendingPermissionBitmap(uint32 _listingId) external view returns (uint256)

getAllLendingPermissions

function getAllLendingPermissions(uint32 _listingId) external view returns (uint8[32] permissions_)

getLendingPermissionModifier

function getLendingPermissionModifier(uint32 _listingId, uint8 _permissionIndex) public view returns (uint8)

lendingPermissionSetToNone

function lendingPermissionSetToNone(uint32 _listingId) public view returns (bool)