I am interacting with a contract on the Rinkeby testnet using web3.js (version 0.20.7) with Metamask and the chrome console.
I setup a contract object called mycontract for a given ABI and address. When I set the web3 provider for this contract using mycontract.setProvider(web3.givenProvider) I get an error saying that mycontract.setProvider is not a function.
See below the js code deployed in the chrome console:
> const mycontract = web3.eth.contract(ABI, Address); undefined > mycontract.setProvider(web3.givenProvider); < VM212:1 Uncaught TypeError: simpleStorage.setProvider is not a function at <anonymous>:1:15
I suppose this may be due to the fact that the
mycontract.setProvider(web3.givenProvider) command is for web3.js version 1.0 and above.
However, if it is the case, I could not find info about what command I should use with web3.js 0.20.7.
Any help would be great.