Skip to content

Commit

Permalink
Merge pull request #10 from icon-project/eunki-fix-bmv-nsr
Browse files Browse the repository at this point in the history
Fix derivation method for network section root
  • Loading branch information
kwon528 authored Jun 26, 2023
2 parents 508ed3a + 798c902 commit 3ddaab8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bmv/contracts/libraries/MerkleTreeLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ library MerkleTreeLib {
function calculate(bytes32 leaf, Path[] memory pathes) internal pure returns (bytes32) {
bytes32 temp = leaf;
for (uint256 i = 0; i < pathes.length; i++) {
if (pathes[i].hash == 0 && pathes[i].direction == 1) continue;
temp = pathes[i].direction == 0
? keccak256(bytes.concat(abi.encodePacked(pathes[i].hash), abi.encodePacked(temp)))
: keccak256(bytes.concat(abi.encodePacked(temp), abi.encodePacked(pathes[i].hash)));
Expand Down

0 comments on commit 3ddaab8

Please sign in to comment.