Hi,
I tried to use Moralis Execute Function for the safeMint function on Node and it works well on the testnet. However, when I tried this on mainnet, I get the fee too low error like this.
reveal error Error: replacement fee too low [ See: https://links.ethers.org/v5-errors-REPLACEMENT_UNDERPRICED ] (error={}, method=“sendTransaction”, transaction=“0x02f9013481898201258459682f0085010e2b8efa8302e3f4940b3d04893c1bb2e8a1a53e094a73251c8ea4900680b8c4d204c45e00000000000000000000000098124d18de46667b49e2dbabbdec85ec1b9b3f090000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000005068747470733a2f2f697066732e6d6f72616c69732e696f3a323035332f697066732f516d6173543463635761797246594479753573766d3853364d45567442756658644c47483845396b434a484c7a4600000000000000000000000000000000c001a0ececda5cfe8605b199622a9bfd92665829c784fd19efa01a25a6218649a1dca7a063a40d4b46a8c05564bed9e5fb885dd6795ce5f200ffa5c82946f0aaca148b64”, code=REPLACEMENT_UNDERPRICED, version=providers/5.6.0)
Is there a way to fix this?
My code is below:
await Moralis.start({serverUrl:config.serverUrl,appId:config.appId,moralisSecret:config.moralisSecret});
await Moralis.enableWeb3({
chainId: config.chainId,
privateKey: config.pkWeapon,
});
let options = {
contractAddress: config.contractAddressWeapon,
functionName: "safeMint",
abi: config.abiSafeMintWeapon,
params: {
to: w_address, //user contract address
uri: js,
},
}
let result=await Moralis.executeFunction(options);
console.log(result);
let wait=await result.wait();
console.log(wait);
let e_i=wait.events.findIndex((a)=>{return a.event=='mintComplete'});
let token_id = parseInt(wait.events[e_i].args[0]._hex);