Skip to main content

DirectListingsLogic

Methods

MAX_BPS

function MAX_BPS() external view returns (uint64)

The max bps of the contract. So, 10_000 == 100 %

Returns

NameTypeDescription
_0uint64undefined

_msgData

function _msgData() external view returns (bytes)

Returns

NameTypeDescription
_0bytesundefined

_msgSender

function _msgSender() external view returns (address sender)

Returns

NameTypeDescription
senderaddressundefined

approveBuyerForListing

function approveBuyerForListing(uint256 _listingId, address _buyer, bool _toApprove) external nonpayable

Approve a buyer to buy from a reserved listing.

Parameters

NameTypeDescription
_listingIduint256undefined
_buyeraddressundefined
_toApproveboolundefined

approveCurrencyForListing

function approveCurrencyForListing(uint256 _listingId, address _currency, uint256 _pricePerTokenInCurrency) external nonpayable

Approve a currency as a form of payment for the listing.

Parameters

NameTypeDescription
_listingIduint256undefined
_currencyaddressundefined
_pricePerTokenInCurrencyuint256undefined

buyFromListing

function buyFromListing(uint256 _listingId, address _buyFor, uint256 _quantity, address _currency, uint256 _expectedTotalPrice) external payable

Buy NFTs from a listing.

Parameters

NameTypeDescription
_listingIduint256undefined
_buyForaddressundefined
_quantityuint256undefined
_currencyaddressundefined
_expectedTotalPriceuint256undefined

cancelListing

function cancelListing(uint256 _listingId) external nonpayable

Cancel a listing.

Parameters

NameTypeDescription
_listingIduint256undefined

createListing

function createListing(IDirectListings.ListingParameters _params) external nonpayable returns (uint256 listingId)

Parameters

NameTypeDescription
_paramsIDirectListings.ListingParametersundefined

Returns

NameTypeDescription
listingIduint256undefined

currencyPriceForListing

function currencyPriceForListing(uint256 _listingId, address _currency) external view returns (uint256)

Returns the price per token for a listing, in the given currency.

Parameters

NameTypeDescription
_listingIduint256undefined
_currencyaddressundefined

Returns

NameTypeDescription
_0uint256undefined

getAllListings

function getAllListings(uint256 _startId, uint256 _endId) external view returns (struct IDirectListings.Listing[] _allListings)

Returns all non-cancelled listings.

Parameters

NameTypeDescription
_startIduint256undefined
_endIduint256undefined

Returns

NameTypeDescription
_allListingsIDirectListings.Listing[]undefined

getAllValidListings

function getAllValidListings(uint256 _startId, uint256 _endId) external view returns (struct IDirectListings.Listing[] _validListings)

Returns all valid listings between the start and end Id (both inclusive) provided. A valid listing is where the listing creator still owns and has approved Marketplace to transfer the listed NFTs.

Parameters

NameTypeDescription
_startIduint256undefined
_endIduint256undefined

Returns

NameTypeDescription
_validListingsIDirectListings.Listing[]undefined

getListing

function getListing(uint256 _listingId) external view returns (struct IDirectListings.Listing listing)

Returns a listing at a particular listing ID.

Parameters

NameTypeDescription
_listingIduint256undefined

Returns

NameTypeDescription
listingIDirectListings.Listingundefined

isBuyerApprovedForListing

function isBuyerApprovedForListing(uint256 _listingId, address _buyer) external view returns (bool)

Returns whether a buyer is approved for a listing.

Parameters

NameTypeDescription
_listingIduint256undefined
_buyeraddressundefined

Returns

NameTypeDescription
_0boolundefined

isCurrencyApprovedForListing

function isCurrencyApprovedForListing(uint256 _listingId, address _currency) external view returns (bool)

Returns whether a currency is approved for a listing.

Parameters

NameTypeDescription
_listingIduint256undefined
_currencyaddressundefined

Returns

NameTypeDescription
_0boolundefined

totalListings

function totalListings() external view returns (uint256)

Returns the total number of listings created.

At any point, the return value is the ID of the next listing created.

Returns

NameTypeDescription
_0uint256undefined

updateListing

function updateListing(uint256 _listingId, IDirectListings.ListingParameters _params) external nonpayable

Parameters

NameTypeDescription
_listingIduint256undefined
_paramsIDirectListings.ListingParametersundefined

Events

BuyerApprovedForListing

event BuyerApprovedForListing(uint256 indexed listingId, address indexed buyer, bool approved)

Emitted when a buyer is approved to buy from a reserved listing.

Parameters

NameTypeDescription
listingId indexeduint256undefined
buyer indexedaddressundefined
approvedboolundefined

CancelledListing

event CancelledListing(address indexed listingCreator, uint256 indexed listingId)

Emitted when a listing is cancelled.

Parameters

NameTypeDescription
listingCreator indexedaddressundefined
listingId indexeduint256undefined

CurrencyApprovedForListing

event CurrencyApprovedForListing(uint256 indexed listingId, address indexed currency, uint256 pricePerToken)

Emitted when a currency is approved as a form of payment for the listing.

Parameters

NameTypeDescription
listingId indexeduint256undefined
currency indexedaddressundefined
pricePerTokenuint256undefined

NewListing

event NewListing(address indexed listingCreator, uint256 indexed listingId, address indexed assetContract, IDirectListings.Listing listing)

Emitted when a new listing is created.

Parameters

NameTypeDescription
listingCreator indexedaddressundefined
listingId indexeduint256undefined
assetContract indexedaddressundefined
listingIDirectListings.Listingundefined

NewSale

event NewSale(address indexed listingCreator, uint256 indexed listingId, address indexed assetContract, uint256 tokenId, address buyer, uint256 quantityBought, uint256 totalPricePaid)

Emitted when NFTs are bought from a listing.

Parameters

NameTypeDescription
listingCreator indexedaddressundefined
listingId indexeduint256undefined
assetContract indexedaddressundefined
tokenIduint256undefined
buyeraddressundefined
quantityBoughtuint256undefined
totalPricePaiduint256undefined

UpdatedListing

event UpdatedListing(address indexed listingCreator, uint256 indexed listingId, address indexed assetContract, IDirectListings.Listing listing)

Emitted when a listing is updated.

Parameters

NameTypeDescription
listingCreator indexedaddressundefined
listingId indexeduint256undefined
assetContract indexedaddressundefined
listingIDirectListings.Listingundefined