"out of gas" when reading contract method #1682
-
Hey, I am quite new in this space and running into a const ethersProvider = ethers.getDefaultProvider();
const contract = new ethers.Contract(
'0x90e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f5',
curveRegistryABI,
ethersProvider
);
const result = await contract.get_virtual_price_from_lp_token(
'0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490'
); I created a runnable version of the code on StackBlitz here: Unfortunately, the call fails to meet the quorum with the following results: [
{
"weight":1,
"start":1623831102192,
"error":{
"reason":"processing response error",
"code":"SERVER_ERROR",
"body":"{\"jsonrpc\":\"2.0\",\"id\":42,\"error\":{\"code\":-32000,\"message\":\"out of gas\"}}",
"error":{
"code":-32000
},
"requestBody":"{\"method\":\"eth_call\",\"params\":[{\"gas\":\"0x60b8\",\"to\":\"0x90e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f5\",\"data\":\"0xc5b7074a0000000000000000000000002fe94ea3d5d4a175184081439753de15aef9d614\"},\"latest\"],\"id\":42,\"jsonrpc\":\"2.0\"}",
"requestMethod":"POST",
"url":"https://mainnet.infura.io/v3/84842078b09946638c03157f83405213"
}
},
{
"weight":1,
"start":1623831102192,
"error":{
"reason":"processing response error",
"code":"SERVER_ERROR",
"body":"{\"jsonrpc\": \"2.0\", \"id\": 43, \"error\": {\"code\": -32000, \"message\": \"out of gas\"}}",
"error":{
"code":-32000
},
"requestBody":"{\"method\":\"eth_call\",\"params\":[{\"gas\":\"0x60b8\",\"to\":\"0x90e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f5\",\"data\":\"0xc5b7074a0000000000000000000000002fe94ea3d5d4a175184081439753de15aef9d614\"},\"latest\"],\"id\":43,\"jsonrpc\":\"2.0\"}",
"requestMethod":"POST",
"url":"https://eth-mainnet.alchemyapi.io/v2/_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"
}
},
{
"weight":1,
"start":1623831104192,
"error":{
"reason":"processing response error",
"code":"SERVER_ERROR",
"body":"{\"jsonrpc\":\"2.0\",\"id\":43,\"error\":{\"code\":-32000,\"message\":\"out of gas\"}}",
"error":{
"code":-32000
},
"requestBody":"{\"method\":\"eth_call\",\"params\":[{\"gas\":\"0x60b8\",\"to\":\"0x90e00ace148ca3b23ac1bc8c240c2a7dd9c2d7f5\",\"data\":\"0xc5b7074a0000000000000000000000002fe94ea3d5d4a175184081439753de15aef9d614\"},\"latest\"],\"id\":43,\"jsonrpc\":\"2.0\"}",
"requestMethod":"POST",
"url":"https://cloudflare-eth.com/"
}
},
{
"weight":1,
"start":1623831104192,
"result":"0x0000000000000000000000000000000000000000000000000dea6b5f8bba8495"
}
] I am sure there is a simple explanation for the behaviour, but I havent found a solution beside setting an explicit Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Such error is also observed when the method doesn't exist on the contract. Can you verify if the address you're using is correct and it contains the method? |
Beta Was this translation helpful? Give feedback.
Such error is also observed when the method doesn't exist on the contract. Can you verify if the address you're using is correct and it contains the method?