IAuction
Interface for all auction modules used in the Axis AuctionHouse
This contract defines the external functions and data that are required for an auction module to be installed in an AuctionHouse.
The implementing contract should define the following additional areas:
- Any un-implemented functions
- State variables for storage and configuration
Data storage:
- Each auction lot will have common data that is stored using the
Lot
struct. Inheriting auction modules may store additional data outside of the struct.
Functions
minAuctionDuration
Minimum auction duration in seconds
function minAuctionDuration() external view returns (uint48);
lotData
General information pertaining to auction lots
See the Lot
struct for more information on the return values
function lotData(
uint96 lotId
)
external
view
returns (
uint48 start,
uint48 conclusion,
uint8 quoteTokenDecimals,
uint8 baseTokenDecimals,
bool capacityInQuote,
uint256 capacity,
uint256 sold,
uint256 purchased
);
Parameters
Name | Type | Description |
---|---|---|
lotId | uint96 | The lot ID |
auction
Create an auction lot
The implementing function should handle the following:
- Validate the lot parameters
- Store the lot data
function auction(
uint96 lotId_,
AuctionParams memory params_,
uint8 quoteTokenDecimals_,
uint8 baseTokenDecimals_
) external;
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | The lot id |
params_ | AuctionParams | The auction parameters |
quoteTokenDecimals_ | uint8 | The quote token decimals |
baseTokenDecimals_ | uint8 | The base token decimals |
cancelAuction
Cancel an auction lot
The implementing function should handle the following:
- Validate the lot parameters
- Update the lot data
function cancelAuction(uint96 lotId_) external;
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | The lot id |
isLive
Returns whether the auction is currently accepting bids or purchases
The implementing function should handle the following:
- Return true if the lot is accepting bids/purchases
- Return false if the lot has ended, been cancelled, or not started yet
function isLive(uint96 lotId_) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | The lot id |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | bool Whether or not the lot is active |
isUpcoming
Returns whether the auction is upcoming
The implementing function should handle the following:
- Return true if the lot has not started yet AND has not been cancelled
- Return false if the lot is active, has ended, or was cancelled
function isUpcoming(uint96 lotId_) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | The lot id |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | bool Whether or not the lot is upcoming |
hasEnded
Returns whether the auction has ended
The implementing function should handle the following:
- Return true if the lot is not accepting bids/purchases and will not at any point
- Return false if the lot hasn't started or is actively accepting bids/purchases
function hasEnded(uint96 lotId_) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | The lot id |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | bool Whether or not the lot is active |
remainingCapacity
Get the remaining capacity of a lot
The implementing function should handle the following:
- Return the remaining capacity of the lot
function remainingCapacity(uint96 lotId_) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | The lot id |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | uint96 The remaining capacity of the lot |
capacityInQuote
Get whether or not the capacity is in quote tokens
The implementing function should handle the following:
- Return true if the capacity is in quote tokens
- Return false if the capacity is in base tokens
function capacityInQuote(uint96 lotId_) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | The lot id |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | bool Whether or not the capacity is in quote tokens |
getLot
Get the lot data for a given lot ID
function getLot(uint96 lotId_) external view returns (Lot memory);
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | The lot ID |
auctionType
Get the auction type
function auctionType() external view returns (AuctionType);
Errors
Auction_LotNotActive
error Auction_LotNotActive(uint96 lotId);
Auction_LotActive
error Auction_LotActive(uint96 lotId);
Auction_InvalidStart
error Auction_InvalidStart(uint48 start_, uint48 minimum_);
Auction_InvalidDuration
error Auction_InvalidDuration(uint48 duration_, uint48 minimum_);
Auction_InvalidLotId
error Auction_InvalidLotId(uint96 lotId);
Auction_OnlyLotOwner
error Auction_OnlyLotOwner();
Auction_AmountLessThanMinimum
error Auction_AmountLessThanMinimum();
Auction_InvalidParams
error Auction_InvalidParams();
Auction_NotAuthorized
error Auction_NotAuthorized();
Auction_NotImplemented
error Auction_NotImplemented();
Auction_InsufficientCapacity
error Auction_InsufficientCapacity();
Auction_LotNotConcluded
error Auction_LotNotConcluded(uint96 lotId);
Structs
AuctionParams
Parameters when creating an auction lot
struct AuctionParams {
uint48 start;
uint48 duration;
bool capacityInQuote;
uint256 capacity;
bytes implParams;
}
Properties
Name | Type | Description |
---|---|---|
start | uint48 | The timestamp when the auction starts |
duration | uint48 | The duration of the auction (in seconds) |
capacityInQuote | bool | Whether or not the capacity is in quote tokens |
capacity | uint256 | The capacity of the lot |
implParams | bytes | Abi-encoded implementation-specific parameters |
Lot
Core data for an auction lot
struct Lot {
uint48 start;
uint48 conclusion;
uint8 quoteTokenDecimals;
uint8 baseTokenDecimals;
bool capacityInQuote;
uint256 capacity;
uint256 sold;
uint256 purchased;
}
Properties
Name | Type | Description |
---|---|---|
start | uint48 | The timestamp when the auction starts |
conclusion | uint48 | The timestamp when the auction ends |
quoteTokenDecimals | uint8 | The quote token decimals |
baseTokenDecimals | uint8 | The base token decimals |
capacityInQuote | bool | Whether or not the capacity is in quote tokens |
capacity | uint256 | The capacity of the lot |
sold | uint256 | The amount of base tokens sold |
purchased | uint256 | The amount of quote tokens purchased |
Enums
AuctionType
Types of auctions
enum AuctionType {
Atomic,
Batch
}