Skip to main content

BALwithTokenAllowlist

Git Source

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

NameTypeDescription
<none>uint96
<none>address
<none>address
<none>address
<none>uint256
<none>bool
allowlistData_bytesabi-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

NameTypeDescription
lotId_uint96
bidId_uint64
buyer_address
amount_uint256
callbackData_bytesabi-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

NameTypeDescription
lotId_uint96The ID of the lot
bidId_uint64The ID of the bid
buyer_addressThe address of the buyer
amount_uint256The amount of quote tokens
callbackData_bytesThe callback data

_canParticipate

function _canParticipate(address buyer_) internal view;

Structs

TokenCheck

struct TokenCheck {
ITokenBalance token;
uint256 threshold;
}