I am trying to set the gas price on a contract call using useWeb3ExecuteFunction (react moralis). On polygon testnet transactions fail with default settings as polygon apperently raised min to 30 gwai to reduce spam.
In ethers.js you can set an override option on a contract call
https://github.com/ethers-io/ethers.js/issues/40
useWeb3Executefunction calls Moralis.executeFunction() which has an overrides function parameter
I tried adding gasPrice and gaslimit into the overrides but it doesn’t seem to be doing anything.
const {
data: approveData,
fetch: approve,
error,
} = useWeb3ExecuteFunction(
{
chain: "mumbai",
contractAddress: tokenAddr,
abi: ABI,
functionName: "approve",
params: {
_spender: contractAddr,
_value: Moralis.Units.Token(5, "18"),
},
overrides: {
gasPrice: 3000000000,
gasLimit: 300000000,
},
},
{}
);