TrueFiEng / useDApp

Framework for rapid Dapp development. Simple. Robust. Extendable. Testable
https://usedapp.io
MIT License
1.59k stars 368 forks source link

:docs: Terrible documentation regarding Multicalls #770

Open AlphaDio opened 2 years ago

AlphaDio commented 2 years ago

Multicalls are a confusing, obnoxious, and very obscure feature.

I spent an hour debugging my application because of an impossibility to deploy a Multicall contract.

I also have trouble with Multicall when it comes to deployments on non-Mainnet chains.

I would ask for a better documentation and troubleshotting of Multicall, and also list of Multicall contracts depending on chains.

Thank you.

rzadp commented 2 years ago

Agree, the multicall is a central piece of usedapp and should be covered as much as possible in the docs.

A list of multicall contracts depending on chains is not in the docs, but if you need it right now you can take a look at this folder - every chain has a file with a multicall address there.

AlphaDio commented 2 years ago

Unfortunately a multicall address is missing for Moonbase Alpha. But I managed to deploy my own, no worries there.

What I am more worried about is the people thinking there is something wrong with their code when all they did is not give a Multicall address.

akornato commented 2 years ago

I totally agree with @AlphaDio - I'm trying to use useDapp against a local Hardhat network and I was seeing my local app trying to deploy some contract as soon as I connected with the app, and I had no idea why that was happening. I even thought my Metamask was hacked 🤣 Finally I found out it's this multicall autodeploy feature. The contract has to be deployed via Metamask every time I restart a Hardhat node. If I add any address for ChainId.Hardhat network to multicallAddresses in the config, then it won't try to deploy again, but also won't try it when I restart a Hardhat node, i.e. even when there's no multicall contract deployed. I ended up automating the deploy of the MultiCall contract in a Hardhat deploy script that I run on every Hardhat node restart.