BLOG
ブログ
BLOG
Metamask: Hardhat chainID 31337 not changed to 1337 of Metamask localhost
Here is a possible article:
Problem of identification of the Metamask chain on Hardhat
I recently endangered a problem when setting up my Metamask I Hardhat portfolio, an Ethereum Popular development environment. More specifically, I was trying to take off Chainid: 1337 'instantly of the" 31337 "planned.
The problem:
My Hardhat.config.js daughter had already included the following configuration:
Javaccrot
Export module = {
Solidity: "0.8.17",
Networks: {
Localhost: {
Host: "Localhost",
Port: 8545,
Chainid: 1337
}
},
// ... all configurations
};
'
The solution:
While you turn, the problem is to have a "chainid" currency in the Hardhat configuration. More specifically, I included31337 ‘instantaneous 1337’.
To solve this problem, I simply reduced my Hardhat.config.js net to its original content:
`Javaccrot
Export module = {
Solidity: "0.8.17",
Networks: {
Localhost: {
Host: "Localhost",
Port: 8545,
Chainid: 1337
}
},
// ... all configurations
};
'
What was wrong?
In the inflection to ESE31337 ‘as” Chainid “, I was instantly imported to imports. It is the “chainid” currency.
Prevention and solutions:
Too much more than future, it is essential to:
- Carefully examine your Hardhat.config.js net and insured.
- Check that you edit the channel ID currency planned for Metamask.
- Library or configuration tool that can “Chainid” value from Metamask.
By storing these precautions, you will make sure to configure your hard environment with a correct “chainid” currency and avoid