codingwithdidem / boredape-minting-dapp

A course related project showcasing how to create a nft minting dapp.
boredape-minting-dapp.vercel.app
77 stars 80 forks source link

GassLimit issue #2

Open syedsimanta03 opened 2 years ago

syedsimanta03 commented 2 years ago

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.

PykeAnon commented 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)

Judd515 commented 2 years ago

@PykeAnon where did you put this?