From ec30e2d357c5995c6d942703a708e9b1849784fc Mon Sep 17 00:00:00 2001 From: Drygin Date: Wed, 4 Sep 2019 13:31:10 +0300 Subject: [PATCH] fix merkle tree capacity --- contracts/MerkleTreeWithHistory.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/MerkleTreeWithHistory.sol b/contracts/MerkleTreeWithHistory.sol index a374bff..74a4bc3 100644 --- a/contracts/MerkleTreeWithHistory.sol +++ b/contracts/MerkleTreeWithHistory.sol @@ -58,7 +58,7 @@ contract MerkleTreeWithHistory { function _insert(uint256 leaf) internal { uint32 current_index = next_index; - require(current_index != 2**(levels - 1), "Merkle tree is full"); + require(current_index != 2**levels, "Merkle tree is full"); next_index += 1; uint256 current_level_hash = leaf; uint256 left;