-
Notifications
You must be signed in to change notification settings - Fork 281
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(provider
): multicall
#2010
Conversation
stack builder + call_aggregate
FYI alloy-rs/core#492 contains possibly useful stuff like TuplePush to flatten the tuple return type |
crates/contract/src/multicall/mod.rs
Outdated
async fn build_and_call<M: SolCall>( | ||
&self, | ||
call_type: M, | ||
value: Option<U256>, |
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.
why does this need a standalone value arg?
crates/contract/src/call.rs
Outdated
function fail() external { | ||
revert("fail"); | ||
} |
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.
fyi: multicall3 does not support bubbling up of errors (or custom error forwarding for that matter) which will make it more difficult to debug
related: mds1/multicall#146
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.
lgtm, pending @DaniPopes and @klkvr
where | ||
Self: Sized, |
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.
hmm, this is the first time we do it like this and not use the client.
for mutlicall we def need the provider because we need its functions
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.
lgtm!
/// | ||
/// ## Example | ||
/// | ||
/// ```ignore |
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.
should change the doctests to no_run
so we make sure they compile
ah actually these would have a circular dep
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.
Yep! Won't compile
Motivation
Implementing a Multicall3 builder type
Solution
Uses a tuple based approach to add numerous (different) calls to the builder with type inference.
aggregate
aggregate3
aggregate3Value
try*
aggregate methodsPR Checklist