From 9d09c55989ff9740c3fe320571e42b4093fca731 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 10 Nov 2020 10:42:16 +0100 Subject: [PATCH] Adapt to Metamask breaking change --- libs/remix-lib/src/execution/execution-context.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-lib/src/execution/execution-context.js b/libs/remix-lib/src/execution/execution-context.js index ff99e04772..d77bca07b9 100644 --- a/libs/remix-lib/src/execution/execution-context.js +++ b/libs/remix-lib/src/execution/execution-context.js @@ -12,8 +12,8 @@ const LogsManager = require('./logsManager.js') const rlp = ethUtil.rlp let web3 -if (typeof window !== 'undefined' && typeof window.web3 !== 'undefined') { - var injectedProvider = window.web3.currentProvider +if (typeof window !== 'undefined' && typeof window.ethereum !== 'undefined') { + var injectedProvider = window.ethereum web3 = new Web3(injectedProvider) } else { web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'))