Open fvictorio opened 3 years ago
Another alternative is to create an additional network at MetaMask, name it localhost
, use the address http://127.0.0.1:8545
, and chainId 31337
.
I got error Could not fetch chain ID. Is your RPC URL correct?
when trying to create an additional network at metamask.
@aeither : Use http://0.0.0.0:8545
(instead of http://127.0.0.1:8545
) as the RPC URL and try again
@aeither : Use
http://0.0.0.0:8545
(instead ofhttp://127.0.0.1:8545
) as the RPC URL and try again
That still don't work for me ..
Can we please fix this created unnecessary friction for developers!
Is there any progress on this issue??
Alright, we're gonna try to do something about this. I can't talk about dates or specifics yet, but hopefully in an upcoming sprint. Our hope is to effectively restore the chain ID behavior for localhost
networks (and only localhost
networks) to what it was prior to 8.1.0
.
By way of context, the change that implemented the current behavior was introduced in version 8.1.0
of the extension, in order to resolve the security vulnerability referenced here: https://github.com/MetaMask/metamask-extension/issues/9827#issuecomment-767098953
Thank you for your patience and consistent feedback on this issue. We will let you know when we have more information to share, or simply close this issue when we've merged a fix.
We are waiting metamask?
Any progress?
@eniolasonowo @codingwithdidem please don't do that. We all want this to happen, but these things take time. Erik didn't mention dates for a reason. Just be patient.
Would love a fix for this!
@eniolasonowo @codingwithdidem please don't do that. We all want this to happen, but these things take time. Erik didn't mention dates for a reason. Just be patient.
It's probably because of Hardhat's documentation: "Please voice your support for MetaMask to fix this [...]"
@loziniak in the context of GitHub issues that means upvoting an issue to help maintainers figure out how important it is. But you're right that it could be misleading, I'll update it.
MetaMask! fix this
updates ?
Any updates??
Still suffering with this.
Any progress on this? indeed, annoying
Any updates?
cmon guys, do something
Hey guys! I have found a solution, you must pass directly the chainId:1337
inside the hardhat.config.js
file. I have tried it and it worked for me, it stopped sending me the chainId error. I hope it works for you.
e.g
require("@nomicfoundation/hardhat-toolbox");
// The next line is part of the sample project, you don't need it in your
// project. It imports a Hardhat task definition, that can be used for
// testing the frontend.
require("./tasks/faucet");
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.9",
networks: {
hardhat: {
chainId: 1337 // We set 1337 to make interacting with MetaMask simpler
}
}
};
@aeither : Use
http://0.0.0.0:8545
(instead ofhttp://127.0.0.1:8545
) as the RPC URL and try againThat still don't work for me ..
it worked for me
Hi all
Is there a solution to this issue? I'm having the same problem with my script.
Have to mention that my ABI is reached correctly, My contract has been deployed successfully and its address is correctly entered in my script. The only assumption I can make is that the Metamask extension cannot connect properly to the network that I have deployed my project on by running "npx hardhat run scripts/deploy.js" which deploys the project to the hardhat localhost.
Unhandled Runtime Error
Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="fetchMarketItems()", data="0x", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.7.0)
Guys, this thing is not working from my end. I already tried all the options here, it keep throwing back the same error. Could I be doing something wrong?
It is all the same..... I even changed the chainId to 1337 in the config.js file, it is all the same
@Justice-Orogun review my comment
@Justice-Orogun use 31337 in your MetaMask ChainID
@Justice-Orogun review my comment I just checked.... I am still having the same issue... Didn't work out....
@luislucena16 The same issue bro.... I did that before changing the ChainId to 1337.
@Justice-Orogun This is how I have mine and it works fine..
@luislucena16 lemme check this out if it works from my end. Thanks for the feedback
@luislucena16 this is what I have on my end.... However, lemme check out your method.
@luislucena16 The same error bro.....
@Justice-Orogun I don't understand why the error is still occurring. It works fine for me
@Justice-Orogun Are you running the npx hardhat node
command? Before importing the localhost?
@luislucena16 I already run the npx hardhat node command
@Justice-Orogun Now try adding the localhost network
@luislucena16 The same error..... I just did everything again from scratch....
Same error, please fix this. This is unbelievable.
@hernandp I feel this has to do with Metamask and hardhat... I am very sure there are errors somewhere around it....
same error
i got working
@Justice-Orogun i am using same version as you but when i switched to 0.8.16 it start working fine
that issue get solved before as I know the 31337 error and save button are not visible all things are get solved before doing all these things run "npx hardhat node" command in your terminal and all is done
I want my localhost HARDHAT network to be added by calling wallet_addEthereumChain, when I am passing the chainId inside params of 31337 the calling that the function on the UI,the chainId it is showing me of 201527. The Error is: OnMETAMASK: Chain ID returned by the custom network does not match the submitted chain ID. and On Console: inpage.js:1 MetaMask - RPC Error: Unrecognized chain ID "0x31337". Try adding the chain using wallet_addEthereumChain first. {code: -32603, message: 'Unrecognized chain ID "0x31337". Try adding the chain using wallet_addEthereumChain first.', data: {…}}
@hammad-ali18 try this: https://github.com/MetaMask/metamask-extension/issues/10290#issuecomment-1329960809 configure your UI to receive the chainID you set up
hi all, they these steps -
With the manual configurations described in previous comments it is possible to address the problem, but it would be great if MetaMask could fix this for immediate operation with Hardahat.
does the above solutions work for sepolia too?
I'm opening this issue as suggested by @rekmarks: https://github.com/MetaMask/metamask-extension/issues/9827#issuecomment-767098953
MetaMask comes with a
localhost:8545
network, typically used for development. This network used to work fine both with ganache and with hardhat, but now MetaMask checks that the connected network has 1337 as its chainId. Since Hardhat uses 31337 as its chainId, users get an EIP-155 error when trying to use MetaMask.The solution is to manually change the project's configuration so that 1337 is used as chainId. This causes unnecessary friction.
I don't know what the correct solution would be here. I think users starting a node on their localhost are knowledgeable enough, and so accepting the chain id returned by the node seems fine in that scenario (unlike manually added networks, where users could be adding by following malicious instructions). But any approach that makes MetaMask work out of the box with Hardhat would be great.