Skip to main content

IOffers

The Offers extension smart contract lets you make and accept offers made for NFTs (ERC-721 or ERC-1155).

Methods

acceptOffer

function acceptOffer(uint256 _offerId) external nonpayable

Accept an offer.

Parameters

NameTypeDescription
_offerIduint256The ID of the offer to accept.

cancelOffer

function cancelOffer(uint256 _offerId) external nonpayable

Cancel an offer.

Parameters

NameTypeDescription
_offerIduint256The ID of the offer to cancel.

getAllOffers

function getAllOffers(uint256 _startId, uint256 _endId) external view returns (struct IOffers.Offer[] offers)

Returns all active (i.e. non-expired or cancelled) offers.

Parameters

NameTypeDescription
_startIduint256undefined
_endIduint256undefined

Returns

NameTypeDescription
offersIOffers.Offer[]undefined

getAllValidOffers

function getAllValidOffers(uint256 _startId, uint256 _endId) external view returns (struct IOffers.Offer[] offers)

Returns all valid offers. An offer is valid if the offeror owns and has approved Marketplace to transfer the offer amount of currency.

Parameters

NameTypeDescription
_startIduint256undefined
_endIduint256undefined

Returns

NameTypeDescription
offersIOffers.Offer[]undefined

getOffer

function getOffer(uint256 _offerId) external view returns (struct IOffers.Offer offer)

Returns an offer for the given offer ID.

Parameters

NameTypeDescription
_offerIduint256undefined

Returns

NameTypeDescription
offerIOffers.Offerundefined

makeOffer

function makeOffer(IOffers.OfferParams _params) external nonpayable returns (uint256 offerId)

Parameters

NameTypeDescription
_paramsIOffers.OfferParamsundefined

Returns

NameTypeDescription
offerIduint256undefined

Events

AcceptedOffer

event AcceptedOffer(address indexed offeror, uint256 indexed offerId, address indexed assetContract, uint256 tokenId, address seller, uint256 quantityBought, uint256 totalPricePaid)

Emitted when an offer is accepted.

Parameters

NameTypeDescription
offeror indexedaddressundefined
offerId indexeduint256undefined
assetContract indexedaddressundefined
tokenIduint256undefined
selleraddressundefined
quantityBoughtuint256undefined
totalPricePaiduint256undefined

CancelledOffer

event CancelledOffer(address indexed offeror, uint256 indexed offerId)

Emitted when an offer is cancelled.

Parameters

NameTypeDescription
offeror indexedaddressundefined
offerId indexeduint256undefined

NewOffer

event NewOffer(address indexed offeror, uint256 indexed offerId, address indexed assetContract, IOffers.Offer offer)

Emitted when a new offer is created.

Parameters

NameTypeDescription
offeror indexedaddressundefined
offerId indexeduint256undefined
assetContract indexedaddressundefined
offerIOffers.Offerundefined