Skip to content

Commit

Permalink
Multicall helpers (#12)
Browse files Browse the repository at this point in the history
Small changes to return the multicall v3 `ContractCall` once it's built.
They already exist on the latest version of ethers so nothing breaking
  • Loading branch information
daniel-savu authored Apr 25, 2024
1 parent c9ced03 commit 94fc0ec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ethers-contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ mod multicall;
#[cfg(any(test, feature = "abigen"))]
#[cfg_attr(docsrs, doc(cfg(feature = "abigen")))]
pub use multicall::{
Multicall, MulticallContract, MulticallError, MulticallVersion, MULTICALL_ADDRESS,
MULTICALL_SUPPORTED_CHAIN_IDS,
Multicall, MulticallContract, MulticallError, MulticallResult, MulticallVersion,
MULTICALL_ADDRESS, MULTICALL_SUPPORTED_CHAIN_IDS,
};

/// This module exposes low lever builder structures which are only consumed by the
Expand Down
6 changes: 3 additions & 3 deletions ethers-contract/src/multicall/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
};

mod multicall_contract;
use multicall_contract::multicall_3::{
pub use multicall_contract::multicall_3::{
Call as Multicall1Call, Call3 as Multicall3Call, Call3Value as Multicall3CallValue,
Result as MulticallResult,
};
Expand Down Expand Up @@ -827,7 +827,7 @@ impl<M: Middleware> Multicall<M> {
}

/// v3
fn as_aggregate_3(&self) -> ContractCall<M, Vec<MulticallResult>> {
pub fn as_aggregate_3(&self) -> ContractCall<M, Vec<MulticallResult>> {
// Map the calls vector into appropriate types for `aggregate_3` function
let calls: Vec<Multicall3Call> = self
.calls
Expand All @@ -854,7 +854,7 @@ impl<M: Middleware> Multicall<M> {
}

/// v3 + values (only .send())
fn as_aggregate_3_value(&self) -> ContractCall<M, Vec<MulticallResult>> {
pub fn as_aggregate_3_value(&self) -> ContractCall<M, Vec<MulticallResult>> {
// Map the calls vector into appropriate types for `aggregate_3_value` function
let mut total_value = U256::zero();
let calls: Vec<Multicall3CallValue> = self
Expand Down
3 changes: 2 additions & 1 deletion ethers-solc/src/compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ impl fmt::Display for SolcVersion {
///
/// By default the solc path is configured as follows, with descending priority:
/// 1. `SOLC_PATH` environment variable
/// 2. [svm](https://github.com/roynalnaruto/svm-rs)'s `global_version` (set via `svm use <version>`), stored at `<svm_home>/.global_version`
/// 2. [svm](https://github.com/roynalnaruto/svm-rs)'s `global_version` (set via `svm use
/// <version>`), stored at `<svm_home>/.global_version`
/// 3. `solc` otherwise
#[derive(Debug, Clone, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize)]
pub struct Solc {
Expand Down

0 comments on commit 94fc0ec

Please sign in to comment.