arbitrum related changes

This commit is contained in:
Alexey 2021-05-25 13:39:01 +03:00
parent e483190ed6
commit 9593914bca
3 changed files with 23 additions and 7 deletions

View File

@ -13,7 +13,12 @@ yarn compile
cd ..
cd tornado-anonymity-mining
mkdir -p build/circuits
pushd build/circuits
wget https://github.com/tornadocash/tornado-anonymity-mining/releases/download/v1.0.0/RewardVerifier.sol
wget https://github.com/tornadocash/tornado-anonymity-mining/releases/download/v1.0.0/WithdrawVerifier.sol
wget https://github.com/tornadocash/tornado-anonymity-mining/releases/download/v1.0.0/TreeUpdateVerifier.sol
popd
yarn install
# yarn circuit
yarn compile
cd ..

View File

@ -21,12 +21,12 @@ async function main() {
if (!code || code === '0x') {
console.log('Deploying EIP-2470 deployer')
const balance = await provider.getBalance(actions.eipDeployer.from)
if (balance < ethers.utils.parseEther('0.0247')) {
if (balance.lt(ethers.utils.parseEther('0.0247'))) {
console.log('Insufficient balance on deploy address, sending some eth')
const tx = await wallet.sendTransaction({
to: actions.eipDeployer.from,
value: ethers.utils.parseEther('0.0247').sub(balance).toHexString(),
gasLimit: ethers.BigNumber.from(21000).toHexString(),
gasLimit: ethers.BigNumber.from(800000).toHexString(), // 800k because of arbitrum
gasPrice: 1e6,
})
console.log('Tx hash:', tx.hash)
@ -46,7 +46,7 @@ async function main() {
continue
}
console.log(`Deploying ${action.contract} to ${action.domain} (${action.expectedAddress})`)
const tx = await deployer.deploy(action.bytecode, actions.salt, { gasLimit: 7e7, gasPrice: 1e6 })
const tx = await deployer.deploy(action.bytecode, actions.salt, { gasLimit: 7e7, gasPrice: 1e9 })
console.log(`TX hash ${explorer}/tx/${tx.hash}`)
try {
await tx.wait()
@ -58,7 +58,7 @@ async function main() {
console.error(`Failed to deploy ${action.contract}, sending debug tx`)
// const trace = await provider.send('debug_traceTransaction', [ tx.hash ])
// console.log(trace)
const tx2 = await wallet.sendTransaction({ gasLimit: 8e6, data: action.bytecode })
const tx2 = await wallet.sendTransaction({ gasLimit: 8e6, gasPrice: 1e9, data: action.bytecode })
console.log(`TX hash ${explorer}/tx/${tx2.hash}`)
await tx2.wait()
console.log('Mined, check revert reason on etherscan')

View File

@ -4,7 +4,7 @@ const ethers = require('ethers')
const { formatUnits, commify } = ethers.utils
const { deploy, getContractData, expectedAddress } = require('./utils')
const { DEPLOYER, SALT, HASHER, VERIFIER, COMP_ADDRESS } = process.env
const { DEPLOYER, SALT, COMP_ADDRESS } = process.env
const instances = require('../instances')
const deployer = getContractData('../deployer/build/contracts/Deployer.json')
@ -14,6 +14,7 @@ const ethTornado = getContractData('../tornado-core/build/contracts/ETHTornado.j
const ercTornado = getContractData('../tornado-core/build/contracts/ERC20Tornado.json')
const compTornado = getContractData('../tornado-core/build/contracts/cTornado.json')
const proxyLight = getContractData('../tornado-anonymity-mining/build/contracts/TornadoProxyLight.json')
const echoer = getContractData('../tornado-anonymity-mining/build/contracts/Echoer.json')
const actions = []
@ -25,7 +26,7 @@ const eipDeployer = {
value: 0,
data:
'0x608060405234801561001057600080fd5b50610134806100206000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c80634af63f0214602d575b600080fd5b60cf60048036036040811015604157600080fd5b810190602081018135640100000000811115605b57600080fd5b820183602082011115606c57600080fd5b80359060200191846001830284011164010000000083111715608d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925060eb915050565b604080516001600160a01b039092168252519081900360200190f35b6000818351602085016000f5939250505056fea26469706673582212206b44f8a82cb6b156bfcc3dc6aadd6df4eefd204bc928a4397fd15dacf6d5320564736f6c63430006020033',
gasLimit: 247000,
gasLimit: 7247000, // more gas because it's arbitrum
},
signature: {
v: 27,
@ -81,6 +82,16 @@ actions.push(
}),
)
// Deploy Echoer
actions.push(
deploy({
domain: 'echoer.contract.tornadocash.eth',
contract: echoer,
title: 'Echoer',
description: 'Utility contract that stores encrypted Note Accounts',
}),
)
// Deploy instances
for (const instance of instances) {
const args = [