@@ -169,9 +169,8 @@ library MerkleProof {
169
169
*
170
170
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
171
171
*
172
- * NOTE: The _empty set_ (i.e. the case where `proof.length == 0 && leaves.length == 0`) is considered a noop,
173
- * and therefore a valid multiproof (i.e. it returns `true`). Consider disallowing this case if you're not
174
- * validating the leaves elsewhere.
172
+ * NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
173
+ * The `leaves` must be validated independently. See {processMultiProof}.
175
174
*/
176
175
function multiProofVerify (
177
176
bytes32 [] memory proof ,
@@ -193,6 +192,10 @@ library MerkleProof {
193
192
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
194
193
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
195
194
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
195
+ *
196
+ * NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
197
+ * and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
198
+ * validating the leaves elsewhere.
196
199
*/
197
200
function processMultiProof (
198
201
bytes32 [] memory proof ,
@@ -252,9 +255,8 @@ library MerkleProof {
252
255
*
253
256
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
254
257
*
255
- * NOTE: The _empty set_ (i.e. the case where `proof.length == 0 && leaves.length == 0`) is considered a noop,
256
- * and therefore a valid multiproof (i.e. it returns `true`). Consider disallowing this case if you're not
257
- * validating the leaves elsewhere.
258
+ * NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
259
+ * The `leaves` must be validated independently. See {processMultiProof}.
258
260
*/
259
261
function multiProofVerify (
260
262
bytes32 [] memory proof ,
@@ -277,6 +279,10 @@ library MerkleProof {
277
279
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
278
280
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
279
281
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
282
+ *
283
+ * NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
284
+ * and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
285
+ * validating the leaves elsewhere.
280
286
*/
281
287
function processMultiProof (
282
288
bytes32 [] memory proof ,
@@ -337,9 +343,8 @@ library MerkleProof {
337
343
*
338
344
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
339
345
*
340
- * NOTE: The _empty set_ (i.e. the case where `proof.length == 0 && leaves.length == 0`) is considered a noop,
341
- * and therefore a valid multiproof (i.e. it returns `true`). Consider disallowing this case if you're not
342
- * validating the leaves elsewhere.
346
+ * NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
347
+ * The `leaves` must be validated independently. See {processMultiProofCalldata}.
343
348
*/
344
349
function multiProofVerifyCalldata (
345
350
bytes32 [] calldata proof ,
@@ -361,6 +366,10 @@ library MerkleProof {
361
366
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
362
367
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
363
368
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
369
+ *
370
+ * NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
371
+ * and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
372
+ * validating the leaves elsewhere.
364
373
*/
365
374
function processMultiProofCalldata (
366
375
bytes32 [] calldata proof ,
@@ -420,9 +429,8 @@ library MerkleProof {
420
429
*
421
430
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
422
431
*
423
- * NOTE: The _empty set_ (i.e. the case where `proof.length == 0 && leaves.length == 0`) is considered a noop,
424
- * and therefore a valid multiproof (i.e. it returns `true`). Consider disallowing this case if you're not
425
- * validating the leaves elsewhere.
432
+ * NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
433
+ * The `leaves` must be validated independently. See {processMultiProofCalldata}.
426
434
*/
427
435
function multiProofVerifyCalldata (
428
436
bytes32 [] calldata proof ,
@@ -445,6 +453,10 @@ library MerkleProof {
445
453
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
446
454
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
447
455
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
456
+ *
457
+ * NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
458
+ * and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
459
+ * validating the leaves elsewhere.
448
460
*/
449
461
function processMultiProofCalldata (
450
462
bytes32 [] calldata proof ,
0 commit comments