update deploy script

This commit is contained in:
Alexey 2021-10-06 20:14:28 +03:00
parent e402f8ab7b
commit fa7bb9947a
3 changed files with 44 additions and 22 deletions

View File

@ -43,6 +43,7 @@
"hardhat": "^2.3.0", "hardhat": "^2.3.0",
"mocha": "^9.1.0", "mocha": "^9.1.0",
"omnibridge": "git+https://github.com/peppersec/omnibridge.git#aa3a970c29752a4da5f3fc7ccf0733783c1acf0b", "omnibridge": "git+https://github.com/peppersec/omnibridge.git#aa3a970c29752a4da5f3fc7ccf0733783c1acf0b",
"prompt-sync": "^4.2.0",
"snarkjs": "git+https://github.com/tornadocash/snarkjs.git#616c2d30699f28c8f3ab737b877402ccbb604cfe", "snarkjs": "git+https://github.com/tornadocash/snarkjs.git#616c2d30699f28c8f3ab737b877402ccbb604cfe",
"tmp-promise": "^3.0.2", "tmp-promise": "^3.0.2",
"typechain": "^5.1.2" "typechain": "^5.1.2"

View File

@ -1,5 +1,6 @@
const { ethers } = require('hardhat') const { ethers } = require('hardhat')
const { utils } = ethers const { utils } = ethers
const prompt = require('prompt-sync')()
const MERKLE_TREE_HEIGHT = 23 const MERKLE_TREE_HEIGHT = 23
const { MINIMUM_WITHDRAWAL_AMOUNT, MAXIMUM_DEPOSIT_AMOUNT } = process.env const { MINIMUM_WITHDRAWAL_AMOUNT, MAXIMUM_DEPOSIT_AMOUNT } = process.env
@ -29,7 +30,8 @@ async function main() {
console.log(`hasher: ${hasher.address}`) console.log(`hasher: ${hasher.address}`)
const Pool = await ethers.getContractFactory('TornadoPool') const Pool = await ethers.getContractFactory('TornadoPool')
const tornadoImpl = await Pool.deploy( console.log(
`constructor args:\n${JSON.stringify([
verifier2.address, verifier2.address,
verifier16.address, verifier16.address,
MERKLE_TREE_HEIGHT, MERKLE_TREE_HEIGHT,
@ -38,12 +40,24 @@ async function main() {
omniBridge, omniBridge,
l1Unwrapper, l1Unwrapper,
govAddress, govAddress,
]).slice(1, -1)}\n`,
) )
await tornadoImpl.deployed() const tornadoImpl = prompt('Deploy tornado pool implementation and provide address here:\n')
console.log(`TornadoPool implementation address: ${tornadoImpl.address}`) // const tornadoImpl = await Pool.deploy(
// verifier2.address,
// verifier16.address,
// MERKLE_TREE_HEIGHT,
// hasher.address,
// token,
// omniBridge,
// l1Unwrapper,
// govAddress,
// )
// await tornadoImpl.deployed()
// console.log(`TornadoPool implementation address: ${tornadoImpl.address}`)
const CrossChainUpgradeableProxy = await ethers.getContractFactory('CrossChainUpgradeableProxy') const CrossChainUpgradeableProxy = await ethers.getContractFactory('CrossChainUpgradeableProxy')
const proxy = await CrossChainUpgradeableProxy.deploy(tornadoImpl.address, govAddress, [], amb, l1ChainId) const proxy = await CrossChainUpgradeableProxy.deploy(tornadoImpl, govAddress, [], amb, l1ChainId)
await proxy.deployed() await proxy.deployed()
console.log(`proxy address: ${proxy.address}`) console.log(`proxy address: ${proxy.address}`)

View File

@ -2001,12 +2001,12 @@ bn.js@4.11.6:
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215"
integrity sha1-UzRK2xRhehP26N0s4okF0cC6MhU= integrity sha1-UzRK2xRhehP26N0s4okF0cC6MhU=
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.8.0: bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.8.0:
version "4.12.0" version "4.12.0"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88"
integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==
bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2: bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0:
version "5.2.0" version "5.2.0"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002"
integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==
@ -6277,12 +6277,12 @@ merkle-patricia-tree@^2.1.2, merkle-patricia-tree@^2.3.2:
semaphore ">=1.0.1" semaphore ">=1.0.1"
merkle-patricia-tree@^4.2.0, merkle-patricia-tree@^4.2.1: merkle-patricia-tree@^4.2.0, merkle-patricia-tree@^4.2.1:
version "4.2.1" version "4.2.2"
resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-4.2.1.tgz#fc43e7b162e597a0720ccdd702bf1d49765691d2" resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-4.2.2.tgz#6dec17855370172458244c2f42c989dd60b773a3"
integrity sha512-25reMgrT8PhJy0Ba0U7fMZD2oobS1FPWB9vQa0uBpJYIQYYuFXEHoqEkTqA/UzX+s9br3pmUVVY/TOsFt/x0oQ== integrity sha512-eqZYNTshcYx9aESkSPr71EqwsR/QmpnObDEV4iLxkt/x/IoLYZYjJvKY72voP/27Vy61iMOrfOG6jrn7ttXD+Q==
dependencies: dependencies:
"@types/levelup" "^4.3.0" "@types/levelup" "^4.3.0"
ethereumjs-util "^7.1.0" ethereumjs-util "^7.1.2"
level-mem "^5.0.1" level-mem "^5.0.1"
level-ws "^2.0.0" level-ws "^2.0.0"
readable-stream "^3.6.0" readable-stream "^3.6.0"
@ -7308,6 +7308,13 @@ promise-to-callback@^1.0.0:
is-fn "^1.0.0" is-fn "^1.0.0"
set-immediate-shim "^1.0.1" set-immediate-shim "^1.0.1"
prompt-sync@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/prompt-sync/-/prompt-sync-4.2.0.tgz#0198f73c5b70e3b03e4b9033a50540a7c9a1d7f4"
integrity sha512-BuEzzc5zptP5LsgV5MZETjDaKSWfchl5U9Luiu8SKp7iZWD5tZalOxvNcZRwv+d2phNFr8xlbxmFNcRKfJOzJw==
dependencies:
strip-ansi "^5.0.0"
proxy-addr@~2.0.5: proxy-addr@~2.0.5:
version "2.0.7" version "2.0.7"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025"
@ -7815,11 +7822,11 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
inherits "^2.0.1" inherits "^2.0.1"
rlp@^2.0.0, rlp@^2.2.1, rlp@^2.2.2, rlp@^2.2.3, rlp@^2.2.4: rlp@^2.0.0, rlp@^2.2.1, rlp@^2.2.2, rlp@^2.2.3, rlp@^2.2.4:
version "2.2.6" version "2.2.7"
resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.6.tgz#c80ba6266ac7a483ef1e69e8e2f056656de2fb2c" resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf"
integrity sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg== integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==
dependencies: dependencies:
bn.js "^4.11.1" bn.js "^5.2.0"
run-async@^2.2.0: run-async@^2.2.0:
version "2.4.1" version "2.4.1"