Skip to main content

English Periodic Auction

EnglishPeriodicAuctionInternal

_initializeAuction

function _initializeAuction(address repossessor, address initialBidder, uint256 initialPeriodStartTime, uint256 initialPeriodStartTimeOffset, uint256 startingBid, uint256 auctionLengthSeconds, uint256 minBidIncrement, uint256 bidExtensionWindowLengthSeconds, uint256 bidExtensionSeconds) internal

Initialize parameters

_setAuctionParameters

function _setAuctionParameters(address repossessor, uint256 auctionLengthSeconds, uint256 minBidIncrement, uint256 bidExtensionWindowLengthSeconds, uint256 bidExtensionSeconds, uint256 startingBid) internal

Set auction parameters

_isInitialized

function _isInitialized() internal view returns (bool)

Check if initialized

_startingBid

function _startingBid() internal view returns (uint256)

Get starting bid

_repossessor

function _repossessor() internal view returns (address)

Get repossessor

_setRepossessor

function _setRepossessor(address repossessor) internal

Set repossessor

_initialPeriodStartTime

function _initialPeriodStartTime() internal view returns (uint256)

Get initial period start time

_auctionLengthSeconds

function _auctionLengthSeconds() internal view returns (uint256)

Get auction length

_setStartingBid

function _setStartingBid(uint256 startingBid) internal

Set starting bid

_setAuctionLengthSeconds

function _setAuctionLengthSeconds(uint256 auctionLengthSeconds) internal

Set auction length

_minBidIncrement

function _minBidIncrement() internal view returns (uint256)

Get minimum bid increment

_setMinBidIncrement

function _setMinBidIncrement(uint256 minBidIncrement) internal

Set minimum bid increment

_bidExtensionWindowLengthSeconds

function _bidExtensionWindowLengthSeconds() internal view returns (uint256)

Get bid extension window length

_setBidExtensionWindowLengthSeconds

function _setBidExtensionWindowLengthSeconds(uint256 bidExtensionWindowLengthSeconds) internal

Set bid extension window length

_bidExtensionSeconds

function _bidExtensionSeconds() internal view returns (uint256)

Get bid extension

_setBidExtensionSeconds

function _setBidExtensionSeconds(uint256 bidExtensionSeconds) internal

Set bid extension

_initialBidder

function _initialBidder() internal view returns (address)

Get initial bidder

_highestBid

function _highestBid(uint256 tokenId, uint256 round) internal view returns (struct IEnglishPeriodicAuctionInternal.Bid)

Get highest outstanding bid

_bidOf

function _bidOf(uint256 tokenId, uint256 round, address bidder) internal view returns (struct IEnglishPeriodicAuctionInternal.Bid)

Get bid for address

_isAuctionPeriod

function _isAuctionPeriod(uint256 tokenId) internal view returns (bool)

Get is auction period

_isReadyForTransfer

function _isReadyForTransfer(uint256 tokenId) internal view returns (bool)

Is token ready for transfer

_currentAuctionRound

function _currentAuctionRound(uint256 tokenId) internal view returns (uint256)

Get current auction round

_lockedCollateral

function _lockedCollateral(uint256 tokenId, address bidder) internal view returns (uint256)

Get locked collateral from all bids

_availableCollateral

function _availableCollateral(address bidder) internal view returns (uint256)

Get available collateral

_placeBid

function _placeBid(uint256 tokenId, address bidder, uint256 bidAmount, uint256 collateralAmount) internal

Place a bid

_cancelBid

function _cancelBid(uint256 tokenId, uint256 round, address bidder) internal

Cancel bid for current round if not highest bidder

_cancelAllBids

function _cancelAllBids(uint256 tokenId, address bidder) internal

Cancel bids for all rounds

_withdrawCollateral

function _withdrawCollateral(address bidder) internal

Withdraw collateral

_closeAuction

function _closeAuction(uint256 tokenId) internal

Close auction and trigger a transfer to the highest bidder

_auctionStartTime

function _auctionStartTime(uint256 tokenId) internal view returns (uint256 auctionStartTime)

Get auction start time

_auctionEndTime

function _auctionEndTime(uint256 tokenId) internal view returns (uint256 auctionEndTime)

Get auction end time

_calculateFeeFromBid

