Skip to content

Commit

Permalink
Merge pull request #125 from zkLinkProtocol/issue_124
Browse files Browse the repository at this point in the history
update multicall contract
  • Loading branch information
zkcarter authored Dec 6, 2023
2 parents a402d1c + 1ef6fda commit e4dd06f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/contracts/multicall.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct AcceptInfo {

#[starknet::interface]
trait IMulticall<TContractState> {
fn multiStaticCall(self: @TContractState, _targets: Array<Call>) -> Array<MulticallResult>;
fn multicall(ref self: TContractState, _targets: Array<Call>) -> Array<MulticallResult>;
fn batchWithdrawToL1(
ref self: TContractState, _zklink: ContractAddress, _withdrawDatas: Array<WithdrawToL1Info>
Expand All @@ -71,7 +72,7 @@ mod Multicall {

#[external(v0)]
impl Multicall of super::IMulticall<ContractState> {
fn multicall(ref self: ContractState, _targets: Array<Call>) -> Array<MulticallResult> {
fn multiStaticCall(self: @ContractState, _targets: Array<Call>) -> Array<MulticallResult> {
let mut results: Array<MulticallResult> = array![];
let mut _targets = _targets;
loop {
Expand All @@ -94,6 +95,10 @@ mod Multicall {
results
}

fn multicall(ref self: ContractState, _targets: Array<Call>) -> Array<MulticallResult> {
self.multiStaticCall(_targets)
}

fn batchWithdrawToL1(
ref self: ContractState,
_zklink: ContractAddress,
Expand Down

0 comments on commit e4dd06f

Please sign in to comment.