window.web3 is no longer injected by metamask, instead it is window.ethereum, but loads of methods are missing. It used to be very simple, just:

contract = new window.web3.eth.Contract(abi, address);
const a = await contract.methods.testCall().call();

I don't understand how to do this now, there is no Contract method. There is a request({"method": "eth_call"...) but I don't understand how to use it.

It seems like they took something very simple that was working and broke it.

  • 1
    You can always embed your own copy of web3 in your page, and initialize it to use window.ethereum as rpc provider.
    – Ismael
    Nov 21 at 3:34


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.