cavanmflynn / ethers-multicall

Make multiple Ethereum network requests in a single HTTP query. ethcall for ethers v5.
MIT License
224 stars 100 forks source link

Not sure why ethers-multicall not work in Fantom #21

Open mushroomsforest opened 3 years ago

mushroomsforest commented 3 years ago

We are trying to use ethers-multicall (https://www.npmjs.com/package/ethers-multicall) to group multiple calls to Fantom RPC, but it seems not working. Would you mind to take a look at and share any thoughts/guidance if possible?

image sample reproduction code:

let mushContract = new Contract("0x883fb00742161dce2235bbf4a67df84cd0e50c08", "contractABI");

let marketPriceCall = mushContract.getMarkPrice("0x321162Cd933E2Be498Cd2267a90534A804051b11");
let exposureBalanceCall = mushContract.exposureBalances("0x43229759E12eFbe3e2A0fB0510B15e516d046442", "0x321162Cd933E2Be498Cd2267a90534A804051b11");
let tokenBalanceCall = mushContract.tokenBalances("0x43229759E12eFbe3e2A0fB0510B15e516d046442", "0x321162Cd933E2Be498Cd2267a90534A804051b11");
let exposureLeverageBpsCall = mushContract.exposureLeverageBps("0x43229759E12eFbe3e2A0fB0510B15e516d046442","0x321162Cd933E2Be498Cd2267a90534A804051b11");

let [
    marketPrice,
    exposureBalance,
    tokenBalance,
    exposureLeverageBps,
] = await callProvider.all([
    marketPriceCall,
    exposureBalanceCall,
    tokenBalanceCall,
    exposureLeverageBpsCall,
]);
mushroomsforest commented 3 years ago

no worry, we submit a PR for Fantom: https://github.com/cavanmflynn/ethers-multicall/pull/22

ChrisChan888 commented 2 years ago

I have this error on avalanche...

TJakubek commented 2 years ago

@mushroomsforest do I understand correctly that you need to deploy a contract on Fantom to get rid of this error? Could you point to which contract needs to be deployed?

mushroomsforest commented 2 years ago

@mushroomsforest do I understand correctly that you need to deploy a contract on Fantom to get rid of this error? Could you point to which contract needs to be deployed?

It is already deployed and you could find it in this PR https://github.com/cavanmflynn/ethers-multicall/issues/21#issuecomment-911363020