Skip to main content

IEnglishAuctions

The EnglishAuctions extension smart contract lets you sell NFTs (ERC-721 or ERC-1155) in an english auction.

Methods

bidInAuction

function bidInAuction(uint256 _auctionId, uint256 _bidAmount) external payable

Bid in an active auction.

Parameters

NameTypeDescription
_auctionIduint256The ID of the auction to bid in.
_bidAmountuint256The bid amount in the currency specified by the auction.

cancelAuction

function cancelAuction(uint256 _auctionId) external nonpayable

Cancel an auction.

Parameters

NameTypeDescription
_auctionIduint256The ID of the auction to cancel.

collectAuctionPayout

function collectAuctionPayout(uint256 _auctionId) external nonpayable

Distribute the winning bid amount to the auction creator.

Parameters

NameTypeDescription
_auctionIduint256The ID of an auction.

collectAuctionTokens

function collectAuctionTokens(uint256 _auctionId) external nonpayable

Distribute the auctioned NFTs to the winning bidder.

Parameters

NameTypeDescription
_auctionIduint256The ID of an auction.

createAuction

function createAuction(IEnglishAuctions.AuctionParameters _params) external nonpayable returns (uint256 auctionId)

Parameters

NameTypeDescription
_paramsIEnglishAuctions.AuctionParametersundefined

Returns

NameTypeDescription
auctionIduint256undefined

getAllAuctions

function getAllAuctions(uint256 _startId, uint256 _endId) external view returns (struct IEnglishAuctions.Auction[] auctions)

Returns all non-cancelled auctions.

Parameters

NameTypeDescription
_startIduint256undefined
_endIduint256undefined

Returns

NameTypeDescription
auctionsIEnglishAuctions.Auction[]undefined

getAllValidAuctions

function getAllValidAuctions(uint256 _startId, uint256 _endId) external view returns (struct IEnglishAuctions.Auction[] auctions)

Returns all active auctions.

Parameters

NameTypeDescription
_startIduint256undefined
_endIduint256undefined

Returns

NameTypeDescription
auctionsIEnglishAuctions.Auction[]undefined

getAuction

function getAuction(uint256 _auctionId) external view returns (struct IEnglishAuctions.Auction auction)

Returns the auction of the provided auction ID.

Parameters

NameTypeDescription
_auctionIduint256undefined

Returns

NameTypeDescription
auctionIEnglishAuctions.Auctionundefined

getWinningBid

function getWinningBid(uint256 _auctionId) external view returns (address bidder, address currency, uint256 bidAmount)

Returns the winning bid of an active auction.

Parameters

NameTypeDescription
_auctionIduint256undefined

Returns

NameTypeDescription
bidderaddressundefined
currencyaddressundefined
bidAmountuint256undefined

isAuctionExpired

function isAuctionExpired(uint256 _auctionId) external view returns (bool)

Returns whether an auction is active.

Parameters

NameTypeDescription
_auctionIduint256undefined

Returns

NameTypeDescription
_0boolundefined

isNewWinningBid

function isNewWinningBid(uint256 _auctionId, uint256 _bidAmount) external view returns (bool)

Returns whether a given bid amount would make for a winning bid in an auction.

Parameters

NameTypeDescription
_auctionIduint256The ID of an auction.
_bidAmountuint256The bid amount to check.

Returns

NameTypeDescription
_0boolundefined

Events

AuctionClosed

event AuctionClosed(uint256 indexed auctionId, address indexed assetContract, address indexed closer, uint256 tokenId, address auctionCreator, address winningBidder)

Emitted when an auction is closed.

Parameters

NameTypeDescription
auctionId indexeduint256undefined
assetContract indexedaddressundefined
closer indexedaddressundefined
tokenIduint256undefined
auctionCreatoraddressundefined
winningBidderaddressundefined

CancelledAuction

event CancelledAuction(address indexed auctionCreator, uint256 indexed auctionId)

Emitted when a auction is cancelled.

Parameters

NameTypeDescription
auctionCreator indexedaddressundefined
auctionId indexeduint256undefined

NewAuction

event NewAuction(address indexed auctionCreator, uint256 indexed auctionId, address indexed assetContract, IEnglishAuctions.Auction auction)

Emitted when a new auction is created.

Parameters

NameTypeDescription
auctionCreator indexedaddressundefined
auctionId indexeduint256undefined
assetContract indexedaddressundefined
auctionIEnglishAuctions.Auctionundefined

NewBid

event NewBid(uint256 indexed auctionId, address indexed bidder, address indexed assetContract, uint256 bidAmount, IEnglishAuctions.Auction auction)

Emitted when a new bid is made in an auction.

Parameters

NameTypeDescription
auctionId indexeduint256undefined
bidder indexedaddressundefined
assetContract indexedaddressundefined
bidAmountuint256undefined
auctionIEnglishAuctions.Auctionundefined