diff --git a/l1-contracts/src/core/libraries/decoders/Decoder.sol b/l1-contracts/src/core/libraries/decoders/Decoder.sol index 178e91acda2..39efa07f04d 100644 --- a/l1-contracts/src/core/libraries/decoders/Decoder.sol +++ b/l1-contracts/src/core/libraries/decoders/Decoder.sol @@ -385,6 +385,7 @@ library Decoder { for (uint256 j = 0; j < treeSize; j += 2) { _leafs[j / 2] = sha256(bytes.concat(_leafs[j], _leafs[j + 1])); } + treeSize /= 2; } return _leafs[0]; diff --git a/l1-contracts/src/core/libraries/decoders/TxsDecoder.sol b/l1-contracts/src/core/libraries/decoders/TxsDecoder.sol index c58b10b377e..93bb8d922d4 100644 --- a/l1-contracts/src/core/libraries/decoders/TxsDecoder.sol +++ b/l1-contracts/src/core/libraries/decoders/TxsDecoder.sol @@ -268,6 +268,7 @@ library TxsDecoder { for (uint256 j = 0; j < treeSize; j += 2) { _leafs[j / 2] = sha256(bytes.concat(_leafs[j], _leafs[j + 1])); } + treeSize /= 2; } return _leafs[0];