diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa3abfe9..de66b716 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ jobs: unit_test: runs-on: ubuntu-latest env: - TEST_LLAMA_NODES_ID: ${{ secrets.LLAMA_NODES_PROJECT_ID }} + WEB3_INFURA_PROJECT_ID: ${{ secrets.WEB3_INFURA_PROJECT_ID }} steps: - uses: actions/checkout@v2 - name: Setup Node @@ -35,11 +35,11 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Installing Dependencies run: yarn - name: Building App - run: yarn run build + run: export NODE_OPTIONS=--openssl-legacy-provider && yarn run build - name: Deploy to Preview Channel uses: FirebaseExtended/action-hosting-deploy@v0 with: diff --git a/src/app/hooks/use-pools-preview.ts b/src/app/hooks/use-pools-preview.ts index 0acff839..60e777d6 100644 --- a/src/app/hooks/use-pools-preview.ts +++ b/src/app/hooks/use-pools-preview.ts @@ -54,6 +54,7 @@ const usePoolsPreview = (): Optional => { }, strategyInfo: null, isPaused: false, + isShutdown: false, }; return pool_; }); diff --git a/src/components/PausedSnackbar.tsx b/src/components/PausedSnackbar.tsx index d5028034..921fc10b 100644 --- a/src/components/PausedSnackbar.tsx +++ b/src/components/PausedSnackbar.tsx @@ -79,7 +79,9 @@ const PausedSnackbar = ({ pool }: Props): Optional => { const dispatch = useDispatch(); const dismissed = useSelector(selectPausedSnackbarDismissed); - if (!pool || !pool.isPaused || dismissed) return null; + const paused = pool && (pool.isPaused || pool.isShutdown); + + if (!paused || dismissed) return null; return ( diff --git a/src/lib/mero.test.ts b/src/lib/mero.test.ts index 31bd528b..23030b7c 100644 --- a/src/lib/mero.test.ts +++ b/src/lib/mero.test.ts @@ -3,9 +3,9 @@ import { DUMMY_ETH_ADDRESS } from "./constants"; import { createMero } from "./factory"; import { Web3Mero } from "./mero"; -const llamaId = process.env.TEST_LLAMA_NODES_ID; -if (!llamaId) throw new Error("TEST_LLAMA_NODES_ID not given"); -const rpc = `https://eth.llamarpc.com/rpc/${llamaId}`; +const infuraId = process.env.WEB3_INFURA_PROJECT_ID; +if (!infuraId) throw new Error("WEB3_INFURA_PROJECT_ID not given"); +const rpc = `https://mainnet.infura.io/v3/${infuraId}`; const provider = new ethers.providers.JsonRpcProvider(rpc); const mero = createMero(provider, { chainId: 1 }) as Web3Mero; diff --git a/src/lib/mero.ts b/src/lib/mero.ts index c8e25888..2ecedfb1 100644 --- a/src/lib/mero.ts +++ b/src/lib/mero.ts @@ -240,6 +240,7 @@ export class Web3Mero implements Mero { feeDecreasePeriod, vaultAddress, isPaused, + isShutdown, ] = await Promise.all([ pool.name(), pool.getLpToken(), @@ -251,6 +252,7 @@ export class Web3Mero implements Mero { pool.withdrawalFeeDecreasePeriod(), pool.vault(), pool.isPaused(), + pool.isShutdown(), ]); const vaultShutdown = vaultAddress === ZERO_ADDRESS; @@ -281,6 +283,7 @@ export class Web3Mero implements Mero { feeDecreasePeriod: new ScaledNumber(feeDecreasePeriod, 0).toPlain(), strategyInfo, isPaused, + isShutdown, }; } @@ -370,6 +373,7 @@ export class Web3Mero implements Mero { feeDecreasePeriod: ScaledNumber.fromUnscaled(0, 0).toPlain(), strategyInfo: null, isPaused, + isShutdown: false, }; } diff --git a/src/lib/mock/data.ts b/src/lib/mock/data.ts index 342d53bb..0a3b7153 100644 --- a/src/lib/mock/data.ts +++ b/src/lib/mock/data.ts @@ -32,6 +32,7 @@ export const pools: GenericPool[] = [ feeDecreasePeriod: scale(10, 18), strategyInfo: null, isPaused: false, + isShutdown: false, }, { name: "bUSDC3CRV", @@ -57,6 +58,7 @@ export const pools: GenericPool[] = [ feeDecreasePeriod: scale(10, 18), strategyInfo: null, isPaused: false, + isShutdown: false, }, { name: "meroethCRV", @@ -82,6 +84,7 @@ export const pools: GenericPool[] = [ feeDecreasePeriod: scale(10, 18), strategyInfo: null, isPaused: false, + isShutdown: false, }, ]; diff --git a/src/lib/types.ts b/src/lib/types.ts index 00bcb39d..7a8bada5 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -32,6 +32,7 @@ export interface GenericPool { underlying: Token; strategyInfo: Optional; isPaused: boolean; + isShutdown: boolean; } export type Pool = GenericPool; diff --git a/src/pages/pool/PoolDeposit.tsx b/src/pages/pool/PoolDeposit.tsx index 85d13775..5ce6603f 100644 --- a/src/pages/pool/PoolDeposit.tsx +++ b/src/pages/pool/PoolDeposit.tsx @@ -56,6 +56,7 @@ const PoolDeposit = ({ pool, compact }: Props): JSX.Element => { const error = () => { if (!pool || !poolUnderlyingBalance || !depositAmount) return ""; if (pool.isPaused) return t("amountInput.validation.poolPaused"); + if (pool.isShutdown) return t("amountInput.validation.poolPaused"); if (Number(depositAmount) <= 0) return t("amountInput.validation.positive"); try { const amount = ScaledNumber.fromUnscaled(depositAmount, pool?.underlying.decimals); diff --git a/src/pages/pools/PoolsPage.tsx b/src/pages/pools/PoolsPage.tsx index 36403824..09c94ecf 100644 --- a/src/pages/pools/PoolsPage.tsx +++ b/src/pages/pools/PoolsPage.tsx @@ -141,7 +141,8 @@ const PoolsPage = (): JSX.Element => { {pools && pools .filter((pool: Pool) => { - if (!pool.isPaused) return true; + const paused = pool.isPaused || pool.isShutdown; + if (!paused) return true; if (!balances || !balances[pool.address]) return false; return !balances[pool.address].isZero(); })