An incorrect value is assigned to Deploy::s_merkleRoot
.
s_merkleRoot
in Deploy.s.sol
is supposed to contain the Merkle root generated by makeMerkle.js
. However, makeMerkle.js
specifies the claimable amount incorrectly:
Given that the airdrop token is USDC, and the USDC token contract defines 6 decimals, the amount
above esentially sets the claimable amount to 25 * 1e12
USDC, not to the intended 25
USDC. makeMerkle.js
then encodes this incorrect amount
value in the Merkle tree, resulting in an incorrect Merkle root - which in turn is used as an input parameter when deploying the MerkleAirdrop
contract:
Due to the incorrect Merkle root used to deploy MerkleAirdrop
, users are unable to claim the intended 25 USDC. Instead, the encoded data erroneously allows claims for 25 trillion USDC each—a claim that would fail as the contract does not and likely will never hold sufficient funds.
The following test demonstrates that users cannot claim 25 USDC (the trx will revert with MerkleAirdrop::MerkleAirdrop__InvalidProof
), and neither they can claim 25 * 1e12
USDC, i.e. the airdrop amount that is encoded in the Merkle tree (the trx will revert with ERC20InsufficientBalance
):
Eventually, the contract will have to be redeployed. Supposing that the address of the USDC contract is correct in Deploy.t.sol
(which is actually not, as described in another finding), the 100 USDC
sent to MerkleAirdrop
will not be possible to recover.
Manual review, Foundry.
Perform the following corrective steps:
Correct the airdrop amount in makeMerkle.js
:
Built the Merkle tree again and replace the incorrect Merkle root in Deploy.s.sol
with the correct one:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.