-
Notifications
You must be signed in to change notification settings - Fork 30
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
Refs #454 -- Added multicall-in-router.md to general/build/smart-contracts/gas-optimization #619
Refs #454 -- Added multicall-in-router.md to general/build/smart-contracts/gas-optimization #619
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with this approach and I would wonder how much it can be saved to use multicall. From my institution I think not much can be saved.
Another improvement is that the multicall contract address can be found here
The gas savings depend on the complexity of the functions and use cases. In simpler examples, like the ones in my initial demo code, the savings are less apparent due to basic operations and the overhead of multicall itself. Therefore, multicall's loop and result handling overhead are more pronounced. However, in real-world scenarios, such as with Uniswap Router and Compound Bulker, multicall batches complex operations into a single transaction, significantly reducing gas costs. |
That makes sense but without some specific data this pr might not be merged from my end |
65c0b76
to
e5a0b19
Compare
e5a0b19
to
97e4cb1
Compare
Updated the example code, the results of running the test script are as follows:
|
Pre-flight checklist
This change is