Skip to main content

AllocatedMerkleAllowlist

Git Source

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

NameTypeDescription
lotId_uint96
buyer_address
amount_uint256
<none>uint256
<none>bool
callbackData_bytesabi-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

NameTypeDescription
lotId_uint96
<none>uint64
buyer_address
amount_uint256
callbackData_bytesabi-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();