BALwithAllowlist
Inherits: BaselineAxisLaunch
Allowlist version of the Baseline Axis Launch callback.
This version allows for a merkle tree to be used to determine which addresses are allowed to participate. However, the amount of quote tokens they can spend is not limited.
State Variables
merkleRoot
The root of the merkle tree that represents the allowlist
The merkle tree should adhere to the format specified in the OpenZeppelin MerkleProof library at https://github.com/OpenZeppelin/merkle-tree
In particular, leaf values (such as (address)
or (address,uint256)
) should be double-hashed.
bytes32 public merkleRoot;
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: (bytes32) representing the merkle root |
_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: (bytes32[]) representing the merkle proof |
__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_, bytes calldata callbackData_) internal view;
setMerkleRoot
Sets the merkle root for the allowlist
This function can be called by the owner to update the merkle root after onCreate()
.
This function performs the following:
- Performs validation
- Sets the merkle root
- Emits a MerkleRootSet event
This function reverts if:
- The caller is not the owner
- The auction has not been registered
- The auction has been completed
function setMerkleRoot(bytes32 merkleRoot_) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
merkleRoot_ | bytes32 | The new merkle root |
Events
MerkleRootSet
Emitted when the merkle root is set
event MerkleRootSet(bytes32 merkleRoot);
Errors
Callback_InvalidState
Error message when the callback state does not support the action
error Callback_InvalidState();