PoolMarketplace

Main point of interaction with an ParaSpace protocol's market

  • Users can:

    • buyWithCredit

    • acceptBidWithCredit

    • batchBuyWithCredit

    • batchAcceptBidWithCredit

To be covered by a proxy contract, owned by the PoolAddressesProvider of the specific market All admin functions are callable by the PoolConfigurator contract defined also in the PoolAddressesProvider

ADDRESSES_PROVIDER

contract IPoolAddressesProvider ADDRESSES_PROVIDER

POOL_REVISION

uint256 POOL_REVISION

constructor

constructor(contract IPoolAddressesProvider provider) public

Constructor.

Parameters

NameTypeDescription

provider

contract IPoolAddressesProvider

The address of the PoolAddressesProvider contract

getRevision

function getRevision() internal pure virtual returns (uint256)

Returns the revision number of the contract

Needs to be defined in the inherited class as a constant.

Return Values

NameTypeDescription

[0]

uint256

The revision number

buyWithCredit

function buyWithCredit(bytes32 marketplaceId, bytes payload, struct DataTypes.Credit credit, uint16 referralCode) external payable virtual

Implements the buyWithCredit feature. BuyWithCredit allows users to buy NFT from various NFT marketplaces including OpenSea, LooksRare, X2Y2 etc. Users can use NFT's credit and will need to pay at most (1 - LTV) * $NFT @dev

Parameters

NameTypeDescription

marketplaceId

bytes32

The marketplace identifier

payload

bytes

The encoded parameters to be passed to marketplace contract (selector eliminated)

credit

struct DataTypes.Credit

The credit that user would like to use for this purchase

referralCode

uint16

The referral code used

batchBuyWithCredit

function batchBuyWithCredit(bytes32[] marketplaceIds, bytes[] payloads, struct DataTypes.Credit[] credits, uint16 referralCode) external payable virtual

Implements the batchBuyWithCredit feature. BuyWithCredit allows users to buy NFT from various NFT marketplaces including OpenSea, LooksRare, X2Y2 etc. Users can use NFT's credit and will need to pay at most (1 - LTV) * $NFT

marketplaceIds[i] should match payload[i] and credits[i]

Parameters

NameTypeDescription

marketplaceIds

bytes32[]

The marketplace identifiers

payloads

bytes[]

The encoded parameters to be passed to marketplace contract (selector eliminated)

credits

struct DataTypes.Credit[]

The credits that user would like to use for this purchase

referralCode

uint16

The referral code used

acceptBidWithCredit

function acceptBidWithCredit(bytes32 marketplaceId, bytes payload, struct DataTypes.Credit credit, address onBehalfOf, uint16 referralCode) external virtual

Implements the acceptBidWithCredit feature. AcceptBidWithCredit allows users to accept a leveraged bid on ParaSpace NFT marketplace. Users can submit leveraged bid and pay at most (1 - LTV) * $NFT

The nft receiver just needs to do the downpayment

Parameters

NameTypeDescription

marketplaceId

bytes32

The marketplace identifier

payload

bytes

The encoded parameters to be passed to marketplace contract (selector eliminated)

credit

struct DataTypes.Credit

The credit that user would like to use for this purchase

onBehalfOf

address

Address of the user who will sell the NFT

referralCode

uint16

The referral code used

batchAcceptBidWithCredit

function batchAcceptBidWithCredit(bytes32[] marketplaceIds, bytes[] payloads, struct DataTypes.Credit[] credits, address onBehalfOf, uint16 referralCode) external virtual

Implements the batchAcceptBidWithCredit feature. AcceptBidWithCredit allows users to accept a leveraged bid on ParaSpace NFT marketplace. Users can submit leveraged bid and pay at most (1 - LTV) * $NFT

The nft receiver just needs to do the downpayment

Parameters

NameTypeDescription

marketplaceIds

bytes32[]

The marketplace identifiers

payloads

bytes[]

The encoded parameters to be passed to marketplace contract (selector eliminated)

credits

struct DataTypes.Credit[]

The credits that the makers have approved to use for this purchase

onBehalfOf

address

Address of the user who will sell the NFTs

referralCode

uint16

The referral code used