Downpayment

This is the entrance contract for down payment

Methods

buy

function buy(address adapter,uint256 borrowAmount,bytes calldata data,Sig calldata sig) external payable;

Buy nft from the marketplace with downpayment

Parameters

NameTypeDescription

adapter

address

address of the marketplace adapter

borrowAmount

uint256

amount of borrowed from lending pool (max borrowable amount: lendPool.getNftCollateralData.availableBorrowsInReserve)

data

bytes

encoded order data for the marketplace, each markeplace have different order type: x2y2, seaport, looksrare, bend

sig

IDownpayment.Sig

signature of the order with nonce, can be verified by eip712 and eip1271

addAdapter

function addAdapter(address adapter) external nonpayable

add new adapter

Parameters

NameTypeDescription

adapter

address

address of the marketplace adapter

removeAdapter

function removeAdapter(address adapter) external nonpayable

remove adapter

Parameters

NameTypeDescription

adapter

address

address of the marketplace adapter

renounceOwnership

function renounceOwnership() external nonpayable

Leaves the contract without owner. It will not be possible to call onlyOwner functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

transferOwnership

function transferOwnership(address newOwner) external nonpayable

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

Parameters

NameTypeDescription

newOwner

address

address of the new owner

View methods

WETH

function WETH() external view returns (address)

Returns

NameTypeDescription

WETH

address

address of the WETH ("Wrapped Ether") contract

getFee

function getFee(address adapter) external view returns (uint256)

Parameters

NameTypeDescription

adapter

address

address of the marketplace adapter

Returns

NameTypeDescription

fee

uint256

protocol fee (e.g., 200 = 2%)

getFeeCollector

function getFeeCollector() external view returns (address)

Returns

feeCollector

address

address of fee collector

getBendLendPool

function getBendLendPool() external view returns (ILendPool)

Returns

NameTypeDescription

bendLendPool

contract ILendPool

address of bend lend pool

getAaveLendPool

function getAaveLendPool() external view returns (IAaveLendPool)

Returns

NameTypeDescription

aaveLendPool

contract IAaveLendPool

address of aave lend pool

nonces

function nonces(address owner) external view returns (uint256)

Parameters

NameTypeDescription

owner

address

address of the owner

Returns

NameTypeDescription

nonce

uint256

next nonce of owner

isAdapterWhitelisted

function isAdapterWhitelisted(address adapter) external view returns (bool)

Returns if a adapter is in the system

Parameters

NameTypeDescription

adapter

address

address of the adapter

Returns

NameTypeDescription

-

bool

whether adapter is whitelisted

owner

function owner() external view returns (address)

Returns the address of the current owner.

Returns

NameTypeDescription

owner

address

address of the current owner

viewCountWhitelistedAdapters

function viewCountWhitelistedAdapters() external view returns (uint256)

View number of whitelisted adapters

Returns

NameTypeDescription

-

uint256

number of adapters valid on the downpayment

viewWhitelistedAdapters

function viewWhitelistedAdapters(uint256 cursor, uint256 size) external view returns (address[], uint256)

See whitelisted adapters in the system

Parameters

NameTypeDescription

cursor

uint256

cursor (should start at 0 for first request)

size

uint256

size of the response (e.g., 50)

Returns

NameTypeDescription

-

address[]

array of adapter addresses

cursor

uint256

cursor position

Last updated