Skip to main content

IAuctionHouse

Git Source

Interface for the Axis AuctionHouse contracts

Functions

auction

Creates a new auction lot

function auction(
RoutingParams calldata routing_,
IAuction.AuctionParams calldata params_,
string calldata infoHash_
) external returns (uint96 lotId);

Parameters

NameTypeDescription
routing_RoutingParamsRouting information for the auction lot
params_IAuction.AuctionParamsAuction parameters for the auction lot
infoHash_stringIPFS hash of the auction information

Returns

NameTypeDescription
lotIduint96ID of the auction lot

cancel

Cancels an auction lot

function cancel(uint96 lotId_, bytes calldata callbackData_) external;

Parameters

NameTypeDescription
lotId_uint96ID of the auction lot
callbackData_bytes(optional) abi-encoded data to be sent to the onCancel callback function

curate

Accept curation request for a lot.

If the curator wishes to charge a fee, it must be set before this function is called.

Access controlled. Must be proposed curator for lot.

function curate(uint96 lotId_, bytes calldata callbackData_) external;

Parameters

NameTypeDescription
lotId_uint96Lot ID
callbackData_bytes(optional) abi-encoded data to be sent to the onCurate callback function

lotCounter

The counter tracks the total number of auction lots

function lotCounter() external view returns (uint96 lotCount);

lotRouting

Mapping of lot IDs to their routing information

See the Routing struct for more information

function lotRouting(
uint96 lotId
)
external
view
returns (
address seller,
address baseToken,
address quoteToken,
Veecode auctionReference,
uint256 funding,
ICallback callbacks,
Veecode derivativeReference,
bool wrapDerivative,
bytes memory derivativeParams
);

Parameters

NameTypeDescription
lotIduint96ID of the auction lot

lotFees

Mapping of lot IDs to their fee information

See the FeeData struct for more information

function lotFees(
uint96 lotId
)
external
view
returns (
address curator,
bool curated,
uint48 curatorFee,
uint48 protocolFee,
uint48 referrerFee
);

Parameters

NameTypeDescription
lotIduint96ID of the auction lot

condensers

Mapping auction and derivative references to the condenser that is used to pass data between them

function condensers(
Veecode auctionRef,
Veecode derivativeRef
) external view returns (Veecode condenserRef);

Parameters

NameTypeDescription
auctionRefVeecodeVersioned keycode for the auction module
derivativeRefVeecodeVersioned keycode for the derivative module

Returns

NameTypeDescription
condenserRefVeecodeVersioned keycode for the condenser module

getAuctionModuleForId

Gets the auction module for a given lot ID

function getAuctionModuleForId(uint96 lotId_) external view returns (IAuction module);

Parameters

NameTypeDescription
lotId_uint96ID of the auction lot

Returns

NameTypeDescription
moduleIAuctionThe auction module

getDerivativeModuleForId

Gets the derivative module for a given lot ID

Will revert if the lot does not have a derivative module

function getDerivativeModuleForId(uint96 lotId_) external view returns (IDerivative module);

Parameters

NameTypeDescription
lotId_uint96ID of the auction lot

Returns

NameTypeDescription
moduleIDerivativeThe derivative module

Events

AuctionCreated

Emitted when a new auction lot is created

event AuctionCreated(uint96 indexed lotId, Veecode indexed auctionRef, string infoHash);

Parameters

NameTypeDescription
lotIduint96ID of the auction lot
auctionRefVeecodeAuction module, represented by its Veecode
infoHashstringIPFS hash of the auction information

AuctionCancelled

Emitted when an auction lot is cancelled

event AuctionCancelled(uint96 indexed lotId, Veecode indexed auctionRef);

Parameters

NameTypeDescription
lotIduint96ID of the auction lot
auctionRefVeecodeAuction module, represented by its Veecode

Curated

Emitted when a curator accepts curation of an auction lot

event Curated(uint96 indexed lotId, address indexed curator);

Parameters

NameTypeDescription
lotIduint96ID of the auction lot
curatoraddressAddress of the curator

Errors

InvalidParams

error InvalidParams();

InvalidLotId

error InvalidLotId(uint96 id_);

InvalidState

error InvalidState();

InvalidCallback

error InvalidCallback();

NotPermitted

Used when the caller is not permitted to perform that action

error NotPermitted(address caller_);

Structs

RoutingParams

Auction routing information provided as input parameters

struct RoutingParams {
Keycode auctionType;
address baseToken;
address quoteToken;
address curator;
uint48 referrerFee;
ICallback callbacks;
bytes callbackData;
Keycode derivativeType;
bytes derivativeParams;
bool wrapDerivative;
}

Properties

NameTypeDescription
auctionTypeKeycodeAuction type, represented by the Keycode for the auction submodule
baseTokenaddressToken provided by seller. Declared as an address to avoid dependency hell.
quoteTokenaddressToken to accept as payment. Declared as an address to avoid dependency hell.
curatoraddress(optional) Address of the proposed curator
referrerFeeuint48(optional) Percent of bid/purchase amount received paid to a referrer in basis points, i.e. 1% = 100.
callbacksICallback(optional) Callbacks implementation for extended functionality
callbackDatabytes(optional) abi-encoded data to be sent to the onCreate callback function
derivativeTypeKeycode(optional) Derivative type, represented by the Keycode for the derivative submodule
derivativeParamsbytes(optional) abi-encoded data to be used to create payout derivatives on a purchase. The format of this is dependent on the derivative module.
wrapDerivativebool(optional) Whether to wrap the derivative in a ERC20 token instead of the native ERC6909 format

Routing

Auction routing information for a lot

struct Routing {
address seller;
address baseToken;
address quoteToken;
Veecode auctionReference;
uint256 funding;
ICallback callbacks;
Veecode derivativeReference;
bool wrapDerivative;
bytes derivativeParams;
}

Properties

NameTypeDescription
selleraddressLot seller
baseTokenaddressERC20 token provided by seller
quoteTokenaddressERC20 token to accept as payment
auctionReferenceVeecodeAuction module, represented by its Veecode
fundinguint256The amount of base tokens in funding remaining
callbacksICallback(optional) Callbacks implementation for extended functionality
derivativeReferenceVeecode(optional) Derivative module, represented by its Veecode
wrapDerivativebool(optional) Whether to wrap the derivative in a ERC20 token instead of the native ERC6909 format
derivativeParamsbytes(optional) abi-encoded data to be used to create payout derivatives on a purchase

FeeData

Fee information for a lot

This is split into a separate struct, otherwise the Routing struct would be too large and would throw a "stack too deep" error.

Fee information is set at the time of auction creation, in order to prevent subsequent inflation.

The fees are cached in order to prevent:

  • Reducing the amount of base tokens available for payout to the winning bidders
  • Reducing the amount of quote tokens available for payment to the seller
struct FeeData {
address curator;
bool curated;
uint48 curatorFee;
uint48 protocolFee;
uint48 referrerFee;
}

Properties

NameTypeDescription
curatoraddressAddress of the proposed curator
curatedboolWhether the curator has approved the auction
curatorFeeuint48The fee charged by the curator
protocolFeeuint48The fee charged by the protocol
referrerFeeuint48The fee charged by the referrer