Open syedsimanta03 opened 2 years ago
How I fixed the gas issue and stability was:
const tx = { to: config.contractAddress, from: window.ethereum.selectedAddress, gas: web3.utils.toHex('150000'), gasLimit: web3.utils.toHex(await web3.eth.getBlock("latest")), value: parseInt( web3.utils.toWei(String(config.price * mintAmount), 'ether') ).toString(16), // hex data: nftContract.methods.publicSaleMint(mintAmount).encodeABI(), nonce: nonce.toString(16)
@PykeAnon where did you put this?
Even if you remove
gas: '30000', maxPriorityFeePerGas: '1000000108',
You get this err
METAMASK: This transaction is expected to fail. Trying to execute it is expected to be expensive but fail, and is not recommended.