Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

Claimed verification

Summary

Vulnerability Details

The contract dont have if adrress already claimed the airdrop.

Impact

Duplicated claims

Tools Used

Recommendations

commite related -> https://github.com/papalardo/2024-04-airdropper/commit/bf587be8fdc458304e09f2e4f5e7523a76b42112

add already claimed error

error MerkleAirdrop__AlreadyClaimed();

add map to save address that has claimed airdrop.

mapping(address => bool) public hasClaimed;

add verification and saving address that claimed

function claim(address account, uint256 amount, bytes32[] calldata merkleProof) external payable {
if (msg.value != FEE) {
revert MerkleAirdrop__InvalidFeeAmount();
}
if (hasClaimed[to]) {
revert MerkleAirdrop__AlreadyClaimed();
}
bytes32 leaf = keccak256(bytes.concat(keccak256(abi.encode(account, amount))));
if (!MerkleProof.verify(merkleProof, i_merkleRoot, leaf)) {
revert MerkleAirdrop__InvalidProof();
}
hasClaimed[to] = true;
emit Claimed(account, amount);
i_airdropToken.safeTransfer(account, amount);
}

Sorry, Im noob around bug bounty documentation.

Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

multi-claim-airdrop

Support

FAQs

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