Skip to main content

ISablierMerkleBase

Git Source

Inherits: IAdminable

Common interface between Merkle Lockups and Merkle Instant.

Functions

EXPIRATION

The cut-off point for the campaign, as a Unix timestamp. A value of zero means there is no expiration.

This is an immutable state variable.

function EXPIRATION() external returns (uint40);

FACTORY

Retrieves the address of the factory contract.

function FACTORY() external view returns (address);

FEE

Retrieves the minimum fee required to claim the airdrop, which is paid in the native token of the chain, e.g. ETH for Ethereum Mainnet.

function FEE() external view returns (uint256);

MERKLE_ROOT

The root of the Merkle tree used to validate the proofs of inclusion.

This is an immutable state variable.

function MERKLE_ROOT() external returns (bytes32);

TOKEN

The ERC-20 token to distribute.

This is an immutable state variable.

function TOKEN() external returns (IERC20);

campaignName

Retrieves the name of the campaign.

function campaignName() external view returns (string memory);

getFirstClaimTime

Returns the timestamp when the first claim is made.

function getFirstClaimTime() external view returns (uint40);

hasClaimed

Returns a flag indicating whether a claim has been made for a given index.

Uses a bitmap to save gas.

function hasClaimed(uint256 index) external returns (bool);

Parameters

NameTypeDescription
indexuint256The index of the recipient to check.

hasExpired

Returns a flag indicating whether the campaign has expired.

function hasExpired() external view returns (bool);

ipfsCID

The content identifier for indexing the campaign on IPFS.

function ipfsCID() external view returns (string memory);

shape

Retrieves the shape of the lockup stream that the campaign produces upon claiming.

function shape() external view returns (string memory);

claim

Makes the claim.

Depending on the Merkle campaign, it either transfers tokens to the recipient or creates a Lockup stream with an NFT minted to the recipient. Requirements:

  • The campaign must not have expired.
  • The stream must not have been claimed already.
  • The Merkle proof must be valid.
  • The msg.value must not be less than FEE.
function claim(uint256 index, address recipient, uint128 amount, bytes32[] calldata merkleProof) external payable;

Parameters

NameTypeDescription
indexuint256The index of the recipient in the Merkle tree.
recipientaddressThe address of the airdrop recipient.
amountuint128The amount of ERC-20 tokens to be transferred to the recipient.
merkleProofbytes32[]The proof of inclusion in the Merkle tree.

clawback

Claws back the unclaimed tokens from the campaign.

Emits a Clawback event. Requirements:

  • msg.sender must be the admin.
  • No claim must be made, OR The current timestamp must not exceed 7 days after the first claim, OR The campaign must be expired.
function clawback(address to, uint128 amount) external;

Parameters

NameTypeDescription
toaddressThe address to receive the tokens.
amountuint128The amount of tokens to claw back.

collectFees

Collects the accrued fees by transferring them to FACTORY admin. Requirements:

  • msg.sender must be the FACTORY contract.
function collectFees(address factoryAdmin) external returns (uint256 feeAmount);

Parameters

NameTypeDescription
factoryAdminaddressThe address of the FACTORY admin.

Returns

NameTypeDescription
feeAmountuint256The amount of native tokens (e.g., ETH) collected as fees.

Events

Clawback

Emitted when the admin claws back the unclaimed tokens.

event Clawback(address indexed admin, address indexed to, uint128 amount);