Skip to content

Commit

Permalink
Updated merkle proof calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
yahgwai committed Apr 1, 2022
1 parent a084cf2 commit 266e558
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion solgen/src/bridge/Outbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,6 @@ contract Outbox is DelegateCallAware, IOutbox {
uint256 path,
bytes32 item
) public pure returns (bytes32) {
return MerkleLib.calculateRoot(proof, path, keccak256(abi.encodePacked(item)));
return MerkleLib.calculateRoot(proof, path, item);
}
}
4 changes: 2 additions & 2 deletions solgen/src/libraries/MerkleLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ library MerkleLib {
bytes32 h = item;
for (uint256 i = 0; i < proofItems; i++) {
if (route % 2 == 0) {
h = keccak256(abi.encodePacked(nodes[i], h));
} else {
h = keccak256(abi.encodePacked(h, nodes[i]));
} else {
h = keccak256(abi.encodePacked(nodes[i], h));
}
route /= 2;
}
Expand Down

0 comments on commit 266e558

Please sign in to comment.