Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

fix(contract): allow 16 calls in multicall #1934

Merged
merged 1 commit into from
Dec 15, 2022
Merged

Conversation

onsails
Copy link
Contributor

@onsails onsails commented Dec 9, 2022

Motivation

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

@@ -608,7 +608,7 @@ impl<M: Middleware> Multicall<M> {
/// # }
/// ```
pub async fn call<D: Detokenize>(&self) -> Result<D, M> {
assert!(self.calls.len() < 16, "Cannot decode more than 16 calls");
assert!(self.calls.len() <= 16, "Cannot decode more than 16 calls");
Copy link
Owner

@gakonst gakonst Dec 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK this should be fine due to this line https://github.com/gakonst/ethers-rs/blob/master/ethers-core/src/abi/tokens.rs#L130 and this https://github.com/gakonst/ethers-rs/blob/master/ethers-core/src/abi/tokens.rs#L341. Would be nicer if we did this with a const generic somehow so we're not bound to any number of tokens. Even better if we had an ability to return things of unknown length.

Copy link
Contributor Author

@onsails onsails Dec 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have propotypes for both, will prepare another PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gakonst gakonst merged commit 5bc9ee7 into gakonst:master Dec 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants