Skip to content

Commit 6f80dd8

Browse files
committed
decreased multicall gas buffer from 10m to 100k and properly handling if undeployed contract deployment already runs out of gas
1 parent 9d2bbd6 commit 6f80dd8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

IceCreamSwapWeb3/Multicall.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def _build_calldata(self, calls_with_calldata: list[tuple[ContractFunction, byte
184184
# build multicall transaction
185185
multicall_call = self.multicall.functions.multicallWithGasLimitation(
186186
calls=encoded_calls,
187-
gasBuffer=10_000_000,
187+
gasBuffer=100_000,
188188
)
189189

190190
# return multicall address and calldata
@@ -332,7 +332,7 @@ def _call_multicall(self, multicall_call: ContractConstructor | ContractFunction
332332

333333
multicall_result = multicall_result[:completed_calls]
334334

335-
if self.undeployed_contract_constructor is not None:
335+
if len(multicall_result) > 0 and self.undeployed_contract_constructor is not None:
336336
# remove first call result as that's the deployment of the undeployed contract
337337
success, _, address_encoded = multicall_result[0]
338338
assert success, "Undeployed contract constructor reverted"

0 commit comments

Comments
 (0)