I have the following vyper code:
address_to_addresses: public(HashMap[address, address[2])
Vyper auto generates a view
function called address_to_addresses(arg0: address, arg1: uint256) -> address
that allows you to read the value of the public variable.
The abi for this function looks like this:
"name": "address_to_addresses",
"outputs": [
{
"type": "address",
"name": ""
}
],
"inputs": [
{
"type": "address",
"name": "arg0"
},
{
"type": "uint256",
"name": "arg1"
}
],
"stateMutability": "view",
"constant": true
But when I execute the following using ethersJS:
myContract.address_to_addresses(<someAddress>, 0)
I get a transaction revert error that says I have run out of gas:
Error: VM Exception while processing transaction: out of gas
How is it possible that I can be running out of gas when I am calling a view
function? How can I call this function without "running out of gas"?
addresss_to_addresses
(triple s), but you're callingaddress_to_addresses
(only 2 s). Is that a typo in your question, or is that the problem?