0

For some reason Web3.js cannot estimate gas correctly on Sepolia

I have pulled in the Web3.js library via CDN

<script src="https://cdn.jsdelivr.net/npm/[email protected]/web3.min.js"></script>

From my front end I am invoking a contract function via Metamask

transactionReceipt = await tokenFactoryContract.methods.deployMinterPauserToken("name", "symbol", "1", "1", "1")
.send({
   from: selectedAccount,
   value: web3.utils.toWei("0.2", "ether"),
});

When Metamask pops up is says

🌐
Site suggested
Gas (estimated) $0.00
0 Sepolia ETH
Unknown processing time
Max fee: 0 SepoliaETH

I intentionally left out the gas price from the contract invocation, so why is it failing to estimate the gas properly? I am also surprised that is says Site suggested when the site is definitely NOT suggesting a gas price.

[Update]

When I deploy the contract on Polygon, Metamask is able to accurately infer the gas price using the same Web3.js and contract invocation code.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.