About the initial estimate of gas prices

I would like to transfer my token using Moralis.
However, on the confirmation screen, it says ā€œProcessing time is unknownā€, indicating that my gas fee is low.

If I manually set my gas fee higher, I can transfer the money. However, it is not user friendly.
I want to set the default value of the gas price to standard because my site keeps confirming it.

By the way, this was not the case a few weeks ago.

Iā€™ll write the source Iā€™m using for your reference.

ā‘ 
const options = {
type: ā€œnativeā€,
amount: Moralis.Units.ETH(this.sendFee),
receiver: 0xhoge,
};
await Moralis.transfer(options);

ā‘”
let txOptions = {
type: ā€œerc1155ā€,
receiver: address,
contractAddress: this.contractAddress,
tokenId: this.tokenId,
amount: 1,
};
await Moralis.transfer(txOptions);

I think that initial gas estimation will be done by metamask and not by moralis (even though it says site suggested there in metamask), and metamsk will query a node for that gas estimation

what version of Moralis SDK are you using now? with what version it was working fine?

Hmmm. Is it really so?

I tried to transfer the token using a method other than Moralis.
When I replaced the code in ā‘  with ā€œethersā€ and transferred the data, the gas estimated correctly and no warning message was displayed.

The version of the Moralis SDK is 0.0.135. It has not changed since the previous success.

that shouldnā€™t be a problem for Moralis SDK then, maybe you changed the RPC node in metamask recently

Indeed, I recently changed my PC and installed a new wallet.

But I tried all the RPC URLs with reference to Polygonā€™s site, but no improvement.

did you try the RPC from moralis speedy node?

Yes.

After upgrading Moralis, the problem was solved.

To isolate the problem, I created a new project and installed Moralis.
After that, I performed a token transfer, and the problem stopped occurring, so I was able to isolate the cause of the problem.

The version was 1.2.0 when I solved the problem.

strange, you say that if you use now an older version of the SDK you can replicate that problem?

Yes.

You can check it on my site.
On my site, there is a donation form.
Iā€™d like you to make a donation there.
(Of course, you donā€™t need to actually send money, you just need to see the confirmation screen.)

ā– Success(Ver1.2.0)

ā– Fail(Ver0.0.135)

The only difference in the source code of the projects is the version of Moralis.

(I recently changed the domain of my site, but the problem occurred in my local environment, so it should not be a problem.)

I tested with BSC and it seems to work fine on both websites

Iā€™m sorry. I did not specify the chain.
It is happening with Polygon.

It looks like I donā€™t have enough matic to test on polygon now, it will be expected to fail the gas estimation if I donā€™t have enough matic in the account

I have same problem on Polygon.


Dont know how to set the default value of the gas price to standard via site. If i set gas price manually, it works good.

can you try with different RPC addresses in metamask for polygon?

yep, now it work normally for my metamask but other users can face with same problem. Is the way to set gas fees via site?

you may be able to do it directly with web3, executeFunction doesnā€™t have that parameter

Cannot estimate gas; transaction may fail or may require gas limit

This error message means that MetaMask cannot estimate the fee for that particular transaction. You can read more about that in Cannot estimate gas metamask article. but maybe needs to another source.