Skip to content

Summary Interfaces

Auctioneer Interface

Git Source

Inherits: ERC6909, Ownable2Step

Implements an auction mechanism for selling block space.

Structs

Auction

struct Auction {
    uint120 itemsForSale;
    bool isOpen;
    bool isSettled;
    bool isPaidOut;
    bool isRefunded;
    mapping(address => BidderInfo) biddersInfo;
}

BidderInfo

struct BidderInfo {
    uint120 itemsBought;
    uint128 amountOwed;
}

State Variables

maxBidder

uint8 public maxBidder;

WETH9

WETH public immutable WETH9;

accountant

address public accountant;

maxBids

uint256 public maxBids = 50;

minGasAmount

uint120 public minGasAmount = 20000;

operator

address public operator;

IdMap

mapping(address bidder => uint8 id) public IdMap;

bidderMap

mapping(uint8 id => address bidder) public bidderMap;

auctions

mapping(uint256 slot => Auction) public auctions;

slotsCount

uint256 public slotsCount;

slotsAuctioned

mapping(uint256 index => uint256 slot) public slotsAuctioned;

bidCount

mapping(uint256 slot => uint256 count) public bidCount;

Functions

bid

Bid function for bidders to submit manual bids.

function bid(uint256 slot, uint256[] memory packedBids) external;

Parameters

Name Type Description
slot uint256 The auction slot.
packedBids uint256[] Array of packed bids

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(uint128 bidPrice, uint120 itemsToBuy, uint8 bidderId) external pure returns (uint256 packedBid);

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

calcAverageBid

Calculate average bid price for the last n auctions

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

Events

AuctionSettled

event AuctionSettled(uint256 indexed slot);

BidderAdded

event BidderAdded(address indexed bidder, uint8 indexed bidderId);

BidderRemoved

event BidderRemoved(address indexed bidder, uint8 indexed bidderId);

AuctionOpened

event AuctionOpened(uint256 indexed slot, uint120 itemsForSale);

AuctionPaidOut

event AuctionPaidOut(uint256 indexed slot);

AuctionRefund

event AuctionRefund(uint256 indexed slot);

Errors

InvalidId

error InvalidId();

Unauthorized

error Unauthorized();

InvalidBidItems

error InvalidBidItems();

InsufficientFunds

error InsufficientFunds();

AuctionNotOpen

error AuctionNotOpen(uint256 slot);

AuctionNotClosed

error AuctionNotClosed(uint256 slot);

AuctionAlreadyOpen

error AuctionAlreadyOpen(uint256 slot);

AuctionAlreadySettled

error AuctionAlreadySettled(uint256 slot);

BidderNotRegistered

error BidderNotRegistered(address bidder);

BidderAlreadyExists

error BidderAlreadyExists(address bidder);

SettlementHouse Interface

Git Source

A contract for managing bundles of transactions for a futures token.

Structs

Bundle

struct Bundle {
    address submitter;
    uint256 amountOfGas;
    bytes32[] bundleHashes;
}

State Variables

futuresToken

IERC6909 public immutable futuresToken;

Functions

submitBundle

function submitBundle(uint256 slot, uint256 amountOfGas, bytes32[] calldata bundleHashes) external;

Bidder Interface

Git Source

Functions

getBid

Get the bid from a bidder for a specific slot and round.

function getBid(uint256 slot) external view returns (uint256[] memory packedBids);

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(bidderId))