Skip to content

Commit

Permalink
feat: add stERN-ERN staking pool (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
dudesahn authored Oct 12, 2023
1 parent d73a02a commit ef70d01
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion apps/common/contexts/useWallet.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {createContext, memo, useCallback, useContext, useEffect, useMemo, useState} from 'react';
import {useChainId} from 'wagmi';
import {OPT_YVAGEUR_USDC_STAKING_CONTRACT, OPT_YVALETH_FRXETH_STAKING_CONTRACT, OPT_YVALETH_WETH_STAKING_CONTRACT, OPT_YVALUSD_FRAX_STAKING_CONTRACT, OPT_YVALUSD_USDC_STAKING_CONTRACT, OPT_YVDAI_STAKING_CONTRACT, OPT_YVDOLA_USDC_STAKING_CONTRACT, OPT_YVDOLAUSDC_STAKING_CONTRACT, OPT_YVERN_DOLA_STAKING_CONTRACT, OPT_YVERN_LUSD_STAKING_CONTRACT, OPT_YVETH_STAKING_CONTRACT, OPT_YVEXA_WETH_STAKING_CONTRACT, OPT_YVFRAX_DOLA_STAKING_CONTRACT, OPT_YVIB_WETH_STAKING_CONTRACT, OPT_YVLDO_WSTETH_STAKING_CONTRACT, OPT_YVLUSD_WETH_STAKING_CONTRACT, OPT_YVMAI_ALUSD_STAKING_CONTRACT, OPT_YVMAI_DOLA_STAKING_CONTRACT, OPT_YVMAI_STAKING_CONTRACT, OPT_YVMAI_USDC_STAKING_CONTRACT, OPT_YVMAIUSDC_STAKING_CONTRACT, OPT_YVMIM_USDC_STAKING_CONTRACT, OPT_YVMTA_USDC_STAKING_CONTRACT, OPT_YVOP_USDC_STAKING_CONTRACT, OPT_YVOP_VELO_STAKING_CONTRACT, OPT_YVOP_WETH_STAKING_CONTRACT, OPT_YVSNX_USDC_STAKING_CONTRACT, OPT_YVSUSCUSDC_STAKING_CONTRACT, OPT_YVTBTC_WBTC_STAKING_CONTRACT, OPT_YVTBTC_WETH_STAKING_CONTRACT, OPT_YVUSDC_STAKING_CONTRACT, OPT_YVUSDT_STAKING_CONTRACT, OPT_YVVELO_USDC_STAKING_CONTRACT, OPT_YVWUSDR_USDC_STAKING_CONTRACT, OPT_YVWUSDRV2_USDC_STAKING_CONTRACT, STACKING_TO_VAULT} from '@vaults/constants/optRewards';
import {OPT_YVSTERN_ERN_STAKING_CONTRACT, OPT_YVAGEUR_USDC_STAKING_CONTRACT, OPT_YVALETH_FRXETH_STAKING_CONTRACT, OPT_YVALETH_WETH_STAKING_CONTRACT, OPT_YVALUSD_FRAX_STAKING_CONTRACT, OPT_YVALUSD_USDC_STAKING_CONTRACT, OPT_YVDAI_STAKING_CONTRACT, OPT_YVDOLA_USDC_STAKING_CONTRACT, OPT_YVDOLAUSDC_STAKING_CONTRACT, OPT_YVERN_DOLA_STAKING_CONTRACT, OPT_YVERN_LUSD_STAKING_CONTRACT, OPT_YVETH_STAKING_CONTRACT, OPT_YVEXA_WETH_STAKING_CONTRACT, OPT_YVFRAX_DOLA_STAKING_CONTRACT, OPT_YVIB_WETH_STAKING_CONTRACT, OPT_YVLDO_WSTETH_STAKING_CONTRACT, OPT_YVLUSD_WETH_STAKING_CONTRACT, OPT_YVMAI_ALUSD_STAKING_CONTRACT, OPT_YVMAI_DOLA_STAKING_CONTRACT, OPT_YVMAI_STAKING_CONTRACT, OPT_YVMAI_USDC_STAKING_CONTRACT, OPT_YVMAIUSDC_STAKING_CONTRACT, OPT_YVMIM_USDC_STAKING_CONTRACT, OPT_YVMTA_USDC_STAKING_CONTRACT, OPT_YVOP_USDC_STAKING_CONTRACT, OPT_YVOP_VELO_STAKING_CONTRACT, OPT_YVOP_WETH_STAKING_CONTRACT, OPT_YVSNX_USDC_STAKING_CONTRACT, OPT_YVSUSCUSDC_STAKING_CONTRACT, OPT_YVTBTC_WBTC_STAKING_CONTRACT, OPT_YVTBTC_WETH_STAKING_CONTRACT, OPT_YVUSDC_STAKING_CONTRACT, OPT_YVUSDT_STAKING_CONTRACT, OPT_YVVELO_USDC_STAKING_CONTRACT, OPT_YVWUSDR_USDC_STAKING_CONTRACT, OPT_YVWUSDRV2_USDC_STAKING_CONTRACT, STACKING_TO_VAULT} from '@vaults/constants/optRewards';
import {useUI} from '@yearn-finance/web-lib/contexts/useUI';
import {useBalances} from '@yearn-finance/web-lib/hooks/useBalances';
import {toAddress} from '@yearn-finance/web-lib/utils/address';
Expand Down Expand Up @@ -103,6 +103,7 @@ export const WalletContextApp = memo(function WalletContextApp({children}: {chil
extraTokens.push({token: OPT_YVTBTC_WBTC_STAKING_CONTRACT, symbol: 'yvVelo-tBTC-WBTC', decimals: 18});
extraTokens.push({token: OPT_YVOP_WETH_STAKING_CONTRACT, symbol: 'yvVelo-OP-WETH', decimals: 18});
extraTokens.push({token: OPT_YVWUSDRV2_USDC_STAKING_CONTRACT, symbol: 'yvVelo-wUSDRv2-USDC', decimals: 18});
extraTokens.push({token: OPT_YVSTERN_ERN_STAKING_CONTRACT, symbol: 'yvVelo-stERN-ERN', decimals: 18});
}
for (const token of extraTokens) {
tokensExists[token.token] = true;
Expand Down
14 changes: 10 additions & 4 deletions apps/vaults/constants/optRewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const OPT_YVTBTC_WETH_WITH_REWARDS = toAddress('0x00a2faF97CC2b985B29a0a0
export const OPT_YVTBTC_WBTC_WITH_REWARDS = toAddress('0x00Cb8E36A9C40491A39e8bF2864Ed30C1B579860');
export const OPT_YVOP_WETH_WITH_REWARDS = toAddress('0xDdDCAeE873f2D9Df0E18a80709ef2B396d4a6EA5');
export const OPT_YVWUSDRV2_USDC_WITH_REWARDS = toAddress('0x43360FDd9546e3e77ac2e6793f53219729743293');
export const OPT_YVSTERN_ERN_WITH_REWARDS = toAddress('0xa7B550B3A80361d8e47E07616dC42f04c655881b');

export const OPT_YVETH_STAKING_CONTRACT = toAddress('0xE35Fec3895Dcecc7d2a91e8ae4fF3c0d43ebfFE0');
export const OPT_YVDAI_STAKING_CONTRACT = toAddress('0xf8126EF025651E1B313a6893Fcf4034F4F4bD2aA');
Expand Down Expand Up @@ -73,6 +74,7 @@ export const OPT_YVTBTC_WETH_STAKING_CONTRACT = toAddress('0x3181E64B7d83Ec4240C
export const OPT_YVTBTC_WBTC_STAKING_CONTRACT = toAddress('0x9b26e8BD7EBc0177B06e3168410947A5dB6FDb12');
export const OPT_YVOP_WETH_STAKING_CONTRACT = toAddress('0x885FeDaB0182699eC2f2663F776a04150ed6f7af');
export const OPT_YVWUSDRV2_USDC_STAKING_CONTRACT = toAddress('0xE00bdf935e4FeB3cB5e0601D88a999d30994605c');
export const OPT_YVSTERN_ERN_STAKING_CONTRACT = toAddress('0x80C3806ADF50EfAc542DD4B3657F4BE2C30E24b8');

export const OPT_VAULTS_WITH_REWARDS = [
OPT_YVETH_WITH_REWARDS,
Expand Down Expand Up @@ -109,7 +111,8 @@ export const OPT_VAULTS_WITH_REWARDS = [
OPT_YVTBTC_WETH_WITH_REWARDS,
OPT_YVTBTC_WBTC_WITH_REWARDS,
OPT_YVOP_WETH_WITH_REWARDS,
OPT_YVWUSDRV2_USDC_WITH_REWARDS
OPT_YVWUSDRV2_USDC_WITH_REWARDS,
OPT_YVSTERN_ERN_WITH_REWARDS
];

export const OPT_REWARDS_TOKENS = [
Expand Down Expand Up @@ -147,7 +150,8 @@ export const OPT_REWARDS_TOKENS = [
OPT_YVTBTC_WETH_STAKING_CONTRACT,
OPT_YVTBTC_WBTC_STAKING_CONTRACT,
OPT_YVOP_WETH_STAKING_CONTRACT,
OPT_YVWUSDRV2_USDC_STAKING_CONTRACT
OPT_YVWUSDRV2_USDC_STAKING_CONTRACT,
OPT_YVSTERN_ERN_STAKING_CONTRACT
];

export const VAULT_TO_STACKING: TDict<TAddress> = {
Expand Down Expand Up @@ -185,7 +189,8 @@ export const VAULT_TO_STACKING: TDict<TAddress> = {
[OPT_YVTBTC_WETH_STAKING_CONTRACT]: OPT_YVTBTC_WETH_WITH_REWARDS,
[OPT_YVTBTC_WBTC_STAKING_CONTRACT]: OPT_YVTBTC_WBTC_WITH_REWARDS,
[OPT_YVOP_WETH_STAKING_CONTRACT]: OPT_YVOP_WETH_WITH_REWARDS,
[OPT_YVWUSDRV2_USDC_STAKING_CONTRACT]: OPT_YVWUSDRV2_USDC_WITH_REWARDS
[OPT_YVWUSDRV2_USDC_STAKING_CONTRACT]: OPT_YVWUSDRV2_USDC_WITH_REWARDS,
[OPT_YVSTERN_ERN_STAKING_CONTRACT]: OPT_YVSTERN_ERN_WITH_REWARDS

};

Expand Down Expand Up @@ -224,5 +229,6 @@ export const STACKING_TO_VAULT: TDict<TAddress> = {
[OPT_YVTBTC_WETH_WITH_REWARDS]: OPT_YVTBTC_WETH_STAKING_CONTRACT,
[OPT_YVTBTC_WBTC_WITH_REWARDS]: OPT_YVTBTC_WBTC_STAKING_CONTRACT,
[OPT_YVOP_WETH_WITH_REWARDS]: OPT_YVOP_WETH_STAKING_CONTRACT,
[OPT_YVWUSDRV2_USDC_WITH_REWARDS]: OPT_YVWUSDRV2_USDC_STAKING_CONTRACT
[OPT_YVWUSDRV2_USDC_WITH_REWARDS]: OPT_YVWUSDRV2_USDC_STAKING_CONTRACT,
[OPT_YVSTERN_ERN_WITH_REWARDS]: OPT_YVSTERN_ERN_STAKING_CONTRACT
};

1 comment on commit ef70d01

@vercel
Copy link

@vercel vercel bot commented on ef70d01 Oct 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.