AirDropper

AI First Flight #5
Beginner FriendlyDeFiFoundry
EXP
View results
Submission Details
Severity: high
Valid

Deploy.s.sol uses two different address literals for the USDC token, one of which has an incorrect EIP-55 checksum

Root + Impact

Normal behavior

Deploy.s.sol is responsible for deploying MerkleAirdrop and funding it with USDC. It should reference a single, authoritative USDC contract address throughout.

Description

The issue

The script declares s_zkSyncUSDC on line 8 and uses it to configure the deployed MerkleAirdrop contract. However, the transfer() call on line 17 hardcodes a completely separate address literal. These two literals have different hex digits — they are not the same address — and at least one fails the EIP-55 checksum standard that the Solidity compiler enforces for address literals.

// @> Address A — used to configure the airdrop contract
address public s_zkSyncUSDC = 0x1D17CbCf0D6d143135be902365d2e5E2a16538d4;
function run() public {
vm.startBroadcast();
MerkleAirdrop airdrop = deployMerkleDropper(s_merkleRoot, IERC20(s_zkSyncUSDC));
// @> Address B — different literal, different checksum, used for the funding transfer
IERC20(0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4).transfer(address(airdrop), s_amountToAirdrop);
vm.stopBroadcast();
}

Byte-by-byte comparison (lowercase):

  • Address A: 1d17cbcf0d6d143135be902365d2e5e2a16538d4

  • Address B: 1d17cbcf0d6d143135ae902365d2e5e2a16538d4

The character at position 18 differs: b (Address A) vs a (Address B). These resolve to different 20-byte values. If Address B is the wrong on-chain address, the funding transfer sends tokens to the wrong contract and the airdrop receives nothing.

Risk

Likelihood:

  • The deploy script is run exactly once at launch — if this bug is present at that moment, there is no automated safety net to catch it

  • The Solidity compiler emits a checksum warning for non-EIP-55 literals, which is easy to overlook in CI pipelines that do not treat warnings as errors

Impact:

  • If Address B does not match the live zkSync USDC contract, transfer() sends 100 USDC to an unintended address — the airdrop contract receives zero tokens and every claim() call reverts

  • The protocol team must re-deploy and manually recover misrouted funds, incurring gas costs and delaying the airdrop

  • If Address A (used to configure the contract) is wrong, the airdrop contract is initialized with a non-USDC token, making all claims permanently incorrect

Proof of Concept

The mismatch can be confirmed by comparing the two literals directly:

// Paste into any Solidity test or script to demonstrate the mismatch
function test_AddressMismatch() public pure {
address addrA = 0x1D17CbCf0D6d143135be902365d2e5E2a16538d4; // s_zkSyncUSDC
address addrB = 0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4; // transfer() arg
// These are NOT equal — different hex digit at position 18
assert(addrA != addrB);
}

Running forge build against Deploy.s.sol as-is will also produce a compiler warning for the non-EIP-55 compliant literal.

Recommended Mitigation

Declare the address once and reference the variable everywhere.

address public s_zkSyncUSDC = 0x1D17CbCf0D6d143135be902365d2e5E2a16538d4;
function run() public {
vm.startBroadcast();
MerkleAirdrop airdrop = deployMerkleDropper(s_merkleRoot, IERC20(s_zkSyncUSDC));
- IERC20(0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4).transfer(address(airdrop), s_amountToAirdrop);
+ IERC20(s_zkSyncUSDC).transfer(address(airdrop), s_amountToAirdrop);
vm.stopBroadcast();
}
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 23 hours ago
Submission Judgement Published
Validated
Assigned finding tags:

[H-01] Address of USDC token in `Deploy.s.sol` is wrong causing the claiming process to fail

## Description The `s_zkSyncUSDC` address in `Deploy.s.sol` is incorrectly set, leading to a failure in the claiming process. This error results in funds being stuck in the `MerkleAirdrop` contract due to the immutability of the token address. ## Impact All funds become permanently trapped in the `MerkleAirdrop` contract, rendering them inaccessible for claiming or transfer. **Proof of Concept:** To demonstrate the issue, a test contract can be added and executed using the following command: `forge test --zksync --rpc-url $RPC_ZKSYNC --mt testDeployOnZkSync` Use the RPC URL `https://mainnet.era.zksync.io` for testing. <details> <summary>Proof Of Code</summary> ```javascript // SPDX-License-Identifier: MIT pragma solidity 0.8.24; import { MerkleAirdrop, IERC20 } from "../src/MerkleAirdrop.sol"; import { Test, console2 } from "forge-std/Test.sol"; contract MerkleAirdropTest is Test { MerkleAirdrop public s_airdrop; uint256 s_amountToCollect = (25 * 1e6); // 25.000000 address s_collectorOne = 0x20F41376c713072937eb02Be70ee1eD0D639966C; bytes32 s_proofOne = 0x32cee63464b09930b5c3f59f955c86694a4c640a03aa57e6f743d8a3ca5c8838; bytes32 s_proofTwo = 0x8ff683185668cbe035a18fccec4080d7a0331bb1bbc532324f40501de5e8ea5c; bytes32[] s_proof = [s_proofOne, s_proofTwo]; address public deployer; // From Deploy.t.sol bytes32 public s_merkleRoot = 0x3b2e22da63ae414086bec9c9da6b685f790c6fab200c7918f2879f08793d77bd; address public s_zkSyncUSDC = 0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4; uint256 public s_amountToAirdrop = 4 * (25 * 1e6); function setUp() public { deployer = makeAddr("deployer"); deal(0x1D17CbCf0D6d143135be902365d2e5E2a16538d4, deployer, 100 * 1e6); vm.deal(s_collectorOne, 100 ether); } function testDeployOnZkSync() public { if (block.chainid != 324) { return; } vm.startPrank(deployer); // From here there is the code from run() s_airdrop = deployMerkleDropper(s_merkleRoot, IERC20(s_zkSyncUSDC)); // Send USDC -> Merkle Air Dropper IERC20(0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4).transfer(address(s_airdrop), s_amountToAirdrop); // end code from run vm.stopPrank(); vm.startPrank(s_collectorOne); s_airdrop.claim{ value: s_airdrop.getFee() }(s_collectorOne, s_amountToCollect, s_proof); vm.stopPrank(); } function deployMerkleDropper(bytes32 merkleRoot, IERC20 zkSyncUSDC) public returns (MerkleAirdrop) { return (new MerkleAirdrop(merkleRoot, zkSyncUSDC)); } } ``` </details> ## Recommendations To resolve the issue, update the s_zkSyncUSDC address in Deploy.s.sol to the correct value: ```diff - address public s_zkSyncUSDC = 0x1D17CbCf0D6d143135be902365d2e5E2a16538d4; + address public s_zkSyncUSDC = 0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4; ```

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!