function _calculateFeeFromBid(uint256 bidAmount) internal view returns (uint256)

Calculate fee from bid

_checkBidAmount

function _checkBidAmount(uint256 bidAmount, uint256 feeAmount) internal view returns (bool)

Check that fee is within rounding error of bid amount

EnglishPeriodicAuctionStorage

Layout

struct Layout {
bool isInitialized;
address initialBidder;
uint256 startingBid;
address repossessor;
uint256 initialPeriodStartTime;
uint256 initialPeriodStartTimeOffset;
uint256 auctionLengthSeconds;
uint256 minBidIncrement;
uint256 bidExtensionWindowLengthSeconds;
uint256 bidExtensionSeconds;
mapping(uint256 => uint256) tokenInitialPeriodStartTime;
mapping(uint256 => uint256) lastPeriodEndTime;
mapping(uint256 => uint256) currentLicensePeriod;
mapping(uint256 => uint256) currentAuctionRound;
mapping(uint256 => uint256) currentAuctionLength;
mapping(uint256 => mapping(uint256 => mapping(address => struct IEnglishPeriodicAuctionInternal.Bid))) bids;
mapping(uint256 => mapping(uint256 => struct IEnglishPeriodicAuctionInternal.Bid)) highestBids;
mapping(address => uint256) availableCollateral;
}

layout

function layout() internal pure returns (struct EnglishPeriodicAuctionStorage.Layout l)

IEnglishPeriodicAuctionInternal

Bid

struct Bid {
address bidder;
uint256 bidAmount;
uint256 feeAmount;
uint256 collateralAmount;
}

InitialPeriodStartTimeSet

event InitialPeriodStartTimeSet(uint256 initialPeriodStartTime)

RepossessorSet

event RepossessorSet(address repossessor)

AuctionLengthSet

event AuctionLengthSet(uint256 auctionLengthSeconds)

MinBidIncrementSet

event MinBidIncrementSet(uint256 minBidIncrement)

BidExtensionWindowLengthSet

event BidExtensionWindowLengthSet(uint256 bidExtensionWindowLengthSeconds)

BidExtensionSet

event BidExtensionSet(uint256 bidExtensionSeconds)

StartingBidSet

event StartingBidSet(uint256 startingBid)

BidPlaced

event BidPlaced(uint256 tokenId, uint256 round, address bidder, uint256 bidAmount)

AuctionClosed

event AuctionClosed(uint256 tokenId, uint256 round, address winningBidder, address previousOwner, uint256 bidAmount)

IPeriodicAuctionReadable

isAuctionPeriod

function isAuctionPeriod(uint256 tokenId) external view returns (bool)

Get is auction period

initialPeriodStartTime

function initialPeriodStartTime() external view returns (uint256)

Get initial period start time

initialBidder

function initialBidder() external view returns (address)

Get initial bidder

IPeriodicAuctionWritable

setRepossessor

function setRepossessor(address _repossessor) external

Set repossessor

setAuctionLengthSeconds

function setAuctionLengthSeconds(uint256 _auctionLengthSeconds) external

Set auction length

setMinBidIncrement

function setMinBidIncrement(uint256 _minBidIncrement) external

Set minimum bid increment

setBidExtensionWindowLengthSeconds

function setBidExtensionWindowLengthSeconds(uint256 _bidExtensionWindowLengthSeconds) external

Set bid extension window length

setBidExtensionSeconds

function setBidExtensionSeconds(uint256 _bidExtensionSeconds) external

@notice Set bid extension seconds

EnglishPeriodicAuctionFacet

COMPONENT_ROLE

bytes32 COMPONENT_ROLE

initializeAuction

function initializeAuction(address repossessor_, address initialBidder_, uint256 initialPeriodStartTime_, uint256 initialPeriodStartTimeOffset_, uint256 startingBid_, uint256 auctionLengthSeconds_, uint256 minBidIncrement_, uint256 bidExtensionWindowLengthSeconds_, uint256 bidExtensionSeconds_) external

Initialize auction parameters

initializeAuction

function initializeAuction(address owner_, address repossessor_, address initialBidder_, uint256 initialPeriodStartTime_, uint256 initialPeriodStartTimeOffset_, uint256 startingBid_, uint256 auctionLengthSeconds_, uint256 minBidIncrement_, uint256 bidExtensionWindowLengthSeconds_, uint256 bidExtensionSeconds_) external

