A fully Yul assembly implementation of a token airdrop contract. It leverages Merkle Tree proofs to verify eligible claimer addresses and EIP-712 signatures to authorize claims, providing a gas-efficient and low-level approach to secure token distribution.
- Verify user eligibility for token claim via Merkle Tree proofs
- Enforce EIP-712 signed messages for secure claim authorization
- Immutable storage of Merkle root and airdrop token address in bytecode
- Minimal, gas-optimized logic written entirely in Yul assembly
-
src/MerkleAirdrop.yul The core airdrop contract written in Yul. Implements functions to:
claim(...): Validate proofs & signatures, mark claims, and transfer tokensgetMerkleRoot(),getAirdropToken(),getMessageHash(),hasClaimed(): Read-only helpers- EIP-712 domain & message hashing
- Merkle proof verification and safe ERC-20 transfer
-
test/helper/YulDeployer.t.sol A Foundry helper contract for deploying fully Yul-based contracts within tests. Modified from CodeForcer/foundry-yul.
-
test/MerkleAirdrop.t.sol Minimal unit tests for
MerkleAirdrop.yulcovering basic view methods and claim flow.
curl -L https://foundry.paradigm.xyz | bash
foundryupbrew update
brew tap ethereum/ethereum
brew install solidity
solc --versionsudo add-apt-repository ppa:ethereum/ethereum
sudo apt update
sudo apt install solc
solc --versionUse Foundry to run the test suite:
forge testThis project is for educational purposes only and should not be used in production. The code has not been security audited.
MIT License. See the LICENSE file for details.