mirror of
https://github.com/tornadocash/tornado-initiation-ui.git
synced 2024-11-22 01:26:51 +01:00
arbitrum
This commit is contained in:
parent
1dc3cf8ca8
commit
48863e4814
@ -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>
|
||||
|
@ -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"
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -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",
|
||||
|
@ -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
@ -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',
|
||||
|
@ -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,
|
||||
})
|
||||
|
@ -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'],
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
export default () => ({
|
||||
account: null,
|
||||
network: {
|
||||
name: 'avalanche',
|
||||
id: 43114,
|
||||
name: 'arbitrum',
|
||||
id: 42161,
|
||||
},
|
||||
provider: {
|
||||
name: '',
|
||||
|
Loading…
Reference in New Issue
Block a user