This commit is contained in:
Danil Kovtonyuk 2021-11-22 17:29:48 +10:00
parent 1dc3cf8ca8
commit 48863e4814
No known key found for this signature in database
GPG Key ID: E72A919BF08C3746
12 changed files with 731 additions and 919 deletions

View File

@ -6,12 +6,7 @@
</b-navbar-item>
</template>
<template slot="start">
<b-navbar-item
href="https://medium.com/@tornado-cash/tornado-cash-deployment-proposal-on-avalanche-ee5d69f9e4b0"
target="_blank"
class="decorate"
rel="noreferrer"
>
<b-navbar-item href="#" target="_blank" class="decorate" rel="noreferrer">
{{ $t('info') }}
</b-navbar-item>
</template>

View File

@ -17,7 +17,7 @@
"deployedBy": "Deployed by: {link}",
"startNow": "Start now",
"completedTasks": "Completed Tasks: {progress}",
"pageSubtitle": "Follow these simple steps to become part of deployment of Tornado.Cash protocol on Avalanche Mainnet.",
"pageSubtitle": "Follow these simple steps to become part of deployment of Tornado.Cash protocol on Aribtrum One.",
"alreadyDeployed": "Already deployed",
"contractDeployed": "Contract successfully deployed",
"transactionFailed": "Transaction was failed",
@ -26,6 +26,6 @@
"viewOnEtherscan": "View on Etherscan",
"pleaseConnectWallet": "Please connect your wallet first",
"dependsOnEns": "This action depends on {ens}",
"avalancheOnly": "Please switch your wallet to Avalanche Mainnet",
"switchNetwork": "Switch to Avalanche"
"arbitrumOnly": "Please switch your wallet to Arbitrum One",
"switchNetwork": "Switch to Arbitrum"
}

View File

@ -37,6 +37,7 @@ export default {
}
this.fetchDeploymentStatus()
this.statusPooling()
this.fetchGasPrice()
this.setAirdropAddresses()
},
@ -44,6 +45,7 @@ export default {
...mapActions('provider', ['initProvider']),
...mapActions('airdrop', ['setAirdropAddresses']),
...mapActions('steps', ['statusPooling', 'fetchDeploymentStatus']),
...mapActions('gasPrice', ['fetchGasPrice']),
},
}
</script>

View File

