Make explicit the validity of the empty set in MerkleProof.sol (#5142)
This commit is contained in:
@ -88,6 +88,10 @@ const templateMultiProof = ({ suffix, location, visibility, hash }) => `\
|
||||
* This version handles multiproofs in ${location} with ${hash ? 'a custom' : 'the default'} hashing function.
|
||||
*
|
||||
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
|
||||
*
|
||||
* NOTE: The _empty set_ (i.e. the case where \`proof.length == 0 && leaves.length == 0\`) is considered a noop,
|
||||
* and therefore a valid multiproof (i.e. it returns \`true\`). Consider disallowing this case if you're not
|
||||
* validating the leaves elsewhere.
|
||||
*/
|
||||
function multiProofVerify${suffix}(${formatArgsMultiline(
|
||||
`bytes32[] ${location} proof`,
|
||||
|
||||
Reference in New Issue
Block a user