2

The network is very busy right now, resulting in higher gas prices. If you use a gas price that is too low, your transaction will take a lot longer to confirm. I recommend that you use ETH Gas Station to see what gas price you should use. You can read more about gas in general here: https://support.mycrypto.com/general-knowledge/ethereum-blockchain/what-is-...


2

This is a bug introduced in the v8 version of Metamask, related to the "accountsChanged" event. They have fixed this error and it should be resolved in the next release. Here is the link to the closed issue on their github : https://github.com/MetaMask/metamask-extension/issues/9013 .


2

You will need to prompt the users to change their network via MetaMask. Assuming web3 is an initialised instance of the Web3 library with a provider: import Web3 from "web3"; const FALLBACK_WEB3_PROVIDER = process.env.REACT_APP_NETWORK || 'http://0.0.0.0:8545'; const getWeb3 = () => { return new Promise((resolve, reject) => { // ...


1

I ended up moving to a testnet to solve this, but the general consensus seems to be that this is caused by the nonce getting messed up by stopping and restarting dev chains. The fix is to reset the tx history in MetaMask. This can be done by going to settings (you can find that menu by clicking on the generated circle art thing for your account in the upper ...


1

Value should be in hex format. Note: in some updated MetaMask installation, it seems the injected web3 has not the utils package anymore, so you may need to use web3.toWei instead. const myParameters = { from: "0x5c0bC92f7d26F7AD821408e2B1774FC96858C691", to: "0x6cC5550509CC3a66Df97Efa42B866A058e12ADE2", value: parseInt(web3....


1

You can check the current network chain ID like this: console.log(window.ethereum.networkVersion, 'window.ethereum.networkVersion'); And these are the chain IDs for the most used ethereum networks: Mainnet: 1 Kovan: 42 Ropsten: 3 Rinkeby: 4 Goerli: 5


1

Notice that new API is available: // Legacy dapp browsers... if (window.web3 !== undefined) { const provider = new Web3.providers.HttpProvider(window.web3.currentProvider); const web3 = new Web3(provider); } // Modern dapp browsers... if (window.ethereum !== undefined) { const provider = new Web3.providers.HttpProvider(window.ethereum); const ...


1

Use accountsChanged event: /** * Listening for MetaMask address changes. * @param {Function} callback Resolve when address is changed */ function onAccountsChanged(callback) { ethereum.on('accountsChanged', (accounts) => { // Time to reload your interface with accounts[0] console.log(accounts); callback(null, ...


Only top voted, non community-wiki answers of a minimum length are eligible