Auctioneer.sol
Read code on GitHub
Implements an auction mechanism for selling block space.
Methods
IdMap
Solidity function IdMap ( address bidder ) external view returns ( uint8 id )
Parameters
Name
Type
Description
bidder
address
undefined
Returns
Name
Type
Description
id
uint8
undefined
WETH9
Solidity function WETH9 () external view returns ( contract WETH )
Returns
Name
Type
Description
_0
contract WETH
undefined
acceptOwnership
Solidity function acceptOwnership () external nonpayable
!!! info The new owner accepts the ownership transfer.
accountant
Solidity function accountant () external view returns ( address )
Returns
Name
Type
Description
_0
address
undefined
allowance
Solidity function allowance ( address , address , uint256 ) external view returns ( uint256 )
Parameters
Name
Type
Description
_0
address
undefined
_1
address
undefined
_2
uint256
undefined
Returns
Name
Type
Description
_0
uint256
undefined
approve
Solidity function approve ( address spender , uint256 id , uint256 amount ) external nonpayable returns ( bool )
Parameters
Name
Type
Description
spender
address
undefined
id
uint256
undefined
amount
uint256
undefined
Returns
Name
Type
Description
_0
bool
undefined
auctions
Solidity function auctions ( uint256 slot ) external view returns ( uint120 itemsForSale , bool isOpen , bool isSettled , bool isPaidOut , bool isRefunded )
Parameters
Name
Type
Description
slot
uint256
undefined
Returns
Name
Type
Description
itemsForSale
uint120
undefined
isOpen
bool
undefined
isSettled
bool
undefined
isPaidOut
bool
undefined
isRefunded
bool
undefined
balanceOf
Solidity function balanceOf ( address , uint256 ) external view returns ( uint256 )
Parameters
Name
Type
Description
_0
address
undefined
_1
uint256
undefined
Returns
Name
Type
Description
_0
uint256
undefined
bid
Solidity function bid ( uint256 slot , uint256 [] packedBids) external nonpayable
!!! info Bid function for bidders to submit manual bids.
Parameters
Name
Type
Description
slot
uint256
The auction slot.
packedBids
uint256[]
Array of packed bids
bidCount
Solidity function bidCount ( uint256 slot ) external view returns ( uint256 count )
Parameters
Name
Type
Description
slot
uint256
undefined
Returns
Name
Type
Description
count
uint256
undefined
bidderMap
Solidity function bidderMap ( uint8 id ) external view returns ( address bidder )
Parameters
Name
Type
Description
id
uint8
undefined
Returns
Name
Type
Description
bidder
address
undefined
calcAverageBid
Solidity function calcAverageBid ( uint256 numAuctions ) external view returns ( uint128 avBidPrice )
Parameters
Name
Type
Description
numAuctions
uint256
Number of auctions to average for
Returns
Name
Type
Description
avBidPrice
uint128
for last n auctions
changeOperator
Solidity function changeOperator ( address newOperator ) external nonpayable
!!! info Change operator of the auction.
Parameters
Name
Type
Description
newOperator
address
The address of the new operator
getBidderInfo
Solidity function getBidderInfo ( uint256 slot , address bidder ) external view returns ( uint120 itemsBought , uint128 amountOwed )
!!! info Retrieve information about a bidder after auction settlement.
Parameters
Name
Type
Description
slot
uint256
The slot identifier of the auction.
bidder
address
The address of the bidder for whom information is requested.
Returns
Name
Type
Description
itemsBought
uint120
The number of items bought by the bidder in the specified auction.
amountOwed
uint128
The amount owed by the bidder for the items bought in the specified auction. Requirements: - The auction must have been settled. - The provided bidder
address must be valid and have participated in the auction.
isOperator
Solidity function isOperator ( address , address ) external view returns ( bool )
Parameters
Name
Type
Description
_0
address
undefined
_1
address
undefined
Returns
Name
Type
Description
_0
bool
undefined
maxBidder
Solidity function maxBidder () external view returns ( uint8 )
Returns
Name
Type
Description
_0
uint8
undefined
maxBids
Solidity function maxBids () external view returns ( uint256 )
Returns
Name
Type
Description
_0
uint256
undefined
minGasAmount
Solidity function minGasAmount () external view returns ( uint120 )
Returns
Name
Type
Description
_0
uint120
undefined
newBidder
Solidity function newBidder ( address additionalBidder ) external nonpayable returns ( uint8 newId )
!!! info Add a new bidder to the auction.
Parameters
Name
Type
Description
additionalBidder
address
The address of the additional bidder.
Returns
Name
Type
Description
newId
uint8
undefined
openAuction
Solidity function openAuction ( uint256 slot , uint120 itemsForSale ) external nonpayable
!!! info Open a new auction for a specific slot.
Parameters
Name
Type
Description
slot
uint256
The auction slot.
itemsForSale
uint120
The number of items available for sale in the auction.
operator
Solidity function operator () external view returns ( address )
Returns
Name
Type
Description
_0
address
undefined
owner
Solidity function owner () external view returns ( address )
Returns
Name
Type
Description
_0
address
undefined
packBid
Solidity function packBid ( uint128 bidPrice , uint120 itemsToBuy , uint8 bidderId ) external pure returns ( uint256 packedBid )
!!! info Packed Bid details into a uint256 for submission.
Parameters
Name
Type
Description
bidPrice
uint128
Price per item.
itemsToBuy
uint120
Items to buy in the auction.
bidderId
uint8
Id for bidder
Returns
Name
Type
Description
packedBid
uint256
for auction submission
payout
Solidity function payout ( uint256 slot ) external nonpayable
Parameters
Name
Type
Description
slot
uint256
The auction slot.
pendingOwner
Solidity function pendingOwner () external view returns ( address )
Returns
Name
Type
Description
_0
address
undefined
refund
Solidity function refund ( uint256 slot ) external nonpayable
Parameters
Name
Type
Description
slot
uint256
The auction slot.
removeBidder
Solidity function removeBidder ( uint8 bidderId ) external nonpayable
!!! info Remove a bidder from the auction.
Parameters
Name
Type
Description
bidderId
uint8
The index of the bidder to be removed.
runAndSettle
Solidity function runAndSettle ( uint256 slot ) external nonpayable
!!! info Execute the auction for a specific slot.
Parameters
Name
Type
Description
slot
uint256
The auction slot.
setOperator
Solidity function setOperator ( address operator , bool approved ) external nonpayable returns ( bool )
Parameters
Name
Type
Description
operator
address
undefined
approved
bool
undefined
Returns
Name
Type
Description
_0
bool
undefined
slotsAuctioned
Solidity function slotsAuctioned ( uint256 index ) external view returns ( uint256 slot )
Parameters
Name
Type
Description
index
uint256
undefined
Returns
Name
Type
Description
slot
uint256
undefined
slotsCount
Solidity function slotsCount () external view returns ( uint256 )
Returns
Name
Type
Description
_0
uint256
undefined
supportsInterface
Solidity function supportsInterface ( bytes4 interfaceId) external view returns ( bool )
Parameters
Name
Type
Description
interfaceId
bytes4
undefined
Returns
Name
Type
Description
_0
bool
undefined
transfer
Solidity function transfer ( address receiver , uint256 id , uint256 amount ) external nonpayable returns ( bool )
Parameters
Name
Type
Description
receiver
address
undefined
id
uint256
undefined
amount
uint256
undefined
Returns
Name
Type
Description
_0
bool
undefined
transferFrom
Solidity function transferFrom ( address sender , address receiver , uint256 id , uint256 amount ) external nonpayable returns ( bool )
Parameters
Name
Type
Description
sender
address
undefined
receiver
address
undefined
id
uint256
undefined
amount
uint256
undefined
Returns
Name
Type
Description
_0
bool
undefined
transferOwnership
Solidity function transferOwnership ( address newOwner ) external nonpayable
!!! info Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
Can only be called by the current owner.
Parameters
Name
Type
Description
newOwner
address
undefined
updateAccountant
Solidity function updateAccountant ( address newAccountant ) external nonpayable
Parameters
Name
Type
Description
newAccountant
address
undefined
updateMaxBids
Solidity function updateMaxBids ( uint256 newMaxBids ) external nonpayable
Parameters
Name
Type
Description
newMaxBids
uint256
undefined
updateMinGasAmount
Solidity function updateMinGasAmount ( uint120 newAmount ) external nonpayable
Parameters
Name
Type
Description
newAmount
uint120
undefined
Events
Approval
Solidity event Approval ( address indexed owner, address indexed spender, uint256 indexed id, uint256 amount )
Parameters
Name
Type
Description
owner indexed
address
undefined
spender indexed
address
undefined
id indexed
uint256
undefined
amount
uint256
undefined
AuctionOpened
Solidity event AuctionOpened ( uint256 indexed slot, uint120 itemsForSale )
Parameters
Name
Type
Description
slot indexed
uint256
undefined
itemsForSale
uint120
undefined
AuctionPaidOut
Solidity event AuctionPaidOut ( uint256 indexed slot)
Parameters
Name
Type
Description
slot indexed
uint256
undefined
AuctionRefund
Solidity event AuctionRefund ( uint256 indexed slot)
Parameters
Name
Type
Description
slot indexed
uint256
undefined
AuctionSettled
Solidity event AuctionSettled ( uint256 indexed slot)
Parameters
Name
Type
Description
slot indexed
uint256
undefined
BidderAdded
Solidity event BidderAdded ( address indexed bidder, uint8 indexed bidderId)
Parameters
Name
Type
Description
bidder indexed
address
undefined
bidderId indexed
uint8
undefined
BidderRemoved
Solidity event BidderRemoved ( address indexed bidder, uint8 indexed bidderId)
Parameters
Name
Type
Description
bidder indexed
address
undefined
bidderId indexed
uint8
undefined
OperatorSet
Solidity event OperatorSet ( address indexed owner, address indexed operator, bool approved )
Parameters
Name
Type
Description
owner indexed
address
undefined
operator indexed
address
undefined
approved
bool
undefined
OperatorUpdated
Solidity event OperatorUpdated ( address indexed oldOperator, address indexed newOperator)
Parameters
Name
Type
Description
oldOperator indexed
address
undefined
newOperator indexed
address
undefined
OwnershipTransferStarted
Solidity event OwnershipTransferStarted ( address indexed previousOwner, address indexed newOwner)
Parameters
Name
Type
Description
previousOwner indexed
address
undefined
newOwner indexed
address
undefined
OwnershipTransferred
Solidity event OwnershipTransferred ( address indexed user, address indexed newOwner)
Parameters
Name
Type
Description
user indexed
address
undefined
newOwner indexed
address
undefined
Transfer
Solidity event Transfer ( address caller , address indexed from, address indexed to, uint256 indexed id, uint256 amount )
Parameters
Name
Type
Description
caller
address
undefined
from indexed
address
undefined
to indexed
address
undefined
id indexed
uint256
undefined
amount
uint256
undefined
Errors
AuctionAlreadyOpen
Solidity error AuctionAlreadyOpen( uint256 slot )
Parameters
Name
Type
Description
slot
uint256
undefined
AuctionAlreadySettled
Solidity error AuctionAlreadySettled( uint256 slot )
Parameters
Name
Type
Description
slot
uint256
undefined
AuctionNotClosed
Solidity error AuctionNotClosed( uint256 slot )
Parameters
Name
Type
Description
slot
uint256
undefined
AuctionNotOpen
Solidity error AuctionNotOpen( uint256 slot )
Parameters
Name
Type
Description
slot
uint256
undefined
BidderAlreadyExists
Solidity error BidderAlreadyExists( address bidder )
Parameters
Name
Type
Description
bidder
address
undefined
BidderNotRegistered
Solidity error BidderNotRegistered( address bidder )
Parameters
Name
Type
Description
bidder
address
undefined
InsufficientFunds
Solidity error InsufficientFunds()
InvalidBidItems
Solidity error InvalidBidItems()
InvalidId
Solidity error InvalidId()
Unauthorized
Solidity error Unauthorized()