@ -1,20 +1,26 @@
const networkConfig = {
netId43114: {
netId42161: {
rpcCallRetryAttempt: 15,
gasPrices: { fast: 225, low: 225, custom: 225, standard: 225 },
currencyName: 'AVAX',
explorerUrl: {
tx: 'https://cchain.explorer.avax.network/tx/',
address: 'https://cchain.explorer.avax.network/address/',
gasPrices: {
instant: 4,
fast: 3,
standard: 2.52,
low: 2.29,
},
networkName: 'avalanche',
currencyName: 'ETH',
explorerUrl: {
tx: 'https://arbiscan.io/tx/',
address: 'https://arbiscan.io/address/',
},
networkName: 'arbitrum',
rpcUrls: {
Infura: {
name: 'Avalanche RPC',
url: 'https://api.avax.network/ext/bc/C/rpc',
name: 'Arbitrum Public RPC',
url:
'https://arb-mainnet.g.alchemy.com/v2/_82R9fXSpgWH9iv_oKdwKww7qMyJ6OpR',
},
},
pollInterval: 200,
pollInterval: 15,
},
}

View File

@ -12,16 +12,16 @@
"deploy-prod": "npm run generate && push-dir --allow-unclean --dir=dist --branch=gh-pages --cleanup --remote=temp"
},
"dependencies": {
"nuxt-web3-provider": "^0.1.1",
"nuxt-web3-provider": "^0.1.4",
"core-js": "^3.6.5",
"gas-price-oracle": "^0.3.4",
"gas-price-oracle": "^0.4.4",
"node-sass": "^4.14.1",
"nuxt": "^2.14.6",
"nuxt-buefy": "^0.4.4",
"push-dir": "^0.4.1",
"sass-loader": "^10.0.3",
"vue-i18n": "^8.22.1",
"web3": "1.2.6"
"web3": "1.5.2"
},
"devDependencies": {
"@nuxtjs/eslint-config": "^3.1.0",

View File

@ -1,7 +1,7 @@
<template>
<div>
<h1 class="title has-text-centered">
Tornado.cash <span>Avalanche</span> Deployment
Tornado.cash <span>Arbitrum</span> Deployment
</h1>
<h2 class="subtitle has-text-centered">{{ $t('pageSubtitle') }}</h2>

File diff suppressed because one or more lines are too long

View File

@ -69,12 +69,13 @@ const actions = {
],
from: ethAccount,
}
const gasEstimate =
action.domain === 'deployer.contract.tornadocash.eth'
? numberToHex(1e6)
: await dispatch('provider/sendRequest', callParamsEstimate, {
root: true,
})
const gasEstimate = await dispatch(
'provider/sendRequest',
callParamsEstimate,
{
root: true,
}
)
const gasWithBuffer = Math.ceil(hexToNumber(gasEstimate) * 1.1)
const callParams = {
method: 'eth_sendTransaction',

View File

@ -3,7 +3,7 @@ import { GasPriceOracle } from 'gas-price-oracle'
import networkConfig from '@/networkConfig'
const { toHex, toWei } = require('web3-utils')
const GAS_PRICES = networkConfig.netId43114.gasPrices
const GAS_PRICES = networkConfig.netId42161.gasPrices
export const state = () => {
return {
@ -17,7 +17,7 @@ export const getters = {
const currentRpc = rootGetters['provider/getNetwork'].rpcUrls.Infura.url
console.log('currentRpc', currentRpc)
return new GasPriceOracle({
chainId: 43114,
chainId: 42161,
defaultRpc: currentRpc,
defaultFallbackGasPrices: GAS_PRICES,
})

View File

@ -13,22 +13,21 @@ import {
export default {
async initProvider({ commit, state, getters, dispatch }, { name, network }) {
try {
const account = await this.$provider.initProvider(getters.getProvider)
if (window.ethereum.chainId !== '0xa86a') {
const account = await this.$provider.initProvider(getters.getProvider, {})
if (window.ethereum.chainId !== '0xa4b1') {
await dispatch(
'notice/addNotice',
{
notice: {
title: 'avalancheOnly',
title: 'arbitrumOnly',
type: 'danger',
callback: () => dispatch('switchNetwork', { netId: 43114 }),
callback: () => dispatch('switchNetwork', { netId: 42161 }),
message: 'switchNetwork',
},
},
{ root: true }
)
throw new Error('Connect to Avalanche')
throw new Error('Connect to Arbitrum')
}
commit(SET_PROVIDER_NAME, name)
@ -120,16 +119,16 @@ export default {
},
async addNetwork(_, { netId }) {
const METAMASK_LIST = {
43114: {
chainId: '0xA86A',
chainName: 'Avalanche Mainnet',
rpcUrls: ['https://api.avax.network/ext/bc/C/rpc'],
42161: {
chainId: '0xA4B1',
chainName: 'Arbitrum One',
rpcUrls: ['https://arb1.arbitrum.io/rpc'],
nativeCurrency: {
name: 'Avalanche',
symbol: 'AVAX',
name: 'Ether',
symbol: 'AETH',
decimals: 18,
},
blockExplorerUrls: ['https://cchain.explorer.avax.network'],
blockExplorerUrls: ['https://arbiscan.io'],
},
}

View File

@ -1,8 +1,8 @@
export default () => ({
account: null,
network: {
name: 'avalanche',
id: 43114,
name: 'arbitrum',
id: 42161,
},
provider: {
name: '',

1493
yarn.lock

File diff suppressed because it is too large Load Diff