diff --git a/src/contracts/vaultMulticall.ts b/src/contracts/vaultMulticall.ts index fc681de6..0ce240a1 100644 --- a/src/contracts/vaultMulticall.ts +++ b/src/contracts/vaultMulticall.ts @@ -108,10 +108,17 @@ const vaultMulticall = async (values: VaultMulticallInput): P const { method, args } = params[0] // @ts-ignore: no types to describe - return contract[method](...args) + const estimatedGas = await contract[method].estimateGas(...args) + const gasLimit = estimatedGas * 110n / 100n + + // @ts-ignore: no types to describe + return contract[method](...args, { gasLimit }) } - return contract.multicall(calls) as T + const estimatedGas = await contract.multicall.estimateGas(calls) + const gasLimit = estimatedGas * 110n / 100n + + return contract.multicall(calls, { gasLimit }) as T }