Initialize auction parameters with owner

setAuctionParameters

function setAuctionParameters(address repossessor_, uint256 auctionLengthSeconds_, uint256 minBidIncrement_, uint256 bidExtensionWindowLengthSeconds_, uint256 bidExtensionSeconds_, uint256 startingBid_) external

Set auction parameters

startingBid

function startingBid() external view returns (uint256)

Get starting bid

isAuctionPeriod

function isAuctionPeriod(uint256 tokenId) external view returns (bool)

Get is auction period

initialPeriodStartTime

function initialPeriodStartTime() external view returns (uint256)

Get initial period start time

initialBidder

function initialBidder() external view returns (address)

Get initial bidder

isReadyForTransfer

function isReadyForTransfer(uint256 tokenId) external view returns (bool)

Is token ready for transfer

placeBid

function placeBid(uint256 tokenId, uint256 bidAmount) external payable

Place a bid

cancelBid

function cancelBid(uint256 tokenId, uint256 round) external

Cancel bid for current round

withdrawCollateral

function withdrawCollateral() external

Withdraw collateral

cancelAllBidsAndWithdrawCollateral

function cancelAllBidsAndWithdrawCollateral(uint256 tokenId) external

Cancel all bids and withdraw collateral

cancelBidAndWithdrawCollateral

function cancelBidAndWithdrawCollateral(uint256 tokenId, uint256 round) external

Cancel bid for current round and withdraw collateral

lockedCollateral

function lockedCollateral(uint256 tokenId, address bidder) external view returns (uint256)

Get locked collateral from all bids

availableCollateral

function availableCollateral(address bidder) external view returns (uint256)

Get available collateral

closeAuction

function closeAuction(uint256 tokenId) external

Close auction and trigger a transfer to the highest bidder

calculateFeeFromBid

function calculateFeeFromBid(uint256 bidAmount) external view returns (uint256)

Calculate fee from bid

auctionStartTime

function auctionStartTime(uint256 tokenId) external view returns (uint256)

Get auction start time

auctionEndTime

function auctionEndTime(uint256 tokenId) external view returns (uint256)

Get auction end time

repossessor

function repossessor() external view returns (address)

Get repossessor

setStartingBid

function setStartingBid(uint256 startingBid_) external

Set starting bid

setRepossessor

function setRepossessor(address repossessor_) external

Set repossessor

auctionLengthSeconds

function auctionLengthSeconds() external view returns (uint256)

Get auction length

setAuctionLengthSeconds

function setAuctionLengthSeconds(uint256 auctionLengthSeconds_) external

Set auction length

minBidIncrement

function minBidIncrement() external view returns (uint256)

Get minimum bid increment

setMinBidIncrement

function setMinBidIncrement(uint256 minBidIncrement_) external

Set minimum bid increment

bidExtensionWindowLengthSeconds

function bidExtensionWindowLengthSeconds() external view returns (uint256)

Get bid extension window length

setBidExtensionWindowLengthSeconds

function setBidExtensionWindowLengthSeconds(uint256 bidExtensionWindowLengthSeconds_) external

Set bid extension window length

bidExtensionSeconds

function bidExtensionSeconds() external view returns (uint256)

@notice Get bid extension seconds

setBidExtensionSeconds

function setBidExtensionSeconds(uint256 bidExtensionSeconds_) external

@notice Set bid extension seconds

highestBid

function highestBid(uint256 tokenId) external view returns (struct IEnglishPeriodicAuctionInternal.Bid)

Get highest outstanding bid

highestBid

function highestBid(uint256 tokenId, uint256 round) external view returns (struct IEnglishPeriodicAuctionInternal.Bid)

Get highest outstanding bid for a particular round

bidOf

function bidOf(uint256 tokenId, address bidder) external view returns (struct IEnglishPeriodicAuctionInternal.Bid)

Get bid for address

bidOf

function bidOf(uint256 tokenId, uint256 round, address bidder) external view returns (struct IEnglishPeriodicAuctionInternal.Bid)

Get bid for address for particular round

currentAuctionRound

function currentAuctionRound(uint256 tokenId) external view returns (uint256)

Get current auction round