diff --git a/frontend/config/stakingPrograms/gnosis.ts b/frontend/config/stakingPrograms/gnosis.ts index 5036cecab..7c472c917 100644 --- a/frontend/config/stakingPrograms/gnosis.ts +++ b/frontend/config/stakingPrograms/gnosis.ts @@ -23,7 +23,7 @@ export const GNOSIS_STAKING_PROGRAMS_CONTRACT_ADDRESSES: Record< [StakingProgramId.PearlBeta5]: '0x4Abe376Fda28c2F43b84884E5f822eA775DeA9F4', [StakingProgramId.PearlBetaMechMarketplace]: '0xDaF34eC46298b53a3d24CBCb431E84eBd23927dA', -}; +} as const; export const GNOSIS_STAKING_PROGRAMS: StakingProgramMap = { [StakingProgramId.PearlAlpha]: { @@ -134,4 +134,4 @@ export const GNOSIS_STAKING_PROGRAMS: StakingProgramMap = { STAKING_TOKEN_PROXY_ABI, ), }, -}; +} as const; diff --git a/frontend/service/agents/Memeooor.ts b/frontend/service/agents/Memeooor.ts index 274be93ae..0bad22d35 100644 --- a/frontend/service/agents/Memeooor.ts +++ b/frontend/service/agents/Memeooor.ts @@ -2,6 +2,7 @@ import { ethers } from 'ethers'; import { formatEther } from 'ethers/lib/utils'; import { STAKING_PROGRAMS } from '@/config/stakingPrograms'; +import { BASE_STAKING_PROGRAMS } from '@/config/stakingPrograms/base'; import { PROVIDERS } from '@/constants/providers'; import { EvmChainId } from '@/enums/Chain'; import { StakingProgramId } from '@/enums/StakingProgram'; @@ -14,9 +15,6 @@ import { import { ONE_YEAR, StakedAgentService } from './StakedAgentService'; -// TODO: move to common place, enums/StakingProgram.ts? -const MEMEOOORR_STAKING_PROGRAMS_IDS = [StakingProgramId.MemeBaseAlpha]; - export abstract class MemeooorBaseService extends StakedAgentService { static getAgentStakingRewardsInfo = async ({ agentMultisigAddress, @@ -187,12 +185,8 @@ export abstract class MemeooorBaseService extends StakedAgentService { ): Promise => { const { multicallProvider } = PROVIDERS[chainId]; - if (!MEMEOOORR_STAKING_PROGRAMS_IDS.includes(stakingProgramId)) { - return; - } - - const stakingTokenProxy = - STAKING_PROGRAMS[chainId][stakingProgramId]?.contract; + const stakingTokenProxy = BASE_STAKING_PROGRAMS[stakingProgramId]?.contract; + if (!stakingTokenProxy) return; const contractCalls = [ stakingTokenProxy.availableRewards(), diff --git a/frontend/service/agents/PredictTrader.ts b/frontend/service/agents/PredictTrader.ts index bf4708051..8ea6aeb5e 100644 --- a/frontend/service/agents/PredictTrader.ts +++ b/frontend/service/agents/PredictTrader.ts @@ -2,6 +2,7 @@ import { ethers } from 'ethers'; import { formatEther } from 'ethers/lib/utils'; import { STAKING_PROGRAMS } from '@/config/stakingPrograms'; +import { GNOSIS_STAKING_PROGRAMS } from '@/config/stakingPrograms/gnosis'; import { PROVIDERS } from '@/constants/providers'; import { EvmChainId } from '@/enums/Chain'; import { StakingProgramId } from '@/enums/StakingProgram'; @@ -16,17 +17,6 @@ import { ONE_YEAR, StakedAgentService } from './StakedAgentService'; const MECH_REQUESTS_SAFETY_MARGIN = 1; -// TODO: move to common place, enums/StakingProgram.ts? -const PREDICT_TRADER_STAKING_PROGRAM_IDS = [ - StakingProgramId.PearlAlpha, - StakingProgramId.PearlBeta, - StakingProgramId.PearlBeta2, - StakingProgramId.PearlBeta3, - StakingProgramId.PearlBeta4, - StakingProgramId.PearlBeta5, - StakingProgramId.PearlBetaMechMarketplace, -]; - export abstract class PredictTraderService extends StakedAgentService { static getAgentStakingRewardsInfo = async ({ agentMultisigAddress, @@ -198,11 +188,9 @@ export abstract class PredictTraderService extends StakedAgentService { ): Promise => { const { multicallProvider } = PROVIDERS[chainId]; const stakingTokenProxy = - STAKING_PROGRAMS[chainId][stakingProgramId]?.contract; + GNOSIS_STAKING_PROGRAMS[stakingProgramId]?.contract; - if (!PREDICT_TRADER_STAKING_PROGRAM_IDS.includes(stakingProgramId)) { - return Promise.resolve(undefined); - } + if (!stakingTokenProxy) return; const contractCalls = [ stakingTokenProxy.availableRewards(),