Skip to main content

IAuction

Git Source

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

NameTypeDescription
lotIduint96The 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

NameTypeDescription
lotId_uint96The lot id
params_AuctionParamsThe auction parameters
quoteTokenDecimals_uint8The quote token decimals
baseTokenDecimals_uint8The 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

NameTypeDescription
lotId_uint96The 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

NameTypeDescription
lotId_uint96The lot id

Returns

NameTypeDescription
<none>boolbool 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

NameTypeDescription
lotId_uint96The lot id

Returns

NameTypeDescription
<none>boolbool 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

NameTypeDescription
lotId_uint96The lot id

Returns

NameTypeDescription
<none>boolbool 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

NameTypeDescription
lotId_uint96The lot id

Returns

NameTypeDescription
<none>uint256uint96 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

NameTypeDescription
lotId_uint96The lot id

Returns

NameTypeDescription
<none>boolbool 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

NameTypeDescription
lotId_uint96The 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

NameTypeDescription
startuint48The timestamp when the auction starts
durationuint48The duration of the auction (in seconds)
capacityInQuoteboolWhether or not the capacity is in quote tokens
capacityuint256The capacity of the lot
implParamsbytesAbi-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

NameTypeDescription
startuint48The timestamp when the auction starts
conclusionuint48The timestamp when the auction ends
quoteTokenDecimalsuint8The quote token decimals
baseTokenDecimalsuint8The base token decimals
capacityInQuoteboolWhether or not the capacity is in quote tokens
capacityuint256The capacity of the lot
solduint256The amount of base tokens sold
purchaseduint256The amount of quote tokens purchased

Enums

AuctionType

Types of auctions

enum AuctionType {
Atomic,
Batch
}