I am trying to run multi call to blockchain using https://github.com/banteg/multicall.py library. When I specify public RPC url everything works as expected, but when I try to switch it local Ganache RPC using fork of mainnet I get an error:
ContractLogicError: execution reverted: Incorrect number of arguments. Method 'eth_call' requires exactly 2 arguments. Request specified 3 arguments:
I suggest the error isn't in library to perform multicalls, but in the Ganache node, because the query is exactly the same except destination.
This is the command to run ganache:
ganache-cli -f https://bsc-dataseed.binance.org --chainId 56
Is there any difference between public node and ganache?
So I figured this out, and this is a problem with hardhat and ganache. Details here: https://github.com/NomicFoundation/hardhat/issues/2513
The multicall library that's mentioned in the question - https://github.com/banteg/multicall.py, uses the state overrides feature on Ethereum mainnet, which is not supported by hardhat.
The way I got around it was temporarily patching the library to not use state overrides, basically adding Network.Mainnet
here - https://github.com/banteg/multicall.py/blob/master/multicall/constants.py#L178
I will open an issue with the library to support this via an environment variable as well.