mirror of
https://github.com/tornadocash/tornado-core.git
synced 2024-11-28 23:06:32 +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
|
## Deploy ETH Tornado Cash
|
||||||
1. `cp .env.example .env`
|
1. `cp .env.example .env`
|
||||||
1. Tune all necessary params
|
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
|
## Deploy ERC20 Tornado Cash
|
||||||
1. `cp .env.example .env`
|
1. `cp .env.example .env`
|
||||||
1. Tune all necessary params
|
1. Tune all necessary params
|
||||||
1. `npx truffle migrate --f 2 --to 3`
|
1. `npx truffle migrate --network kovan --reset --f 2 --to 3`
|
||||||
1. `npx truffle migrate --f 5`
|
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`).
|
**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 {
|
function _insert(uint256 leaf) internal {
|
||||||
uint32 current_index = next_index;
|
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;
|
next_index += 1;
|
||||||
uint256 current_level_hash = leaf;
|
uint256 current_level_hash = leaf;
|
||||||
uint256 left;
|
uint256 left;
|
||||||
|
@ -180,7 +180,7 @@ contract('MerkleTreeWithHistory', accounts => {
|
|||||||
zeroValue = 1337
|
zeroValue = 1337
|
||||||
merkleTreeWithHistory = await MerkleTreeWithHistory.new(levels, zeroValue)
|
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
|
await merkleTreeWithHistory.insert(i+42).should.be.fulfilled
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user