generates action.json for ceremony
This commit is contained in:
parent
568995e19a
commit
222bdfcfab
14
.env.example
14
.env.example
|
@ -1,9 +1,17 @@
|
|||
SALT=0x0000000000000000000000000000000000000000000000000000000047941987
|
||||
MERKLE_TREE_HEIGHT=23
|
||||
GOVERNANCE=
|
||||
OMNIBRIDGE=
|
||||
L2_TOKEN=
|
||||
GOVERNANCE=0x5efda50f22d34F262c29268506C5Fa42cB56A1Ce
|
||||
|
||||
L2_OMNIBRIDGE=0x59447362798334d3485c64D1e4870Fde2DDC0d75
|
||||
L2_TOKEN=0xCa8d20f3e0144a72C6B5d576e9Bd3Fd8557E2B04
|
||||
L2_AMB=0x162e898bd0aacb578c8d5f8d6ca588c13d2a383f
|
||||
|
||||
L1_OMNIBRIDGE=0xf0b456250dc9990662a6f25808cc74a6d1131ea9
|
||||
L1_TOKEN=0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c
|
||||
L1_CHAIN_ID=56
|
||||
|
||||
MINIMUM_WITHDRAWAL_AMOUNT=0.05
|
||||
MAXIMUM_DEPOSIT_AMOUNT=1
|
||||
|
||||
|
||||
PRIVATE_KEY=0x
|
||||
|
|
2
build.sh
2
build.sh
|
@ -9,5 +9,5 @@ cd ..
|
|||
cd tornado-pool
|
||||
yarn install
|
||||
yarn circuit_prod
|
||||
npx hardhat compile
|
||||
yarn compile
|
||||
cd ..
|
||||
|
|
|
@ -1,18 +1,30 @@
|
|||
require('dotenv').config()
|
||||
const fs = require('fs')
|
||||
const ethers = require('ethers')
|
||||
const { formatUnits, commify } = ethers.utils
|
||||
const { parseEther } = ethers.utils
|
||||
const { deploy, getContractData, expectedAddress } = require('./utils')
|
||||
|
||||
const { SALT, MERKLE_TREE_HEIGHT, OMNIBRIDGE, GOVERNANCE, L2_TOKEN } = process.env
|
||||
const {
|
||||
SALT,
|
||||
MERKLE_TREE_HEIGHT,
|
||||
L1_OMNIBRIDGE,
|
||||
L2_OMNIBRIDGE,
|
||||
GOVERNANCE,
|
||||
L2_TOKEN,
|
||||
L1_TOKEN,
|
||||
L2_AMB,
|
||||
L1_CHAIN_ID,
|
||||
MAXIMUM_DEPOSIT_AMOUNT,
|
||||
MINIMUM_WITHDRAWAL_AMOUNT,
|
||||
} = process.env
|
||||
|
||||
const deployer = getContractData('../deployer/build/contracts/Deployer.json')
|
||||
const verifier2 = getContractData('../tornado-pool/artifacts/contracts/Verifier2.sol/Verifier2.json')
|
||||
const verifier16 = getContractData('../tornado-pool/artifacts/contracts/Verifier16.sol/Verifier16.json')
|
||||
const hasher = getContractData('../tornado-pool/artifacts/contracts/Hasher.sol/Hasher.json')
|
||||
const hasher = getContractData('../tornado-pool/artifacts/contracts/Hasher.json')
|
||||
const tornadoPool = getContractData('../tornado-pool/artifacts/contracts/TornadoPool.sol/TornadoPool.json')
|
||||
const upgradeableProxy = getContractData(
|
||||
'../tornado-pool/artifacts/contracts/CrossChainUpgradeableProxy.sol.sol/CrossChainUpgradeableProxy.sol.json',
|
||||
'../tornado-pool/artifacts/contracts/CrossChainUpgradeableProxy.sol/CrossChainUpgradeableProxy.json',
|
||||
)
|
||||
|
||||
const l1Helper = getContractData('../tornado-pool/artifacts/contracts/bridge/L1Helper.sol/L1Helper.json')
|
||||
|
@ -52,6 +64,20 @@ actions.push(
|
|||
}),
|
||||
)
|
||||
|
||||
// L1
|
||||
actions.push(
|
||||
deploy({
|
||||
domain: 'l1Helper.contract.tornadocash.eth',
|
||||
contract: l1Helper,
|
||||
title: 'L1 Omnibridge Helper',
|
||||
description: 'Utility contract for the xDAI Omnibridge on L1',
|
||||
dependsOn: ['deployer.contract.tornadocash.eth'],
|
||||
args: [L1_OMNIBRIDGE, L1_TOKEN, GOVERNANCE],
|
||||
isL1Contract: true,
|
||||
}),
|
||||
)
|
||||
|
||||
// L2
|
||||
// Deploy Hasher
|
||||
actions.push(
|
||||
deploy({
|
||||
|
@ -98,19 +124,21 @@ actions.push(
|
|||
MERKLE_TREE_HEIGHT,
|
||||
expectedAddress(actions, 'hasher.contract.tornadocash.eth'),
|
||||
L2_TOKEN,
|
||||
OMNIBRIDGE,
|
||||
L2_OMNIBRIDGE,
|
||||
expectedAddress(actions, 'l1Helper.contract.tornadocash.eth'),
|
||||
GOVERNANCE,
|
||||
L1_CHAIN_ID,
|
||||
],
|
||||
}),
|
||||
)
|
||||
|
||||
// TODO Deploy and call
|
||||
// TODO hasher
|
||||
// TODO proxy and l1 args
|
||||
// TODO mark l1 as l1
|
||||
|
||||
// Deploy Proxy
|
||||
const tornadoInterface = new ethers.utils.Interface(tornadoPool.abi)
|
||||
const initData = tornadoInterface.encodeFunctionData('initialize', [
|
||||
parseEther(MINIMUM_WITHDRAWAL_AMOUNT),
|
||||
parseEther(MAXIMUM_DEPOSIT_AMOUNT),
|
||||
])
|
||||
|
||||
actions.push(
|
||||
deploy({
|
||||
domain: 'proxy.contract.tornadocash.eth',
|
||||
|
@ -118,17 +146,13 @@ actions.push(
|
|||
title: 'Cross-chain Upgradeable Proxy',
|
||||
description: 'Upgradability proxy contract for Tornado Pool owned by TornadoCash governance',
|
||||
dependsOn: ['deployer.contract.tornadocash.eth'],
|
||||
}),
|
||||
)
|
||||
|
||||
// l1
|
||||
actions.push(
|
||||
deploy({
|
||||
domain: 'l1Helper.contract.tornadocash.eth',
|
||||
contract: l1Helper,
|
||||
title: 'L1 Omnibridge Helper',
|
||||
description: 'Utility contract for the xDAI Omnibridge on L1',
|
||||
dependsOn: ['deployer.contract.tornadocash.eth'],
|
||||
args: [
|
||||
expectedAddress(actions, 'tornadoPool.contract.tornadocash.eth'),
|
||||
GOVERNANCE,
|
||||
initData,
|
||||
L2_AMB,
|
||||
L1_CHAIN_ID,
|
||||
],
|
||||
}),
|
||||
)
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ function deploy({
|
|||
title = '',
|
||||
description = '',
|
||||
dependsOn = [], //[config.deployer.address],
|
||||
isL1Contract = false,
|
||||
}) {
|
||||
console.log('Generating deploy for', contract.name)
|
||||
let bytecode = contract.bytecode
|
||||
|
@ -48,6 +49,7 @@ function deploy({
|
|||
constructorArgs,
|
||||
description,
|
||||
dependsOn,
|
||||
isL1Contract,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 76cf0e95020883b65d3fdacf64469fe645033d3e
|
||||
Subproject commit 0ecd02620d7e15547dea45e4315929dc73553a11
|
Loading…
Reference in New Issue