Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
missing suffix
  • Loading branch information
Amxx committed Aug 2, 2024
commit db692467ee08c0a6a265ab72ba76721d1ab74cc4
8 changes: 4 additions & 4 deletions contracts/utils/cryptography/MerkleProof.sol
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ library MerkleProof {
* This version handles proofs in calldata with the default hashing function.
*/
function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProof(proof, leaf) == root;
return processProofCalldata(proof, leaf) == root;
}

/**
Expand Down Expand Up @@ -138,7 +138,7 @@ library MerkleProof {
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processProof(proof, leaf, hasher) == root;
return processProofCalldata(proof, leaf, hasher) == root;
}

/**
Expand Down Expand Up @@ -335,7 +335,7 @@ library MerkleProof {
bytes32 root,
bytes32[] calldata leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}

/**
Expand Down Expand Up @@ -415,7 +415,7 @@ library MerkleProof {
bytes32[] calldata leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processMultiProof(proof, proofFlags, leaves, hasher) == root;
return processMultiProofCalldata(proof, proofFlags, leaves, hasher) == root;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions scripts/generate/templates/MerkleProof.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function verify${suffix}(${(hash ? formatArgsMultiline : formatArgsSingleLine)(
'bytes32 leaf',
hash && `function(bytes32, bytes32) view returns (bytes32) ${hash}`,
)}) internal ${visibility} returns (bool) {
return processProof(proof, leaf${hash ? `, ${hash}` : ''}) == root;
return processProof${suffix}(proof, leaf${hash ? `, ${hash}` : ''}) == root;
}

/**
Expand Down Expand Up @@ -96,7 +96,7 @@ function multiProofVerify${suffix}(${formatArgsMultiline(
`bytes32[] ${location} leaves`,
hash && `function(bytes32, bytes32) view returns (bytes32) ${hash}`,
)}) internal ${visibility} returns (bool) {
return processMultiProof(proof, proofFlags, leaves${hash ? `, ${hash}` : ''}) == root;
return processMultiProof${suffix}(proof, proofFlags, leaves${hash ? `, ${hash}` : ''}) == root;
}

/**
Expand Down