Allowlist

Git Source

Author: fx(hash)

Extension for claiming tokens through merkle trees

Functions

_claimSlot

Claims a merkle tree slot

function _claimSlot(
    address _token,
    uint256 _reserveId,
    uint256 _index,
    address _claimer,
    bytes32[] memory _proof,
    LibBitmap.Bitmap storage _bitmap
) internal;

Parameters

NameTypeDescription
_tokenaddressAddress of the token contract
_reserveIduint256ID of the reserve
_indexuint256Index in the merkle tree
_claimeraddressAddress of allowlist slot claimer
_proofbytes32[]Merkle proof used for validating claim
_bitmapLibBitmap.BitmapBitmap used for checking if index is already claimed

_getMerkleRoot

Gets the merkle root of a token reserve

function _getMerkleRoot(address _token, uint256 _reserveId) internal view virtual returns (bytes32);

Parameters

NameTypeDescription
_tokenaddressAddress of the token contract
_reserveIduint256ID of the reserve

Events

SlotClaimed

Event emitted when allowlist slot is claimed

event SlotClaimed(address indexed _token, uint256 indexed _reserveId, address indexed _claimer, uint256 _index);

Parameters

NameTypeDescription
_tokenaddressAddress of the token
_reserveIduint256ID of the reserve
_claimeraddressAddress of the claimer
_indexuint256Index of purchase info inside the BitMap

Errors

InvalidProof

Error thrown when the merkle proof for an index is invalid

error InvalidProof();

SlotAlreadyClaimed

Error thrown when an index in the merkle tree has already been claimed

error SlotAlreadyClaimed();