Interface
Interface¶
See the ERC6909 Interface reference for additional information
Functions¶
getBid¶
Get the bid from a bidder for a specific slot and round.
Parameters
Name | Type | Description |
---|---|---|
slot |
uint256 |
The auction slot. |
Returns
Name | Type | Description |
---|---|---|
packedBids |
uint256[] |
Array of bids (in a packed format). uint256(uint128(bidPrice),uint120(itemsToBuy),uint8(biderId)) |
newBidder¶
Add a new bidder to the auction.
Parameters
Name | Type | Description |
---|---|---|
additionalBidder |
address |
The address of the additional bidder. |
removeBidder¶
Remove a bidder from the auction.
Parameters
Name | Type | Description |
---|---|---|
bidderId |
uint8 |
The index of the bidder to be removed. |
addOperator¶
Add a new operator to the auction.
Parameters
Name | Type | Description |
---|---|---|
newOperator |
address |
The address of the new operator |
removeOperator¶
Remove an operator from the auction.
Parameters
Name | Type | Description |
---|---|---|
oldOperator |
address |
Address of operator to be removed. |
openAuction¶
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. |
bid¶
Bid function for bidders to submit manual bids.
Parameters
Name | Type | Description |
---|---|---|
slot |
uint256 |
The auction slot. |
packedBids |
uint256[] |
Array of packed bids |
run¶
Execute the auction for a specific slot.
Parameters
Name | Type | Description |
---|---|---|
slot |
uint256 |
The auction slot. |
settle¶
Settle the auction for a specific slot.
Parameters
Name | Type | Description |
---|---|---|
slot |
uint256 |
The auction slot. |
recipient |
address |
The address of the recipient of the settled funds. |
runAndSettle¶
getBidderInfo¶
Retrieve information about a bidder after auction settlement.
function getBidderInfo(uint256 slot, address bidder) external view returns (uint120 itemsBought, uint128 amountOwed);
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. |
packBid¶
Packed Bid details into a uint256 for submission.
function packBid(uint256 bidPrice, uint256 itemsToBuy, uint256 bidderId) external pure returns (uint256 packedBid);
Parameters
Name | Type | Description |
---|---|---|
bidPrice |
uint256 |
Price per item. |
itemsToBuy |
uint256 |
Items to buy in the auction. |
bidderId |
uint256 |
Id for bidder |
Returns
Name | Type | Description |
---|---|---|
packedBid |
uint256 |
for auction submission |
decodeBid¶
Decode the packed bid information.
function decodeBid(uint256 packedBid) internal pure returns (uint8 bidderId, uint120 itemsToBuy, uint128 bidPrice);
Parameters
Name | Type | Description |
---|---|---|
packedBid |
uint256 |
The packed bid information. |
Returns
Name | Type | Description |
---|---|---|
bidderId |
uint8 |
The bidder's ID. |
itemsToBuy |
uint120 |
The number of items the bidder wants to buy. |
bidPrice |
uint128 |
The price per item in the bid. |
checkAndStoreBid¶
Check the validity of a bid.
function checkAndStoreBid(
bool revertInvalid,
address bidder,
uint256 slot,
uint256 itemsForSale,
uint256[] memory packedBids
) internal;
Parameters
Name | Type | Description |
---|---|---|
revertInvalid |
bool |
true for manual bids causing reverts for invalid data |
bidder |
address |
Address of bidder. |
slot |
uint256 |
The auction slot. |
itemsForSale |
uint256 |
Total items for sale for the slot. |
packedBids |
uint256[] |
Array of packed bids Requirements: - The number of items in the bid must not exceed the available items for sale in the auction. - The bidder must have enough funds to cover the bid amount. |
Structs¶
Auction¶
struct Auction {
uint120 itemsForSale;
bool isOpen;
bool isSettled;
mapping(address => BidderInfo) biddersInfo;
}