Skip to content
This repository was archived by the owner on Apr 18, 2023. It is now read-only.

Why use multicall.js instead of web3.js? #17

Open
wjmelements opened this issue May 9, 2020 · 0 comments
Open

Why use multicall.js instead of web3.js? #17

wjmelements opened this issue May 9, 2020 · 0 comments

Comments

@wjmelements
Copy link

wjmelements commented May 9, 2020

There's no advantage of using your smart contract vs regular jsonrpc batching. In fact the performance is worse.

Get the return value(s) of multiple smart contract function calls in a single call

This is not superior to using a batch because the batch is in parallel.

Guarantee that all values are from the same block

You can specify a block number in the call. Polling "latest" results in unnecessary calls since you should only poll when you get a new block. A block is already a snapshot.

Use watchers to poll for multiple blockchain state variables/functions
Get updates when a watcher detects state has changed
Results from out of sync nodes are automatically ignored
Get new block updates

These are valid and useful, but don't require the batch contract.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant