Skip to main content

Marketplace

Methods

DEFAULT_ADMIN_ROLE

function DEFAULT_ADMIN_ROLE() external view returns (bytes32)

Returns

NameTypeDescription
_0bytes32undefined

MAX_BPS

function MAX_BPS() external view returns (uint64)

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

Returns

NameTypeDescription
_0uint64undefined

acceptOffer

function acceptOffer(uint256 _listingId, address _offeror, address _currency, uint256 _pricePerToken) external nonpayable

Lets a listing's creator accept an offer for their direct listing.

Parameters

NameTypeDescription
_listingIduint256undefined
_offeroraddressundefined
_currencyaddressundefined
_pricePerTokenuint256undefined

bidBufferBps

function bidBufferBps() external view returns (uint64)

The minimum % increase required from the previous winning bid. Default: 5%.

Returns

NameTypeDescription
_0uint64undefined

buy

function buy(uint256 _listingId, address _buyFor, uint256 _quantityToBuy, address _currency, uint256 _totalPrice) external payable

Lets an account buy a given quantity of tokens from a listing.

Parameters

NameTypeDescription
_listingIduint256undefined
_buyForaddressundefined
_quantityToBuyuint256undefined
_currencyaddressundefined
_totalPriceuint256undefined

cancelDirectListing

function cancelDirectListing(uint256 _listingId) external nonpayable

Lets a direct listing creator cancel their listing.

Parameters

NameTypeDescription
_listingIduint256undefined

closeAuction

function closeAuction(uint256 _listingId, address _closeFor) external nonpayable

Lets an account close an auction for either the (1) winning bidder, or (2) auction creator.

Parameters

NameTypeDescription
_listingIduint256undefined
_closeForaddressundefined

contractType

function contractType() external pure returns (bytes32)

Returns the type of the contract.

Returns

NameTypeDescription
_0bytes32undefined

contractURI

function contractURI() external view returns (string)

Contract level metadata.

Returns

NameTypeDescription
_0stringundefined

contractVersion

function contractVersion() external pure returns (uint8)

Returns the version of the contract.

Returns

NameTypeDescription
_0uint8undefined

createListing

function createListing(IMarketplace.ListingParameters _params) external nonpayable

Parameters

NameTypeDescription
_paramsIMarketplace.ListingParametersundefined

getPlatformFeeInfo

function getPlatformFeeInfo() external view returns (address, uint16)

Returns the platform fee recipient and bps.

Returns

NameTypeDescription
_0addressundefined
_1uint16undefined

getRoleAdmin

function getRoleAdmin(bytes32 role) external view returns (bytes32)

Returns the admin role that controls role. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.

Parameters

NameTypeDescription
rolebytes32undefined

Returns

NameTypeDescription
_0bytes32undefined

getRoleMember

function getRoleMember(bytes32 role, uint256 index) external view returns (address)

Returns one of the accounts that have role. index must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296 for more information.

Parameters

NameTypeDescription
rolebytes32undefined
indexuint256undefined

Returns

NameTypeDescription
_0addressundefined

getRoleMemberCount

function getRoleMemberCount(bytes32 role) external view returns (uint256)

Returns the number of accounts that have role. Can be used together with {getRoleMember} to enumerate all bearers of a role.

Parameters

NameTypeDescription
rolebytes32undefined

Returns

NameTypeDescription
_0uint256undefined

grantRole

function grantRole(bytes32 role, address account) external nonpayable

Grants role to account. If account had not been already granted role, emits a {RoleGranted} event. Requirements: - the caller must have role's admin role. May emit a {RoleGranted} event.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

hasRole

function hasRole(bytes32 role, address account) external view returns (bool)

Returns true if account has been granted role.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

Returns

NameTypeDescription
_0boolundefined

initialize

function initialize(address _defaultAdmin, string _contractURI, address[] _trustedForwarders, address _platformFeeRecipient, uint256 _platformFeeBps) external nonpayable

Initializes the contract, like a constructor.

Parameters

NameTypeDescription
_defaultAdminaddressundefined
_contractURIstringundefined
_trustedForwardersaddress[]undefined
_platformFeeRecipientaddressundefined
_platformFeeBpsuint256undefined

isTrustedForwarder

function isTrustedForwarder(address forwarder) external view returns (bool)

Parameters

NameTypeDescription
forwarderaddressundefined

Returns

NameTypeDescription
_0boolundefined

listings

function listings(uint256) external view returns (uint256 listingId, address tokenOwner, address assetContract, uint256 tokenId, uint256 startTime, uint256 endTime, uint256 quantity, address currency, uint256 reservePricePerToken, uint256 buyoutPricePerToken, enum IMarketplace.TokenType tokenType, enum IMarketplace.ListingType listingType)

Mapping from uid of listing => listing info.

Parameters

NameTypeDescription
_0uint256undefined

Returns

NameTypeDescription
listingIduint256undefined
tokenOwneraddressundefined
assetContractaddressundefined
tokenIduint256undefined
startTimeuint256undefined
endTimeuint256undefined
quantityuint256undefined
currencyaddressundefined
reservePricePerTokenuint256undefined
buyoutPricePerTokenuint256undefined
tokenTypeenum IMarketplace.TokenTypeundefined
listingTypeenum IMarketplace.ListingTypeundefined

multicall

function multicall(bytes[] data) external nonpayable returns (bytes[] results)

Receives and executes a batch of function calls on this contract.

Parameters

NameTypeDescription
databytes[]undefined

Returns

NameTypeDescription
resultsbytes[]undefined

offer

function offer(uint256 _listingId, uint256 _quantityWanted, address _currency, uint256 _pricePerToken, uint256 _expirationTimestamp) external payable

Lets an account (1) make an offer to a direct listing, or (2) make a bid in an auction.

Parameters

NameTypeDescription
_listingIduint256undefined
_quantityWanteduint256undefined
_currencyaddressundefined
_pricePerTokenuint256undefined
_expirationTimestampuint256undefined

offers

function offers(uint256, address) external view returns (uint256 listingId, address offeror, uint256 quantityWanted, address currency, uint256 pricePerToken, uint256 expirationTimestamp)

Mapping from uid of a direct listing => offeror address => offer made to the direct listing by the respective offeror.

Parameters

NameTypeDescription
_0uint256undefined
_1addressundefined

Returns

NameTypeDescription
listingIduint256undefined
offeroraddressundefined
quantityWanteduint256undefined
currencyaddressundefined
pricePerTokenuint256undefined
expirationTimestampuint256undefined

onERC1155BatchReceived

function onERC1155BatchReceived(address, address, uint256[], uint256[], bytes) external nonpayable returns (bytes4)

Parameters

NameTypeDescription
_0addressundefined
_1addressundefined
_2uint256[]undefined
_3uint256[]undefined
_4bytesundefined

Returns

NameTypeDescription
_0bytes4undefined

onERC1155Received

function onERC1155Received(address, address, uint256, uint256, bytes) external nonpayable returns (bytes4)

Parameters

NameTypeDescription
_0addressundefined
_1addressundefined
_2uint256undefined
_3uint256undefined
_4bytesundefined

Returns

NameTypeDescription
_0bytes4undefined

onERC721Received

function onERC721Received(address, address, uint256, bytes) external pure returns (bytes4)

Parameters

NameTypeDescription
_0addressundefined
_1addressundefined
_2uint256undefined
_3bytesundefined

Returns

NameTypeDescription
_0bytes4undefined

renounceRole

function renounceRole(bytes32 role, address account) external nonpayable

Revokes role from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked role, emits a {RoleRevoked} event. Requirements: - the caller must be account. May emit a {RoleRevoked} event.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

revokeRole

function revokeRole(bytes32 role, address account) external nonpayable

Revokes role from account. If account had been granted role, emits a {RoleRevoked} event. Requirements: - the caller must have role's admin role. May emit a {RoleRevoked} event.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

setAuctionBuffers

function setAuctionBuffers(uint256 _timeBuffer, uint256 _bidBufferBps) external nonpayable

Lets a contract admin set auction buffers.

Parameters

NameTypeDescription
_timeBufferuint256undefined
_bidBufferBpsuint256undefined

setContractURI

function setContractURI(string _uri) external nonpayable

Lets a contract admin set the URI for the contract-level metadata.

Parameters

NameTypeDescription
_uristringundefined

setPlatformFeeInfo

function setPlatformFeeInfo(address _platformFeeRecipient, uint256 _platformFeeBps) external nonpayable

Lets a contract admin update platform fee recipient and bps.

Parameters

NameTypeDescription
_platformFeeRecipientaddressundefined
_platformFeeBpsuint256undefined

supportsInterface

function supportsInterface(bytes4 interfaceId) external view returns (bool)

Parameters

NameTypeDescription
interfaceIdbytes4undefined

Returns

NameTypeDescription
_0boolundefined

timeBuffer

function timeBuffer() external view returns (uint64)

The amount of time added to an auction's 'endTime', if a bid is made within timeBuffer seconds of the existing endTime. Default: 15 minutes.

Returns

NameTypeDescription
_0uint64undefined

totalListings

function totalListings() external view returns (uint256)

Total number of listings ever created in the marketplace.

Returns

NameTypeDescription
_0uint256undefined

updateListing

function updateListing(uint256 _listingId, uint256 _quantityToList, uint256 _reservePricePerToken, uint256 _buyoutPricePerToken, address _currencyToAccept, uint256 _startTime, uint256 _secondsUntilEndTime) external nonpayable

Lets a listing's creator edit the listing's parameters.

Parameters

NameTypeDescription
_listingIduint256undefined
_quantityToListuint256undefined
_reservePricePerTokenuint256undefined
_buyoutPricePerTokenuint256undefined
_currencyToAcceptaddressundefined
_startTimeuint256undefined
_secondsUntilEndTimeuint256undefined

winningBid

function winningBid(uint256) external view returns (uint256 listingId, address offeror, uint256 quantityWanted, address currency, uint256 pricePerToken, uint256 expirationTimestamp)

Mapping from uid of an auction listing => current winning bid in an auction.

Parameters

NameTypeDescription
_0uint256undefined

Returns

NameTypeDescription
listingIduint256undefined
offeroraddressundefined
quantityWanteduint256undefined
currencyaddressundefined
pricePerTokenuint256undefined
expirationTimestampuint256undefined

Events

AuctionBuffersUpdated

event AuctionBuffersUpdated(uint256 timeBuffer, uint256 bidBufferBps)

Parameters

NameTypeDescription
timeBufferuint256undefined
bidBufferBpsuint256undefined

AuctionClosed

event AuctionClosed(uint256 indexed listingId, address indexed closer, bool indexed cancelled, address auctionCreator, address winningBidder)

Parameters

NameTypeDescription
listingId indexeduint256undefined
closer indexedaddressundefined
cancelled indexedboolundefined
auctionCreatoraddressundefined
winningBidderaddressundefined

Initialized

event Initialized(uint8 version)

Parameters

NameTypeDescription
versionuint8undefined

ListingAdded

event ListingAdded(uint256 indexed listingId, address indexed assetContract, address indexed lister, IMarketplace.Listing listing)

Parameters

NameTypeDescription
listingId indexeduint256undefined
assetContract indexedaddressundefined
lister indexedaddressundefined
listingIMarketplace.Listingundefined

ListingRemoved

event ListingRemoved(uint256 indexed listingId, address indexed listingCreator)

Parameters

NameTypeDescription
listingId indexeduint256undefined
listingCreator indexedaddressundefined

ListingUpdated

event ListingUpdated(uint256 indexed listingId, address indexed listingCreator)

Parameters

NameTypeDescription
listingId indexeduint256undefined
listingCreator indexedaddressundefined

NewOffer

event NewOffer(uint256 indexed listingId, address indexed offeror, enum IMarketplace.ListingType indexed listingType, uint256 quantityWanted, uint256 totalOfferAmount, address currency)

Parameters

NameTypeDescription
listingId indexeduint256undefined
offeror indexedaddressundefined
listingType indexedenum IMarketplace.ListingTypeundefined
quantityWanteduint256undefined
totalOfferAmountuint256undefined
currencyaddressundefined

NewSale

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

Parameters

NameTypeDescription
listingId indexeduint256undefined
assetContract indexedaddressundefined
lister indexedaddressundefined
buyeraddressundefined
quantityBoughtuint256undefined
totalPricePaiduint256undefined

PlatformFeeInfoUpdated

event PlatformFeeInfoUpdated(address indexed platformFeeRecipient, uint256 platformFeeBps)

Parameters

NameTypeDescription
platformFeeRecipient indexedaddressundefined
platformFeeBpsuint256undefined

RoleAdminChanged

event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)

Parameters

NameTypeDescription
role indexedbytes32undefined
previousAdminRole indexedbytes32undefined
newAdminRole indexedbytes32undefined

RoleGranted

event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)

Parameters

NameTypeDescription
role indexedbytes32undefined
account indexedaddressundefined
sender indexedaddressundefined

RoleRevoked

event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)

Parameters

NameTypeDescription
role indexedbytes32undefined
account indexedaddressundefined
sender indexedaddressundefined