Skip to content

Commit

Permalink
Increase gasLimit estimation (#56)
Browse files Browse the repository at this point in the history
* Remove gasLimit estimation from erc7412.

* Increase gasLimit
  • Loading branch information
Rickk137 authored Nov 6, 2024
1 parent 4b8787c commit d84d8c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions liquidity/lib/withERC7412/withERC7412.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,18 +344,19 @@ export async function erc7412Call<T>(
const Multicall3Contract = await importMulticall3(network.id, network.preset);

const from = getDefaultFromAddress(network.name);

const {
_calls: newCalls,
gasLimit,
multicallTxn,
gasLimit,
} = await withERC7412(
network,
calls.filter(notNil).map((call) => (call.from ? call : { ...call, from })), // fill missing "from"
label,
from
);

const res = await provider.call({ ...multicallTxn, gasLimit });
const res = await provider.call({ ...multicallTxn, gasLimit: gasLimit.mul(15).div(10) });
if (res === '0x') {
throw new Error(`[${label}] Call returned 0x`);
}
Expand Down

0 comments on commit d84d8c6

Please sign in to comment.