File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
contracts/utils/cryptography Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' openzeppelin-solidity ' : patch
3
+ ---
4
+
5
+ ` MerkleProof ` : Use custom error to report invalid multiproof instead of reverting with overflow panic.
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ library MerkleProof {
118
118
uint256 totalHashes = proofFlags.length ;
119
119
120
120
// Check proof validity.
121
- if (leavesLen + proofLen - 1 != totalHashes) {
121
+ if (leavesLen + proofLen != totalHashes + 1 ) {
122
122
revert MerkleProofInvalidMultiproof ();
123
123
}
124
124
@@ -174,7 +174,7 @@ library MerkleProof {
174
174
uint256 totalHashes = proofFlags.length ;
175
175
176
176
// Check proof validity.
177
- if (leavesLen + proofLen - 1 != totalHashes) {
177
+ if (leavesLen + proofLen != totalHashes + 1 ) {
178
178
revert MerkleProofInvalidMultiproof ();
179
179
}
180
180
You can’t perform that action at this time.
0 commit comments