mirror of
https://github.com/tornadocash/tornado-core.git
synced 2024-12-29 16:17:55 +01:00
max leaves count fix
This commit is contained in:
parent
a64f41a44e
commit
9132aeb6d5
@ -70,13 +70,13 @@ If you want, you can point the app to existing tornado contracts on Mainnet or K
|
||||
## Deploy ETH Tornado Cash
|
||||
1. `cp .env.example .env`
|
||||
1. Tune all necessary params
|
||||
1. `npx truffle migrate --f 2 --to 4`
|
||||
1. `npx truffle migrate --network kovan --reset --f 2 --to 4`
|
||||
|
||||
## Deploy ERC20 Tornado Cash
|
||||
1. `cp .env.example .env`
|
||||
1. Tune all necessary params
|
||||
1. `npx truffle migrate --f 2 --to 3`
|
||||
1. `npx truffle migrate --f 5`
|
||||
1. `npx truffle migrate --network kovan --reset --f 2 --to 3`
|
||||
1. `npx truffle migrate --network kovan --reset --f 5`
|
||||
|
||||
**Note**. If you want to reuse the same verifier for all the mixers, then after you deployed one of the mixers you should only run 4th or 5th migration for ETH or ERC20 mixers respectively (`--f 4 --to 4` or `--f 5`).
|
||||
|
||||
|
@ -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. No more leafs can be added");
|
||||
require(current_index != 2**levels, "Merkle tree is full. No more leafs can be added");
|
||||
next_index += 1;
|
||||
uint256 current_level_hash = leaf;
|
||||
uint256 left;
|
||||
|
@ -180,7 +180,7 @@ contract('MerkleTreeWithHistory', accounts => {
|
||||
zeroValue = 1337
|
||||
merkleTreeWithHistory = await MerkleTreeWithHistory.new(levels, zeroValue)
|
||||
|
||||
for (let i = 0; i < 2**(levels - 1); i++) {
|
||||
for (let i = 0; i < 2**levels; i++) {
|
||||
await merkleTreeWithHistory.insert(i+42).should.be.fulfilled
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user