Support memory arrays in MerkleTree multiproof (#3493)

This commit is contained in:
Hadrien Croubois
2022-06-27 13:15:52 +02:00
committed by GitHub
parent 74738721dc
commit 2894059775
3 changed files with 110 additions and 9 deletions

View File

@ -30,19 +30,36 @@ contract MerkleProofWrapper {
}
function multiProofVerify(
bytes32[] calldata proofs,
bool[] calldata proofFlag,
bytes32[] memory proofs,
bool[] memory proofFlag,
bytes32 root,
bytes32[] calldata leaves
bytes32[] memory leaves
) public pure returns (bool) {
return MerkleProof.multiProofVerify(proofs, proofFlag, root, leaves);
}
function processMultiProof(
function multiProofVerifyCalldata(
bytes32[] calldata proofs,
bool[] calldata proofFlag,
bytes32[] calldata leaves
bytes32 root,
bytes32[] memory leaves
) public pure returns (bool) {
return MerkleProof.multiProofVerifyCalldata(proofs, proofFlag, root, leaves);
}
function processMultiProof(
bytes32[] memory proofs,
bool[] memory proofFlag,
bytes32[] memory leaves
) public pure returns (bytes32) {
return MerkleProof.processMultiProof(proofs, proofFlag, leaves);
}
function processMultiProofCalldata(
bytes32[] calldata proofs,
bool[] calldata proofFlag,
bytes32[] memory leaves
) public pure returns (bytes32) {
return MerkleProof.processMultiProofCalldata(proofs, proofFlag, leaves);
}
}