Access Control
With the exception of the Comptroller functions, all functions in Merkle campaign can only be triggered either by the campaign creator or the airdrop recipients. The Comptroller has no control over any funds in the campaign contract.
This article will provide a comprehensive overview of the actions that can be performed on a campaign contract.
Every campaign has a creator and a recipient. An "public" caller is any address outside of creator and recipient. Anyone
can call claim function on a campaign but the tokens will be transferred to the recipient.
Overview
The table below offers a quick overview of the access control for each action that can be performed on a campaign.
| Action | Creator | Recipient | Public | Compatibility |
|---|---|---|---|---|
| Claim | ✅ | ✅ | ✅ | Airstreams, Instant |
| ClaimTo | ❌ | ✅ | ❌ | Airstreams, Instant, Variable Claim |
| ClaimViaSig | ✅ | ✅ | ✅ | Airstreams, Instant, Variable Claim |
| Clawback | ✅ | ❌ | ❌ | Airstreams, Instant, Variable Claim |
Claim
Claiming an airdrop using claim function requires four values:
- Address of the eligible user
- Amount that the user is eligible for
- Claim index in the bitmap
- Merkle proof
Anybody can claim function with the correct set of values. The claim then automatically transfers amount of tokens
to the eligible user. If the campaign requires token vesting, then the claim function will create a Sablier stream on
behalf of the eligible user.
claim function is unavailable in a Variable Claim Airdrop Campaign. You can use either claimTo or
claimViaSig to claim from it.
ClaimTo
Claiming an airdrop using claimTo function requires four values:
- Address to which the tokens should be sent on behalf of the eligible user
- Amount that the user is eligible for
- Claim index in the bitmap
- Merkle proof
Only eligible users can call claimTo function with the correct set of values. The claimTo then automatically
transfers amount of tokens to the provided address (which could be different from the user address). If the campaign
requires token vesting, then the claimTo function will create a Sablier stream on behalf of the eligible user.
ClaimViaSig
Claiming an airdrop using claimViaSig function requires seven values:
- Address to which the tokens should be sent on behalf of the eligible user
- Amount that the user is eligible for
- Claim index in the bitmap
- Merkle proof
- Address of the eligible user
- EIP-712 or EIP-1271 signature from the eligible user
- A UNIX timestamp from which above signature should be valid
Anybody can call claimViaSig function as long as the EIP-721 (or EIP-1271) signature is valid and signed by the
eligible user. The claimViaSig then automatically transfers amount of tokens to the provided address (which could be
different from the user address). If the campaign requires token vesting, then the claimViaSig function will create a
Sablier stream on behalf of the eligible user.
Clawback
Only the campaign creator can clawback funds within grace period.