Description:
The s_merkleRoot
value set in the Deploy.s.sol
contract is incorrect due to a logical error in the makeMerkle.js
script. The script incorrectly calculates the Merkle root with an amount
value of 25 * 1e18
instead of 25 * 1e6
(considering USDC has 6 decimals). This discrepancy results in a wrong Merkle root value (0xf69aaa25bd4dd10deb2ccd8235266f7cc815f6e9d539e9f4d47cae16e0c36a05
) being set in the Deploy.s.sol
contract. However the correct value is still used in MerkleAirdropTest.t.sol
which allows all tests to pass.
Impact:
This incorrect Merkle root value can lead to failed claims in the MerkleAirdrop
contract, as the verification process relies on the correct Merkle root. Users attempting to claim tokens based on the incorrect Merkle root will be unable to do so, potentially leading to confusion and frustration among users.
Proof of Code:
Make the following changes to MerkleAirdrop.t.sol
-
Add the following test and run forge test --zksync --mt testRevertsWithInvalidProof
Recommended Mitigation:
To correct this issue, the makeMerkle.js
script should be updated to use the correct amount
value (25 * 1e6
) when calculating the Merkle root. This will ensure that the generated Merkle root matches the expected value (0x3b2e22da63ae414086bec9c9da6b685f790c6fab200c7918f2879f08793d77bd
) to be used during deployment in the Deploy.s.sol
contract.
Tools Used: Manual review and Foundry for POC
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.