ethernaut icon indicating copy to clipboard operation
ethernaut copied to clipboard

Cannot interact with contract... `Error in RPC response:,err: max fee per gas less than block base fee`

Open kylebakerio opened this issue 3 years ago • 4 comments

@ 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)

:/

kylebakerio avatar Oct 27 '21 11:10 kylebakerio

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...

kylebakerio avatar Oct 27 '21 11:10 kylebakerio

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.

kylebakerio avatar Oct 27 '21 11:10 kylebakerio

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.

kylebakerio avatar Oct 31 '21 19:10 kylebakerio

I appreciate you posting this because I ran into the same issue today.

DarqueWarrior avatar May 07 '22 15:05 DarqueWarrior

I ran into this today.

r0mille avatar Oct 28 '22 07:10 r0mille

I think specifying gas price like this is helping await ethernaut.owner({ gasPrice:0 })

JithinKS97 avatar Oct 31 '22 06:10 JithinKS97

This issue is acknowledged and already solved in this PR https://github.com/OpenZeppelin/ethernaut/pull/422 , once merged it should work normally

xaler5 avatar Nov 02 '22 10:11 xaler5

When is the merge happening? Running into the same issue

J-mastenbroek avatar Nov 11 '22 13:11 J-mastenbroek

Fixed here https://github.com/OpenZeppelin/ethernaut/pull/429

xaler5 avatar Nov 17 '22 08:11 xaler5