BALwithTokenAllowlist
Inherits: BaselineAxisLaunch
TokenAllowlist version of the Baseline Axis Launch callback.
Allowlist contract that checks if a user's balance of a token is above a threshold
This shouldn't be used with liquid, transferable ERC-20s because it can easily be bypassed via flash loans or other swap mechanisms
The intent is to use this with non-transferable tokens (e.g. vote escrow) or illiquid tokens that are not as easily manipulated, e.g. community NFTs
State Variables
tokenCheck
Stores the token and balance threshold for the lot
TokenCheck public tokenCheck;
Functions
constructor
constructor(
address auctionHouse_,
address baselineKernel_,
address reserve_,
address owner_
) BaselineAxisLaunch(auctionHouse_, baselineKernel_, reserve_, owner_);
__onCreate
Override this function to implement allowlist functionality
This function reverts if:
allowlistData_
is not of the correct length
function __onCreate(
uint96,
address,
address,
address,
uint256,
bool,
bytes memory allowlistData_
) internal virtual override;
Parameters
Name | Type | Description |
---|---|---|
<none> | uint96 | |
<none> | address | |
<none> | address | |
<none> | address | |
<none> | uint256 | |
<none> | bool | |
allowlistData_ | bytes | abi-encoded data: (ITokenBalance, uint96) representing the token contract and minimum balance |
_onBid
No logic is needed for this function here, but it can be overridden by a lower-level contract to provide allowlist functionality
function _onBid(
uint96 lotId_,
uint64 bidId_,
address buyer_,
uint256 amount_,
bytes calldata callbackData_
) internal virtual override;
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | |
bidId_ | uint64 | |
buyer_ | address | |
amount_ | uint256 | |
callbackData_ | bytes | abi-encoded data |
__onBid
Override this function to implement additional functionality for the onBid
callback
function __onBid(
uint96 lotId_,
uint64 bidId_,
address buyer_,
uint256 amount_,
bytes calldata callbackData_
) internal virtual;
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | The ID of the lot |
bidId_ | uint64 | The ID of the bid |
buyer_ | address | The address of the buyer |
amount_ | uint256 | The amount of quote tokens |
callbackData_ | bytes | The callback data |
_canParticipate
function _canParticipate(address buyer_) internal view;
Structs
TokenCheck
struct TokenCheck {
ITokenBalance token;
uint256 threshold;
}