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

feat: add MutliCall #867

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

feat: add MutliCall #867

wants to merge 5 commits into from

Conversation

codeislight1
Copy link

MutliCall allows aave v3 users to perform multiple calls to Pool functions in a single transaction, thus saving on base gas fees. So it would make it easier for users for example:

  • supply -> borrow
  • repay -> withdraw
  • supply multiple assets
  • withdraw multiple assets
  • borrow multiple assets
  • and much more...

let me know if there is anything that should be changed, I tried to write tests, but I stumbled upon
some errors while running tests on docker.

@height
Copy link

height bot commented Jul 23, 2023

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@eboadom
Copy link
Collaborator

eboadom commented Jul 24, 2023

Nice contribution @codeislight1. One question, why did you decide to keep "low level" bytes as the input for the new function?
The approach provides generalization, but I'm wondering if it could create issues in the future if any function (deposit, borrow) would change signature

@codeislight1
Copy link
Author

Nice contribution @codeislight1. One question, why did you decide to keep "low level" bytes as the input for the new function? The approach provides generalization, but I'm wondering if it could create issues in the future if any function (deposit, borrow) would change signature

Hi bandon, thank you for the review! for the low level call it's purely to efficiently acquire the function inputs directly from the calldata, without copying to memory. if the signature ever changes, it should just:

  • pass 0x20*(argument index) as input to Calldata library function
  • use the appropriate datatype getter

but that comes with the limitation of only passing up to 7 arguments, simple workaround is to pass the argument index to the Calldata library getter functions, multiply it by 0x20. thus compromising on 5 gas saving on MUL opcode.

the implementation is somewhat inspired by Universal Router Dispatcher by Uniswap:
https://github.com/Uniswap/universal-router/blob/main/contracts/base/Dispatcher.sol#L51

@codeislight1
Copy link
Author

codeislight1 commented Jul 25, 2023

btw, for readability sake, i believe abi.decode would do the job, let me know if you d like to proceed with it as is, or decode it using abi.decode which is much cleaner

@codeislight1
Copy link
Author

@eboadom any update 👀

@codeislight1
Copy link
Author

Also, I ended up finding my Shiba accounts when I first started. Those were my baby’s. so thank you. And I’ll be waiting for you response via email. Not sure if this is professional, but my number is below if that helps. And it goes a long way with me that you reached out. Thank you very much.! 562.810.3905
On Sat, Aug 12, 2023 at 6:54 PM codeislight @.> wrote: @eboadom https://github.com/eboadom any update 👀 — Reply to this email directly, view it on GitHub <#867 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A74DE6IBKWGNEYHFT62VC5DXVAXXDANCNFSM6AAAAAA2UP66KA . You are receiving this because you commented.Message ID: @.>
-- Best regards, Brian Bruce CEO/President | BAB Specialty Group SDVOSB- Service-Disabled Veteran-Owned Small Business AICCC- American Indian Chamber of Commerce | Minority Owned SUPPORT OUR TROOPS! | Support Tunnel2Towers.org BABSpecialtyGroup.com http://BABSpecialtyGroup.com Corporate Office 833.246.4222 X 701 C: 562.810.3905 F: 562.501.3156 E: @.*** Click Below BAB Specialty Group Capability Statement BAB Capability Statement http://babspecialtygroup.com/wp-content/uploads/2021/03/BAB-CapabilitySheet-1.pdf ATTENTION! This message originated from BAB Specialty Group Inc. Service Disabled Veteran, Minority Owned | Treat hyperlinks and attachments in this email with caution. CAUTION: The e-mail below is from an external source. Please use caution before opening attachments, clicking links, and never supply User ID or Password.

Stop spamming the PR, it is only meant to discuss the content of the PR, if you have any issues open an issue, or ask in aave forum to discuss it https://governance.aave.com

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.

2 participants