Skip to content

Commit

Permalink
Catch 0x Multicall return in withERC7412 helper
Browse files Browse the repository at this point in the history
  • Loading branch information
noisekit committed Oct 29, 2024
1 parent b41b9d8 commit 0acf138
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions liquidity/lib/withERC7412/withERC7412.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ export async function erc7412Call<T>(
delete newCall._calls;

const res = await provider.call(newCall);
if (res === '0x') {
throw new Error(`[${label}] Call returned 0x`);
}

if (newCall.to?.toLowerCase() === Multicall3Contract.address.toLowerCase()) {
// If this was a multicall, decode and remove price updates.
Expand Down

0 comments on commit 0acf138

Please sign in to comment.