-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Description
Describe the bug
This is a duplicate of #20699 , as that one has been open for a week and is yet to receive any acknowledgment from the maintainers. And I am wondering if starting three exact same issues in a row, as some people are doing here, is the right answer to that.
MetaMask incorrectly estimates gas settings on BSC when no gas price is explicitly supplied by the website.
Likely the bug is only specific to BSC, though I haven't tried reproducing it on other chains.
Steps to reproduce
- Initiate transaction with a contract on BSC using web3.js without explicitly supplying any gas settings, like so:
contract.methods.function(args).send({ from: address }); - Review gas settings automatically picked by Metamask, and observe that they are falsely reported as "suggested by site", while also being too low for the tx to go through
- Send transaction. It will fail with "transaction undepriced" error
- Now, to avoid this bug one must manually supply gasPrice, for example:
contract.methods.function(args).send({ from: address, gasPrice: '3000000000' }); - Review gas settings again. Same contract, same function, same arguments. Same report from Metamask, that gas settings are supplied by the site. But this time it is true, and those gas settings are adequate
- Send transaction. Transaction succeeds
Error messages or log output
MetaMask - RPC Error: [ethjs-query] while formatting outputs from RPC '{"value":
{"code":-32603,
"data":{
"code":-32000,
"message":"transaction underpriced"
}}}'Version
10.34.3
Build type
None
Browser
Chrome, Firefox
Operating system
Windows, Linux
Hardware wallet
No response
Additional context
web3.js version 1.6.1
RPC in use: https://bsc-dataseed2.binance.org:443 on website; https://bsc-dataseed1.binance.org:443 in wallet. Likely the same behavior is present on others, but I tested with these.
Same behavior is observed with payable and non-payable contract functions. Behavior only first appeared about 3-5 days back. So far every user who reported this behavior is a Metamask user.
No changes were made to the website codebase recently(for many weeks). So the bug is being caused either by updates in Metamask or in BSC nodes.



