AtomicAuctionModule
Inherits: IAtomicAuction, AuctionModule
A base contract for atomic auctions
Functions
auctionType
Get the auction type
function auctionType() external pure override returns (AuctionType);
purchase
Purchase tokens from an auction lot
Implements a basic purchase function that:
- Validates the lot and purchase parameters
- Calls the implementation-specific function
- Updates the lot data
This function reverts if:
- The lot id is invalid
- The lot is inactive
- The caller is not an internal module
- The payout is greater than the remaining capacity
Inheriting contracts should override _purchase to implement auction-specific logic, such as:
- Validating the auction-specific parameters
- Storing the purchase data
function purchase(
uint96 lotId_,
uint256 amount_,
bytes calldata auctionData_
) external virtual override onlyInternal returns (uint256 payout, bytes memory auctionOutput);
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | The lot id |
amount_ | uint256 | The amount of quote tokens to purchase |
auctionData_ | bytes | The auction-specific data |
Returns
Name | Type | Description |
---|---|---|
payout | uint256 | The amount of payout tokens to receive |
auctionOutput | bytes | The auction-specific output |
_purchase
Implementation-specific purchase logic
Auction modules should override this to perform any additional logic
function _purchase(
uint96 lotId_,
uint256 amount_,
bytes calldata auctionData_
) internal virtual returns (uint256 payout, bytes memory auctionOutput);
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | The lot ID |
amount_ | uint256 | The amount of quote tokens to purchase |
auctionData_ | bytes | The auction-specific data |
Returns
Name | Type | Description |
---|---|---|
payout | uint256 | The amount of payout tokens to receive |
auctionOutput | bytes | The auction-specific output |