Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Multicall2 contract #5

Merged
merged 4 commits into from Aug 23, 2021
Merged

Conversation

penandlim
Copy link
Contributor

@penandlim penandlim commented Jun 1, 2021

Changes in this PR

  • Update the addresses to point to Multicall2
  • Add another set of address map that contains Multicall2 addresses
  • Add a new method Provider.tryAll which is identical to all except it will ignore any reverted calls (if any) and return null in place of their return values. This call relies on Multicall2 contract instances.
  • Does not modify existing Provider.all function - it will still use the original Multicall contract instances.

TODO: deploy Multicall2 on chain 56
TODO: mark all read functions as view in ABI file Marked Multicall2.tryAggregate() function as view

Please double check the deployed contracts on sidechains match MakerDAO's repo and MakerDAO's deployment settings on eth mainnet!

Chain 56: https://bscscan.com/address/0x4c6bb7c24b6f3dfdfb548e54b7c5ea4cb52a0069#code
Chain 137: https://polygonscan.com/address/0xf43a7be1b284aa908cdfed8b3e286961956b4d2c#code

@Destiner
Copy link
Owner

Destiner commented Jun 6, 2021

@penandlim awesome, thanks a lot for this! Kudos for adding doc comments.

I would really love to merge this.

One concern I have is since this new multicall2 contract was deployed recently, it would be impossible to query historical data. Solution may be to keep using old Multicall for all call, and only use new Multicall for tryAll method.

@penandlim
Copy link
Contributor Author

Hey @Destiner ! I've made the adjustment according to your comments. Let me know if this looks good!

@defidavid
Copy link

Can we get this merged up, @Destiner?

@Destiner Destiner merged commit c556864 into Destiner:master Aug 23, 2021
@Destiner
Copy link
Owner

Hey @penandlim and @DeFi-David. Sorry for a big delay, but I've just reviewed and merged it. Thanks again! I'm publishing this under beta tag, so if you want to install it, type npm install ethcall@beta.

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

Successfully merging this pull request may close these issues.

None yet

3 participants