Skip to main content

ISablierMerkleInstant

Git Source

Inherits: ISablierMerkleSignature

Title: ISablierMerkleInstant

MerkleInstant enables an airdrop model where eligible users receive the tokens as soon as they claim.

Functions

claim

Claim airdrop on behalf of eligible recipient and transfer it to the recipient address.

It emits a ClaimInstant event. Requirements:

  • CLAIM_TYPE must be DEFAULT.
  • The current time must be greater than or equal to the campaign start time.
  • The campaign must not have expired.
  • msg.value must not be less than the value returned by {COMPTROLLER.calculateMinFeeWei}.
  • The index must not be claimed already.
  • The Merkle proof must be valid.
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 allocated to the recipient.
merkleProofbytes32[]The proof of inclusion in the Merkle tree.

claimTo

Claim airdrop and transfer the tokens to the to address.

It emits a ClaimInstant event. Requirements:

function claimTo(uint256 index, address to, uint128 amount, bytes32[] calldata merkleProof) external payable;

Parameters

NameTypeDescription
indexuint256The index of the msg.sender in the Merkle tree.
toaddressThe address receiving the ERC-20 tokens on behalf of msg.sender.
amountuint128The amount of ERC-20 tokens allocated to the msg.sender.
merkleProofbytes32[]The proof of inclusion in the Merkle tree.

claimViaAttestation

Claim airdrop using an external attestation from a trusted attestor (e.g., KYC verifier).

It emits a ClaimInstant event. Notes:

function claimViaAttestation(
uint256 index,
address to,
uint128 amount,
uint40 expireAt,
bytes32[] calldata merkleProof,
bytes calldata attestation
)
external
payable;

Parameters

NameTypeDescription
indexuint256The index of the msg.sender in the Merkle tree.
toaddressThe address receiving the ERC-20 tokens on behalf of msg.sender.
amountuint128The amount of ERC-20 tokens allocated to the msg.sender.
expireAtuint40The timestamp after which the attestation signature is no longer valid.
merkleProofbytes32[]The proof of inclusion in the Merkle tree.
attestationbytesThe EIP-712 signature from the attestor.

claimViaSig

Claim airdrop on behalf of eligible recipient using an EIP-712 or EIP-1271 signature, and transfer the tokens to the to address.

It emits a ClaimInstant event. Requirements:

types: {
EIP712Domain: [
{ name: "name", type: "string" },
{ name: "chainId", type: "uint256" },
{ name: "verifyingContract", type: "address" },
],
Claim: [
{ name: "index", type: "uint256" },
{ name: "recipient", type: "address" },
{ name: "to", type: "address" },
{ name: "amount", type: "uint128" },
{ name: "validFrom", type: "uint40" },
],
},
domain: {
name: "Sablier Airdrops Protocol",
chainId: 1, // Chain on which the contract is deployed
verifyingContract: "0xTheAddressOfThisContract", // The address of this contract
},
primaryType: "Claim",
message: {
index: 2, // The index of the signer in the Merkle tree
recipient: "0xTheAddressOfTheRecipient", // The address of the airdrop recipient
to: "0xTheAddressReceivingTheTokens", // The address where recipient wants to transfer the tokens
amount: "1000000000000000000000", // The amount of tokens allocated to the recipient
validFrom: 1752425637 // The timestamp from which the claim signature is valid
},
function claimViaSig(
uint256 index,
address recipient,
address to,
uint128 amount,
uint40 validFrom,
bytes32[] calldata merkleProof,
bytes calldata signature
)
external
payable;

Parameters

NameTypeDescription
indexuint256The index of the recipient in the Merkle tree.
recipientaddressThe address of the airdrop recipient who is providing the signature.
toaddressThe address receiving the ERC-20 tokens on behalf of the recipient.
amountuint128The amount of ERC-20 tokens allocated to the recipient.
validFromuint40The timestamp from which the claim signature is valid.
merkleProofbytes32[]The proof of inclusion in the Merkle tree.
signaturebytesThe EIP-712 or EIP-1271 signature from the airdrop recipient.

Events

ClaimInstant

Emitted when an airdrop is claimed on behalf of an eligible recipient.

event ClaimInstant(uint256 index, address indexed recipient, uint128 amount, address to, bool viaSig);