From 08f8bfb070f774bf8e6ef884b6b0391478f59259 Mon Sep 17 00:00:00 2001 From: Alexey Date: Sat, 14 Dec 2019 12:42:22 +0300 Subject: [PATCH] tidy --- README.md | 13 +++++++++++++ migrationDeposits.js | 4 ++-- migrations/4_deploy_eth_mixer.js | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4066fb7..23aeb9b 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,19 @@ If you want, you can point the app to existing tornado contracts on Mainnet or K **Note**. If you want to reuse the same verifier for all the instances, then after you deployed one of the instances you should only run 4th or 5th migration for ETH or ERC20 contracts respectively (`--f 4 --to 4` or `--f 5`). +## Migraton +1. `npm install` +1. `cp .env.example .env` +1. `npm run build` - this may take 10 minutes or more +1. `npm run migrate:kovan` +1. Take `ETHTornado's address` address from the output and set it as `HELPER_INSTANCE` in `./migrationDeposits.js` +1. Go to `./migrations/4_deploy_eth_mixer.js` and change `const ETHTornado = artifacts.require('ETHTornado')` to `const ETHTornado = artifacts.require('MigratableETHTornado')` +1. `npm run migrate:mainnet` +1. Take `ETHTornado's address` address from the output and set it as `NEW_INSTANCE` in `./migrationDeposits.js` +1. Setup right `SOURCE_RPC` and `TARGET_RPC` in the `./migrationDeposits.js` +1. Go to `./migrationDeposits.js` at the line 141 (`// 3. Decide should we uncomment here`) +1. `node migrationDeposits.js` + ## Credits Special thanks to @barryWhiteHat and @kobigurk for valuable input, diff --git a/migrationDeposits.js b/migrationDeposits.js index 205ffab..9dd301d 100644 --- a/migrationDeposits.js +++ b/migrationDeposits.js @@ -17,8 +17,8 @@ const { numberToHex, toWei } = require('web3-utils') // 2. edit here const PREVIOUS_INSTANCE = '0xb541fc07bC7619fD4062A54d96268525cBC6FfEF' -const HELPER_INSTANCE = '' -const NEW_INSTANCE = '' +const HELPER_INSTANCE = '0x831822ad4A8AEbfC27DF0b915902de855E613eb2' +const NEW_INSTANCE = '0xcdA7FC8a05CFF618f7e323c547d6F2EF6c3578AA' function toHex(number, length = 32) { let str = number instanceof Buffer ? number.toString('hex') : bigInt(number).toString(16) diff --git a/migrations/4_deploy_eth_mixer.js b/migrations/4_deploy_eth_mixer.js index e3170fe..f074dbf 100644 --- a/migrations/4_deploy_eth_mixer.js +++ b/migrations/4_deploy_eth_mixer.js @@ -1,6 +1,7 @@ /* global artifacts */ require('dotenv').config({ path: '../.env' }) const ETHTornado = artifacts.require('ETHTornado') +// const ETHTornado = artifacts.require('MigratableETHTornado') const Verifier = artifacts.require('Verifier') const hasherContract = artifacts.require('Hasher')