You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Script that cause error:
`const Web3 = require("web3");
const web3 = new Web3(new Web3.providers.HttpProvider("https://rpc.testnet.mantle.xyz"));
var fs = require('fs');
const { sleep } = require('./sleep.helper.js');
const { getEstimateGas } = require("./estimateGas.helper.js");
require('dotenv').config();
var contract_address = process.env.CONTRACT_ADDRESS;
var contract_jsonFile = "./fan_card_abi.json";
var contract_parsed = JSON.parse(fs.readFileSync(contract_jsonFile));
var contract_abi = contract_parsed.abi;
var contract_router = new web3.eth.Contract(contract_abi, web3.utils.toChecksumAddress(contract_address));
Error looks like: Error estimating gas: Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="execution reverted: Invalid signature", method="estimateGas", transaction={"to":"0xF0681C0ae6eA87dbF8D7D2fe56d81D05C7f4eCa6","data":"0x52c253c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000419c745e4f1316fea37908c08e2f77c5efff909c4eddca4164138519fc619cfea06e6214eb8215ad583d1d7ca1db0cb732d8c2238a21e2875869c2e81bcef064661c00000000000000000000000000000000000000000000000000000000000000","accessList":null}, error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"error\":{\"code\":3,\"message\":\"execution reverted: Invalid signature\",\"data\":\"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000011496e76616c6964207369676e6174757265000000000000000000000000000000\"},\"id\":52}\n","error":{"code":3,"data":"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000011496e76616c6964207369676e6174757265000000000000000000000000000000"},"requestBody":"{\"method\":\"eth_estimateGas\",\"params\":[{\"to\":\"0xf0681c0ae6ea87dbf8d7d2fe56d81d05c7f4eca6\",\"data\":\"0x52c253c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000419c745e4f1316fea37908c08e2f77c5efff909c4eddca4164138519fc619cfea06e6214eb8215ad583d1d7ca1db0cb732d8c2238a21e2875869c2e81bcef064661c00000000000000000000000000000000000000000000000000000000000000\"}],\"id\":52,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"https://rpc.testnet.mantle.xyz"}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.7.2) at Logger.makeError (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/logger/lib/index.js:238:21) at Logger.throwError (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/logger/lib/index.js:247:20) at checkError (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:122:20) at JsonRpcProvider.<anonymous> (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:751:47) at step (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23) at Object.throw (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53) at rejected (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { reason: 'execution reverted: Invalid signature', code: 'UNPREDICTABLE_GAS_LIMIT', method: 'estimateGas', transaction: { to: '0xF0681C0ae6eA87dbF8D7D2fe56d81D05C7f4eCa6', data: '0x52c253c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000419c745e4f1316fea37908c08e2f77c5efff909c4eddca4164138519fc619cfea06e6214eb8215ad583d1d7ca1db0cb732d8c2238a21e2875869c2e81bcef064661c00000000000000000000000000000000000000000000000000000000000000', accessList: null }, error: Error: processing response error (body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":3,\"message\":\"execution reverted: Invalid signature\",\"data\":\"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000011496e76616c6964207369676e6174757265000000000000000000000000000000\"},\"id\":52}\n", error={"code":3,"data":"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000011496e76616c6964207369676e6174757265000000000000000000000000000000"}, requestBody="{\"method\":\"eth_estimateGas\",\"params\":[{\"to\":\"0xf0681c0ae6ea87dbf8d7d2fe56d81d05c7f4eca6\",\"data\":\"0x52c253c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000419c745e4f1316fea37908c08e2f77c5efff909c4eddca4164138519fc619cfea06e6214eb8215ad583d1d7ca1db0cb732d8c2238a21e2875869c2e81bcef064661c00000000000000000000000000000000000000000000000000000000000000\"}],\"id\":52,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="https://rpc.testnet.mantle.xyz", code=SERVER_ERROR, version=web/5.7.1) at Logger.makeError (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/logger/lib/index.js:238:21) at Logger.throwError (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/logger/lib/index.js:247:20) at /Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/web/lib/index.js:313:32 at step (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/web/lib/index.js:33:23) at Object.next (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/web/lib/index.js:14:53) at fulfilled (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/web/lib/index.js:5:58) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { reason: 'processing response error', code: 'SERVER_ERROR', body: '{"jsonrpc":"2.0","error":{"code":3,"message":"execution reverted: Invalid signature","data":"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000011496e76616c6964207369676e6174757265000000000000000000000000000000"},"id":52}\n',
You can use publickey: 0xdEc3262D5EADbbD946AdbB48a2A07ABe15B0AB83 and singature: 0x9c745e4f1316fea37908c08e2f77c5efff909c4eddca4164138519fc619cfea06e6214eb8215ad583d1d7ca1db0cb732d8c2238a21e2875869c2e81bcef064661c when reproduce the error.
I guess probably something wrong with the singature or the mintNFT method in their contract!
The text was updated successfully, but these errors were encountered:
Followed the gas estimation tutorial here: https://docs.mantle.xyz/network/for-devs/tutorials/estimating-transaction-fees
Warpped the gas estimation into:
`
const ethers = require("ethers")
const mantleSDK = require("@mantleio/sdk");
module.exports.getEstimateGas = async (tx) => {
const l2RpcProvider = new ethers.providers.JsonRpcProvider("https://rpc.testnet.mantle.xyz")
try{
// By calling the BVM_GasPriceOracle contract method l1basefee()
const gasPrice = await mantleSDK.getL1GasPrice(l2RpcProvider);
const decimals = await mantleSDK.decimals(l2RpcProvider);
const scalar = await mantleSDK.scalar(l2RpcProvider);
const gasUsed = await mantleSDK.overhead(l2RpcProvider);
// L1RollupFee
const l1RollupFee = gasPrice.mul(gasUsed).mul(scalar).div(10**decimals)
}
`
If using a fake tx, the getEstimateGas function can be successfully invoked:
`const { getEstimateGas } = require('./gas_helper');
const ethers = require("ethers")
const tx = {
to: "0xdEc3262D5EADbbD946AdbB48a2A07ABe15B0AB83",
value: ethers.utils.parseEther("0.01"),
};
(async () => {
try {
const result = await getEstimateGas(tx);
console.log('Gas Estimate:', result);
} catch (error) {
console.error('Error:', error);
}
})();
Output:
Total estimated Gas Fee: 1050780143553Gas Estimate: {
success: true,
estimatedGas: BigNumber { _hex: '0xf4a7608fc1', _isBigNumber: true }
}`.
But when user call a specific contract method (mint NFT), the getEstimateGas will meet error:
Cotract address: https://explorer.testnet.mantle.xyz/address/0xF0681C0ae6eA87dbF8D7D2fe56d81D05C7f4eCa6/contracts#address-tabs
Script that cause error:
`const Web3 = require("web3");
const web3 = new Web3(new Web3.providers.HttpProvider("https://rpc.testnet.mantle.xyz"));
var fs = require('fs');
const { sleep } = require('./sleep.helper.js');
const { getEstimateGas } = require("./estimateGas.helper.js");
require('dotenv').config();
var contract_address = process.env.CONTRACT_ADDRESS;
var contract_jsonFile = "./fan_card_abi.json";
var contract_parsed = JSON.parse(fs.readFileSync(contract_jsonFile));
var contract_abi = contract_parsed.abi;
var contract_router = new web3.eth.Contract(contract_abi, web3.utils.toChecksumAddress(contract_address));
const walletGeneration = async () => {
}
walletGeneration();`
Error looks like:
Error estimating gas: Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="execution reverted: Invalid signature", method="estimateGas", transaction={"to":"0xF0681C0ae6eA87dbF8D7D2fe56d81D05C7f4eCa6","data":"0x52c253c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000419c745e4f1316fea37908c08e2f77c5efff909c4eddca4164138519fc619cfea06e6214eb8215ad583d1d7ca1db0cb732d8c2238a21e2875869c2e81bcef064661c00000000000000000000000000000000000000000000000000000000000000","accessList":null}, error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"error\":{\"code\":3,\"message\":\"execution reverted: Invalid signature\",\"data\":\"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000011496e76616c6964207369676e6174757265000000000000000000000000000000\"},\"id\":52}\n","error":{"code":3,"data":"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000011496e76616c6964207369676e6174757265000000000000000000000000000000"},"requestBody":"{\"method\":\"eth_estimateGas\",\"params\":[{\"to\":\"0xf0681c0ae6ea87dbf8d7d2fe56d81d05c7f4eca6\",\"data\":\"0x52c253c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000419c745e4f1316fea37908c08e2f77c5efff909c4eddca4164138519fc619cfea06e6214eb8215ad583d1d7ca1db0cb732d8c2238a21e2875869c2e81bcef064661c00000000000000000000000000000000000000000000000000000000000000\"}],\"id\":52,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"https://rpc.testnet.mantle.xyz"}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.7.2) at Logger.makeError (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/logger/lib/index.js:238:21) at Logger.throwError (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/logger/lib/index.js:247:20) at checkError (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:122:20) at JsonRpcProvider.<anonymous> (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:751:47) at step (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23) at Object.throw (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53) at rejected (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { reason: 'execution reverted: Invalid signature', code: 'UNPREDICTABLE_GAS_LIMIT', method: 'estimateGas', transaction: { to: '0xF0681C0ae6eA87dbF8D7D2fe56d81D05C7f4eCa6', data: '0x52c253c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000419c745e4f1316fea37908c08e2f77c5efff909c4eddca4164138519fc619cfea06e6214eb8215ad583d1d7ca1db0cb732d8c2238a21e2875869c2e81bcef064661c00000000000000000000000000000000000000000000000000000000000000', accessList: null }, error: Error: processing response error (body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":3,\"message\":\"execution reverted: Invalid signature\",\"data\":\"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000011496e76616c6964207369676e6174757265000000000000000000000000000000\"},\"id\":52}\n", error={"code":3,"data":"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000011496e76616c6964207369676e6174757265000000000000000000000000000000"}, requestBody="{\"method\":\"eth_estimateGas\",\"params\":[{\"to\":\"0xf0681c0ae6ea87dbf8d7d2fe56d81d05c7f4eca6\",\"data\":\"0x52c253c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000419c745e4f1316fea37908c08e2f77c5efff909c4eddca4164138519fc619cfea06e6214eb8215ad583d1d7ca1db0cb732d8c2238a21e2875869c2e81bcef064661c00000000000000000000000000000000000000000000000000000000000000\"}],\"id\":52,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="https://rpc.testnet.mantle.xyz", code=SERVER_ERROR, version=web/5.7.1) at Logger.makeError (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/logger/lib/index.js:238:21) at Logger.throwError (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/logger/lib/index.js:247:20) at /Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/web/lib/index.js:313:32 at step (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/web/lib/index.js:33:23) at Object.next (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/web/lib/index.js:14:53) at fulfilled (/Users/boreaswu/Desktop/Crypto/FT_alpha/Axelar_bridge/node_modules/@ethersproject/web/lib/index.js:5:58) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { reason: 'processing response error', code: 'SERVER_ERROR', body: '{"jsonrpc":"2.0","error":{"code":3,"message":"execution reverted: Invalid signature","data":"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000011496e76616c6964207369676e6174757265000000000000000000000000000000"},"id":52}\n',
You can use publickey:
0xdEc3262D5EADbbD946AdbB48a2A07ABe15B0AB83
and singature:0x9c745e4f1316fea37908c08e2f77c5efff909c4eddca4164138519fc619cfea06e6214eb8215ad583d1d7ca1db0cb732d8c2238a21e2875869c2e81bcef064661c
when reproduce the error.I guess probably something wrong with the singature or the mintNFT method in their contract!
The text was updated successfully, but these errors were encountered: