Skip to content

Commit

Permalink
[G-1] Use verifyCalldata to verify Merkle tree
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaryash90 committed Apr 1, 2024
1 parent da646d2 commit 7d23411
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions contracts/prebuilts/unaudited/airdrop/Airdrop.sol
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ contract Airdrop is EIP712, Initializable, Ownable {
revert AirdropNoMerkleRoot();
}

bool valid = MerkleProofLib.verify(
bool valid = MerkleProofLib.verifyCalldata(
_proofs,
_tokenMerkleRoot,
keccak256(abi.encodePacked(_receiver, _quantity))
Expand Down Expand Up @@ -425,7 +425,11 @@ contract Airdrop is EIP712, Initializable, Ownable {
revert AirdropNoMerkleRoot();
}

bool valid = MerkleProofLib.verify(_proofs, _tokenMerkleRoot, keccak256(abi.encodePacked(_receiver, _tokenId)));
bool valid = MerkleProofLib.verifyCalldata(
_proofs,
_tokenMerkleRoot,
keccak256(abi.encodePacked(_receiver, _tokenId))
);
if (!valid) {
revert AirdropInvalidProof();
}
Expand Down Expand Up @@ -467,7 +471,7 @@ contract Airdrop is EIP712, Initializable, Ownable {
revert AirdropNoMerkleRoot();
}

bool valid = MerkleProofLib.verify(
bool valid = MerkleProofLib.verifyCalldata(
_proofs,
_tokenMerkleRoot,
keccak256(abi.encodePacked(_receiver, _tokenId, _quantity))
Expand Down

0 comments on commit 7d23411

Please sign in to comment.