diff --git a/store/deploy.js b/store/deploy.js index 9138ca8..7e8dbe3 100644 --- a/store/deploy.js +++ b/store/deploy.js @@ -9,7 +9,7 @@ const state = () => { const getters = { deployerContract: (state, getters, rootState, rootGetters) => (isProxy) => { - const web3 = rootGetters['provider/getWeb3'] + const web3 = rootGetters['provider/currentRpc'] return new web3.eth.Contract( deployerABI, isProxy @@ -30,7 +30,7 @@ const actions = { dispatch('loading/enable', {}, { root: true }) const isProxy = action.domain === 'deployer.contract.tornadocash.eth' const ethAccount = rootGetters['provider/getAccount'] - const web3 = rootGetters['provider/getWeb3'] + const web3 = rootGetters['provider/currentRpc'] const code = await web3.eth.getCode(action.expectedAddress) console.log('code', code) diff --git a/store/provider/getters.js b/store/provider/getters.js index 7583aa3..351e500 100644 --- a/store/provider/getters.js +++ b/store/provider/getters.js @@ -26,6 +26,11 @@ export default { return Object.freeze(new Web3(provider)) }, + currentRpc: (state, getters) => { + const network = getters.getNetwork + const rpcUrl = network.rpcUrls.Infura.url + return Object.freeze(new Web3(rpcUrl)) + }, getBalance: (state) => { return state.balance },