MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
12.03k stars 4.91k forks source link

Kovan - eth_call fails due to non-standard key in req #3094

Closed denisgranha closed 6 years ago

denisgranha commented 6 years ago

Good morning, I'm experiencing an error when calling a contract public method, this is done when trying to import a Multisig Contract in https://wallet.gnosis.pm using Kovan Add wallet > restore > 0x2e52603770bce8d4286c325df141c7f74c5a39b2 > ok

Note: With older version metamask it works, the function called is https://github.com/gnosis/MultiSigWallet/blob/master/contracts/MultiSigWallet.sol#L24

Thanks,

hstemplewski commented 6 years ago

the same error...

hstemplewski commented 6 years ago

when i try to call contract method call, in all functions i get this error.

jordanmurkin commented 6 years ago

I'm also getting this error on every contract call.

Ran a simple test trying to deploy a simple contract through browser-solidity onto Kovan. The same error is given. Deploying the same contract onto Rinkeby goes through correctly.

Network: Kovan Browser: Chrome 63 OS: macOS 10.12.6

maksim-tolo commented 6 years ago

I have the same issue.

Browser: Chrome 63 MetaMask: 3.13.7

maxaleks commented 6 years ago

The same issue..

hromyk commented 6 years ago

+1 (metaMask: 3.13.7). Fixed after rollback to the prev. version (3.13.6) https://github.com/MetaMask/metamask-extension/releases

dhadrien commented 6 years ago

Same, calling a contract variable on kovan

kumavis commented 6 years ago

Is anyone experiencing this on a different network than kovan?

kumavis commented 6 years ago

issue has been diagnosed: infura uses parity only for kovan, so there are some differences from geth

we append a non-standard origin key to the request params which parity rejects as Invalid request.

can be reproduced with

curl 'https://api.infura.io/v1/jsonrpc/kovan' -H 'pragma: no-cache' -H 'origin: null' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en-US,en;q=0.9' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36' -H 'content-type: application/json' -H 'accept: application/json' -H 'cache-control: no-cache' -H 'authority: api.infura.io' --data-binary '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0x8385b6e21c97258a25c901189ca8cd2ec951ff7d","data":"0x70a0823100000000000000000000000027f880d10656e2ce1a83dd0f9d2b0f8dbc9ed2bc"},"latest"],"id":1600634549,"origin":"tokenfactory.surge.sh"}' --compressed
kumavis commented 6 years ago

fixed in eth-json-rpc-infura@3.0.0, will pull into metamask soon

denisgranha commented 6 years ago

Thanks @kumavis

danfinlay commented 6 years ago

Published, should auto-update soon.

rawadrifai commented 6 years ago

Was this fixed? I'm experiencing the same now.


errors.js:38 Uncaught (in promise) Error: Error: Error: [ethjs-rpc] rpc error with payload {"id":7178096065713,"jsonrpc":"2.0","params":```

```index.js:2429 GET chrome-extension://invalid/ 0 ()
_callee$ @ index.js:2429
tryCatch @ index.js:2616
invoke @ index.js:2850
prototype.(anonymous function) @ index.js:2668
step @ index.js:2493
(anonymous) @ index.js:2493
(anonymous) @ index.js:2493
(anonymous) @ index.js:2452
_callee2$ @ index.js:2421
tryCatch @ index.js:2616
invoke @ index.js:2850
prototype.(anonymous function) @ index.js:2668
step @ index.js:2493
(anonymous) @ index.js:2493
(anonymous) @ index.js:2493
map @ index.js:2489
getStackFrames @ index.js:2270
crashWithFrames @ index.js:1927
(anonymous) @ index.js:1945
rejectionHandler @ index.js:2041
funds:1 Denying load of chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/inpage.js.map. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.
index.js:885 GET chrome-extension://invalid/ 0 ()```
rawadrifai commented 6 years ago

Denying load of chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/background.js. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.

rawadrifai commented 6 years ago

p.s. I'm connecting metamask to local ganache now. If I disable metamask it run fine if I connect to local node directly without metamask.

rawadrifai commented 6 years ago

resolved here: https://github.com/MetaMask/metamask-extension/issues/2941

Juan-cc commented 5 years ago

I am still getting "Denying load of chrome-extension..." using my local geth client. I am using React and Web3.

The code I use to get my web3 instance is:

 import Web3 from "web3";    
  const getWeb3 = () =>
  new Promise((resolve, reject) => {
    // Wait for loading completion to avoid race conditions with web3 injection timing.
    window.addEventListener("load", async () => {
      console.log("Loading Web3...");
      // Modern dapp browsers...
      if (window.ethereum) {
        console.log("Modern dapp browser detected!");
        const web3 = new Web3(window.ethereum);
        try {
          // Request account access if needed
          await window.ethereum.enable();
          // Acccounts now exposed
          resolve(web3);
        } catch (error) {
          reject(error);
        }
      }
      // Legacy dapp browsers...
      else if (window.web3) {
        // Use Mist/MetaMask's provider.
        const web3 = window.web3;
        console.log("Injected web3 detected (Mist/MetaMask).");
        resolve(web3);
      }
      // Fallback to localhost; use dev console port by default...
      else {
        const provider = new Web3.providers.HttpProvider(
          "http://127.0.0.1:8545"
        );
        const web3 = new Web3(provider);
        console.log("No web3 instance injected, using Local web3 (http://127.0.0.1:8545).");
        resolve(web3);
      }
    });
  });

export default getWeb3;

NOTES: 1) The first strange thing is that => if (window.ethereum) returns true so it's not using window.web3. 2) await window.ethereum.enable(); works fine, I see the popup window and I can accept. 3) when it gets here it throws the error: // Acccounts now exposed resolve(web3);

image

Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'Window': function 
(error, response) {
        if (!error) {
          resolve(response);
        }

    ...<omitted>... } could not be cloned.
at i._write (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/inpage.js:1:117661)

Denying load of chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/inpage.js.map. Resources must be 
listed in the web_accessible_resources manifest key in order to be loaded by pages outside the 
extension.

GET chrome-extension://invalid/ net::ERR_FAILED

I experienced this in two projects I worked on, I tried different things without any luck. What I end up doing is to disable Metamask to move forward with development. I would appreciate any help/guidance you could provide. Thanks!!

crazyrabbitLTC commented 5 years ago

I'm having the same problem, but I can't identify the origins of it. @Juan-cc did you ever solve this?