You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
Why this as_aggregate_3_value only available in send mode? what i need to do if i want to use the MulticallV3 to simulate some function that comsume eth...
/// v3
#[inline]
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
.clone()
.into_iter()
.map(|call| Multicall3Call {
target: call.target,
call_data: call.data,
allow_failure: call.allow_failure,
})
.collect();
// Construct the ContractCall for `aggregate_3` function to broadcast the transaction
let contract_call = self.contract.aggregate_3(calls);
self.set_call_flags(contract_call)
}
/// v3 + values (only .send())
#[inline]
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
.calls
.clone()
.into_iter()
.map(|call| {
total_value += call.value;
Multicall3CallValue {
target: call.target,
call_data: call.data,
allow_failure: call.allow_failure,
value: call.value,
}
})
.collect();
if total_value.is_zero() {
// No value is being sent
self.as_aggregate_3()
} else {
// Construct the ContractCall for `aggregate_3_value` function to broadcast the// transaction
let contract_call = self.contract.aggregate_3_value(calls);
self.set_call_flags(contract_call).value(total_value)
}
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
ethers-rs/ethers-contract/src/multicall/middleware.rs
Line 796 in 6136dde
Why this
as_aggregate_3_value
only available insend
mode? what i need to do if i want to use theMulticallV3
to simulate some function that comsume eth...The text was updated successfully, but these errors were encountered: