Skip to content

Commit

Permalink
refactor: remove getLeft and getRight
Browse files Browse the repository at this point in the history
  • Loading branch information
QGarchery committed Mar 22, 2024
1 parent 2609c71 commit 99fbc6a
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions certora/helpers/MerkleTree.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@ contract MerkleTree {
return isEmpty(tree[id]);
}

function getLeft(bytes32 id) public view returns (bytes32) {
return tree[id].left;
}

function getRight(bytes32 id) public view returns (bytes32) {
return tree[id].right;
}

function getValue(address addr, address reward) public view returns (uint256) {
bytes32 id = keccak256(abi.encode(addr, reward));
return tree[id].value;
Expand Down Expand Up @@ -123,8 +115,8 @@ contract MerkleTree {

bytes32 otherHash = proof[--i];

bytes32 left = getLeft(id);
bytes32 right = getRight(id);
bytes32 left = tree[id].left;
bytes32 right = tree[id].right;

id = getHash(left) == otherHash ? right : left;
}
Expand Down

0 comments on commit 99fbc6a

Please sign in to comment.