[SOLVED] In token transfer how to control gas fee suggested by site

Hi. first time here. I’m a portuguese fellow and a self taught programmer mainly in php & js. Loving Moralis, realy great tool and helping me a lot. At the moment I’m trying to create an webapp where my client can pay the service with crypto (token transfer). All working ok with moralis api, except the gas fee, is always to expensive. For example, for a transfer equivalent to 100$ in BNB, the gas that appears to me in MetaMask is always around 0.45BNB. It also says that the gas fee was suggested by the site (webapp) that generated the transfer demand. When I edit the gas feed in MetaMask it says that the limit to use is 95000000,… but normaly should be 21000… right? Is that any way I can amend/control this using code? tks

that huge gas fee may be the result of calling a gas estimation function, and it may not be from the application and I think that it is from MetaMask directly after metamask made a request for gas estimation to a node.

what it can happen is that the eth node is not able to estimate the gas cost for that transaction (maybe the contract function fails, or the address that want to make the transfer doesn’t have enough funds) and it shows a huge gas cost.

what transaction in particular are you trying to do? are you trying to do it from an address that has those funds already?

yes, to do a transaction of sending BNB, it should be only 21000 gas

1 Like

The insufficient funds were the problem. Thank you very much.