ethernaut
ethernaut copied to clipboard
Cannot interact with contract... `Error in RPC response:,err: max fee per gas less than block base fee`
@ https://ethernaut.openzeppelin.com/level/0x4E73b858fD5D7A5fc1c3455061dE52a53F35d966
input:
await ethernaut.owner()
output:
MetaMask - RPC Error: err: max fee per gas less than block base fee: address 0xCA6b8EaB76F76B458b1c43c0C5f500b33f63F475, maxFeePerGas: 20000000 baseFee: 29766651531 (supplied gas 1010499) be0fc955ecd3144351755cc846b52f82df0b3c0a.js:1 Error in RPC response:,err: max fee per gas less than block base fee: address
, maxFeePerGas: 20000000 baseFee: 18680531271 (supplied gas 2000000)
:/
I'm more familiar with ethers, but trying to dig into this and looking into truffle https://www.trufflesuite.com/docs/truffle/getting-started/interacting-with-your-contracts
I'd guess that I could do something like this:
ethernaut.owner.estimateGas()
but that gets same error...
Shouldn't this be a gasless static call anyways...? What's going on here?
It looks from the same page like I should even be able to force it to be a gas-free call, like this:
ethernaut.owner.call()
same error...
I have zero clue why this is working, but I'm able to get an address back by running this:
await ethernaut.contract.methods.owner.call().call()
> '0x09902A56d04a9446601a0d451E07459dC5aF0820'
that's quite a mess, but I'll run with it for now.
fwiw:
this was me following the opening instructions in order, to play with the ethernaut contract a bit before moving on. It didn't work, had to use the workaround above, but it turned out to be relatively irrelevant--I'd just change the instructions to prevent someone else falling down this rabbit hole--as the rest of the course worked fine.
I appreciate you posting this because I ran into the same issue today.
I ran into this today.
I think specifying gas price like this is helping await ethernaut.owner({ gasPrice:0 })
This issue is acknowledged and already solved in this PR https://github.com/OpenZeppelin/ethernaut/pull/422 , once merged it should work normally
When is the merge happening? Running into the same issue
Fixed here https://github.com/OpenZeppelin/ethernaut/pull/429