Skip to content

Commit

Permalink
fix: handle empty erc4626Tokens array
Browse files Browse the repository at this point in the history
f
  • Loading branch information
gmbronco committed Jan 7, 2025
1 parent e2453c8 commit 34be99c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/strange-dolphins-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'backend': patch
---

fix: handle empty erc4626Tokens array
3 changes: 3 additions & 0 deletions modules/sources/contracts/v3/fetch-unwrap-rates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export const fetchUnwrapRates = async (
): Promise<{
[id: string]: string;
}> => {
if (erc4626Tokens.length === 0) {
return {};
}
const chain = erc4626Tokens[0].chain;
const caller = new Multicaller3Viem(chain, MinimalErc4626Abi);
erc4626Tokens.forEach((token) =>
Expand Down

0 comments on commit 34be99c

Please sign in to comment.