fix(incremental-merkle-tree.sol): ensure proofPathIndices is binary when recovering updateIndex

This commit is contained in:
twister-dev
2022-10-01 10:07:52 -07:00
parent b66b24628c
commit dcdad27245

View File

@@ -102,7 +102,7 @@ library IncrementalBinaryTree {
uint256 updateIndex;
for (uint8 i = 0; i < depth; ) {
updateIndex |= uint(proofPathIndices[i]) << uint(i);
updateIndex |= uint(proofPathIndices[i] & 1) << uint(i);
if (proofPathIndices[i] == 0) {
if (proofSiblings[i] == self.lastSubtrees[i][1]) {
self.lastSubtrees[i][0] = hash;