AllocatedMerkleAllowlist
Inherits: MerkleAllowlist
This contract extends the MerkleAllowlist contract to implement a merkle tree-based allowlist for buyers to participate in an auction. In this implementation, each buyer has an individual purchase limit that is set.
State Variables
lotBuyerSpent
Tracks the cumulative amount spent by a buyer on a lot
mapping(uint96 lotId => mapping(address buyer => uint256 spent)) public lotBuyerSpent;
Functions
constructor
constructor(
address auctionHouse_,
Callbacks.Permissions memory permissions_
) MerkleAllowlist(auctionHouse_, permissions_);
_onPurchase
This function performs the following:
- Calls the
_onBuy()
function to validate the buyer's purchase
function _onPurchase(
uint96 lotId_,
address buyer_,
uint256 amount_,
uint256,
bool,
bytes calldata callbackData_
) internal override;
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | |
buyer_ | address | |
amount_ | uint256 | |
<none> | uint256 | |
<none> | bool | |
callbackData_ | bytes | abi-encoded data: (bytes32[], uint256) representing the merkle proof and allocated amount |
_onBid
This function performs the following:
- Calls the
_onBuy()
function to validate the buyer's bid
function _onBid(
uint96 lotId_,
uint64,
address buyer_,
uint256 amount_,
bytes calldata callbackData_
) internal override;
Parameters
Name | Type | Description |
---|---|---|
lotId_ | uint96 | |
<none> | uint64 | |
buyer_ | address | |
amount_ | uint256 | |
callbackData_ | bytes | abi-encoded data: (bytes32[], uint256) representing the proof and allocated amount |
_onBuy
function _onBuy(
uint96 lotId_,
address buyer_,
uint256 amount_,
bytes calldata callbackData_
) internal;
Errors
Callback_ExceedsLimit
Error message when the bid amount exceeds the limit assigned to a buyer
error Callback_ExceedsLimit();