Skip to content

Commit

Permalink
fix: deposit limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Feb 9, 2023
1 parent 4f57139 commit c1a7ab4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contexts/useYearn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {getUniqueLanguages} from 'utils/getUniqueLanguages';
import type * as appTypes from 'types/types';
import {TFile} from 'types/types';
import {cleanString} from 'utils/cleanString';
import {BigNumber} from 'ethers';

const YearnContext = createContext<appTypes.TYearnContext>({
dataFromAPI: [],
Expand Down Expand Up @@ -453,7 +454,7 @@ export const getExporterPartners = (exporterPartnersRawData: string): {
};

function isRetirementValid(vault: any): boolean {
return Number(vault?.details?.depositLimit) === 0 && vault?.details?.retired;
return !(BigNumber.from(vault?.details?.depositLimit || 0).isZero() && !vault?.details?.retired);
}

export const useYearn = (): appTypes.TYearnContext => useContext(YearnContext);
Expand Down

0 comments on commit c1a7ab4

Please sign in to comment.