diff --git a/lib/contracts/code_templates/web3-connector.js.ejs b/lib/contracts/code_templates/web3-connector.js.ejs index bcbf4fe1b..6d7c4d54d 100644 --- a/lib/contracts/code_templates/web3-connector.js.ejs +++ b/lib/contracts/code_templates/web3-connector.js.ejs @@ -5,7 +5,7 @@ __reduce(<%- connectionList %>,function(prev, value, next) { } if (value === '$WEB3' && (typeof web3 !== 'undefined' && typeof Web3 !== 'undefined')) { - web3.setProvider(web3.currentProvider); + web3.setProvider(web3.givenProvider); } else if (value !== '$WEB3' && (typeof Web3 !== 'undefined' && ((typeof web3 === 'undefined') || (typeof web3 !== 'undefined' && (!web3.isConnected || (web3.isConnected && !web3.isConnected())))))) { web3.setProvider(new Web3.providers.HttpProvider(value));