current position:Home>"Metamask RPC error with payload" occurs after deployment to the ropsten test chain, resulting in contract interaction failure

"Metamask RPC error with payload" occurs after deployment to the ropsten test chain, resulting in contract interaction failure

2022-02-03 20:56:00 Q & A of Denglian community

Dapp For local testing Ganache-cli Be able to interact normally ,truffle migrate --network ropsten Deploy to ropsten Contract interaction appears after (transact) Failed all the time , The test has checked Metamask Connected to the Internet chainID and url They all match .

 edition :truffle 5.15, soildity 0.5.16  npm 6.14.3

The code is as follows :

const dotenv=require('dotenv');const result=dotenv.config();if (result.error){  throw result.error;}console.log(result.parsed);var NonceTrackerSubprovider = require("web3-provider-engine/subproviders/nonce-tracker");var HDWalletProvider = require("truffle-hdwallet-provider");var infura_apikey=myprojectID;var mnemonic_ropsten=process.env.mnemonic_ropsten;// Stored in .env In file module.exports = {   networks: {     development: {// Local testing        host: "127.0.0.1",       port: 7545,       network_id: "*", // Match any network        gas : 3000000000     },    ropsten:{      provider :new HDWalletProvider(mnemonic_ropsten,"https://ropsten.infura.io/v3/"+myprojectID),      network_id: 3,      gas: 7003605,      gasPrice: 100000000000,      networkCheckTimeout: 600000    }  }};



Take the answer 1:

and infura.io This error is sometimes caused by poor node communication . It usually appears when reading the returned data .

It should not affect the initiating transaction .




copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032055581018.html

Random recommended