AirdropRecipient
Contracts/src/contracts/utils/AirdropRecipient.sol
Lets the protocol owner subscribe to upstream airdrops via arbitrary
external calls (requestAirdrop), then merkle-distribute the proceeds to
CollectionToken holders (distributeAirdrop → claimAirdrop).
See Airdrops journey for the lifecycle and the ERC-1271 signing note.
State views
| Function | Returns |
|---|---|
merkleClaims(_merkle, _claimType) | True if (_merkle, _claimType) has been published |
isClaimed(_merkle, _node) | True if a specific leaf has already been claimed |
erc1272Signer() | The address used to satisfy ERC-1271 signature checks against AirdropRecipient (e.g. when subscribing to an upstream airdrop that signs over its claimer) |
Structs
struct MerkleClaim {
address recipient;
address target; // payout target (token / NFT contract)
uint tokenId; // NFT id, or 0 for fungible
uint amount;
}
enum ClaimType { ERC20, ERC721, ERC1155, NATIVE }Public surface
| Function | Caller | Description |
|---|---|---|
requestAirdrop(_contract, _value, _payload) | Owner | _contract.call{value:_value}(_payload) |
distributeAirdrop(_merkle, _claimType) | Owner | Publish a merkle root for a claim type |
claimAirdrop(_merkle, _claimType, _node, _merkleProof) | Recipient | Claim a leaf |
setERC1271Signer(_signer) | Owner | Update the ERC-1271 signing key |
Errors
| Error | Cause |
|---|---|
ExternalCallFailed | The downstream call in requestAirdrop reverted |
MerkleAlreadyExists | (_merkle, _claimType) already published |
MerkleRootNotValid | _merkle == bytes32(0) |
AirdropAlreadyClaimed | Leaf already claimed |
InvalidClaimNode | Leaf doesn’t match (_recipient, _target, _tokenId, _amount) |
TransferFailed | Downstream payout transfer reverted |
Events
| Event | Trigger |
|---|---|
AirdropDistributed(_merkle, _claimType) | distributeAirdrop |
AirdropClaimed(_merkle, _claimType, _recipient, _target, _tokenId, _amount) | claimAirdrop |
AirdropTargetSet(_target, _allowed) | setAirdropTarget |
Subgraph mapping
| Event | Entity |
|---|---|
AirdropDistributed | AirdropDistribution |
AirdropClaimed | AirdropClaim |
AirdropTargetSet | AirdropTarget |
Inherited surface
Ownable.- ERC-1271 signature receiver for upstream airdrop subscriptions.