forked from OpenZeppelin/openzeppelin-contracts
/
MerkleProofWrapper.sol
48 lines (40 loc) · 1.37 KB
/
MerkleProofWrapper.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/cryptography/MerkleProof.sol";
contract MerkleProofWrapper {
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) public pure returns (bool) {
return MerkleProof.verify(proof, root, leaf);
}
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf
) public pure returns (bool) {
return MerkleProof.verifyCalldata(proof, root, leaf);
}
function processProof(bytes32[] memory proof, bytes32 leaf) public pure returns (bytes32) {
return MerkleProof.processProof(proof, leaf);
}
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) public pure returns (bytes32) {
return MerkleProof.processProofCalldata(proof, leaf);
}
function multiProofVerify(
bytes32 root,
bytes32[] calldata leafs,
bytes32[] calldata proofs,
bool[] calldata proofFlag
) public pure returns (bool) {
return MerkleProof.multiProofVerify(root, leafs, proofs, proofFlag);
}
function processMultiProof(
bytes32[] calldata leafs,
bytes32[] calldata proofs,
bool[] calldata proofFlag
) public pure returns (bytes32) {
return MerkleProof.processMultiProof(leafs, proofs, proofFlag);
}
}