Skip to content

Commit

Permalink
fix parens on prefix mask
Browse files Browse the repository at this point in the history
  • Loading branch information
adraffy committed Dec 6, 2024
1 parent 3e95abf commit 9116aa4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions contracts/scroll/ScrollVerifierHooks.sol
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,8 @@ contract ScrollVerifierHooks is IVerifierHooks {
// If the trie does not contain a value for key, the returned proof contains all
// nodes of the longest existing prefix of the key (at least the root node), ending
// with the node that proves the absence of the key.
if (i > 0) {
bytes32 p = bytes32(1 << (i - 1)); // prefix mask
if ((temp & p) != (keyHash & p)) revert InvalidProof();
}
bytes32 p = bytes32((1 << i) - 1); // prefix mask
if ((temp & p) != (keyHash & p)) revert InvalidProof();
// this is a proof for a different value that traverses to the same place
keyHash = temp;
}
Expand Down

0 comments on commit 9116aa4

Please sign in to comment.