From 1765a2b89ce2cb7a875670c9beaef319ba40ef96 Mon Sep 17 00:00:00 2001 From: t0rbik Date: Wed, 7 Aug 2024 16:01:19 +0200 Subject: [PATCH] constants consistency --- src/components/farms/Farms.tsx | 4 ++-- src/components/farms/row/CurveFarmContent.tsx | 12 ++++++------ src/components/farms/row/ExitButton.tsx | 8 ++++---- src/components/farms/row/InternalFarmContent.tsx | 12 ++++++------ src/components/farms/row/SushiFarmContent.tsx | 12 ++++++------ src/components/transmuters/Transmuters.tsx | 6 +++--- src/lib/config/externalLiquidityProviders.ts | 12 ++++++------ src/lib/config/farms.ts | 10 +++++----- src/lib/config/rewardRouterAddresses.ts | 6 +++--- src/lib/middleware/bonuses.ts | 14 +++++++------- src/lib/queries/farms/useCurveFarm.ts | 12 ++++++------ src/lib/queries/farms/useInternalFarms.ts | 8 ++++---- src/lib/queries/farms/useSushiFarm.ts | 16 ++++++++-------- 13 files changed, 66 insertions(+), 66 deletions(-) diff --git a/src/components/farms/Farms.tsx b/src/components/farms/Farms.tsx index 17f0581b..8e3fe743 100644 --- a/src/components/farms/Farms.tsx +++ b/src/components/farms/Farms.tsx @@ -9,7 +9,7 @@ import { useInternalFarms } from "@/lib/queries/farms/useInternalFarms"; import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Accordion } from "@/components/ui/accordion"; import { FarmsAccordionRow } from "./row/FarmsAccordionRow"; -import { staticExternalFarms } from "@/lib/config/farms"; +import { STATIC_EXTERNAL_FARMS } from "@/lib/config/farms"; import { LiquidityMigration } from "./LiquidityMigration"; import { GAlcsWrapper } from "./GAlcxWrapper"; import { windowOpen } from "@/utils/windowOpen"; @@ -89,7 +89,7 @@ export const Farms = () => {

External Farms

- {staticExternalFarms.map((farm) => ( + {STATIC_EXTERNAL_FARMS.map((farm) => (
{ const { address = zeroAddress } = useAccount(); const { data: withdrawBalance, queryKey: balanceQueryKey } = useReadContract({ - address: curve.gauge, + address: CURVE.gauge, abi: curveGaugeAbi, chainId: chain.id, functionName: "balanceOf", @@ -51,13 +51,13 @@ export const CurveFarmContent = ({ farm }: { farm: Farm }) => { //-- Deposit --// const { isApprovalNeeded, approveConfig, approve } = useAllowance({ tokenAddress: farm.poolTokenAddress, - spender: curve.gauge, + spender: CURVE.gauge, amount: depositAmount, decimals: 18, }); const { data: depositConfig } = useSimulateContract({ - address: curve.gauge, + address: CURVE.gauge, abi: curveGaugeAbi, chainId: chain.id, functionName: "deposit", @@ -93,7 +93,7 @@ export const CurveFarmContent = ({ farm }: { farm: Farm }) => { //-- Withdraw --// const { data: withdrawConfig } = useSimulateContract({ - address: curve.gauge, + address: CURVE.gauge, abi: curveGaugeAbi, chainId: chain.id, functionName: "withdraw", @@ -125,7 +125,7 @@ export const CurveFarmContent = ({ farm }: { farm: Farm }) => { //-- Claim --// const { data: claimConfig } = useSimulateContract({ - address: curve.gauge, + address: CURVE.gauge, abi: curveGaugeAbi, chainId: chain.id, functionName: "claim_rewards", diff --git a/src/components/farms/row/ExitButton.tsx b/src/components/farms/row/ExitButton.tsx index 215684d9..8b7d199e 100644 --- a/src/components/farms/row/ExitButton.tsx +++ b/src/components/farms/row/ExitButton.tsx @@ -4,7 +4,7 @@ import { sushiMasterchefAbi } from "@/abi/sushiMasterchef"; import { Button } from "@/components/ui/button"; import { useChain } from "@/hooks/useChain"; import { useWriteContractMutationCallback } from "@/hooks/useWriteContractMutationCallback"; -import { curve, stakingPoolsAddresses, sushi } from "@/lib/config/farms"; +import { CURVE, STAKING_POOL_ADDRESSES, SUSHI } from "@/lib/config/farms"; import { QueryKeys } from "@/lib/queries/queriesSchema"; import { Farm } from "@/lib/types"; import { useQueryClient } from "@tanstack/react-query"; @@ -29,7 +29,7 @@ export const ExitButton = ({ farm }: { farm: Farm }) => { //-- Internal --// const { data: internalExitConfig, error: internalError } = useSimulateContract({ - address: stakingPoolsAddresses[mainnet.id], + address: STAKING_POOL_ADDRESSES[mainnet.id], abi: stakingPoolsAbi, chainId: chain.id, functionName: "exit", @@ -57,7 +57,7 @@ export const ExitButton = ({ farm }: { farm: Farm }) => { //-- Sushi --// const { data: sushiExitConfig, error: sushiError } = useSimulateContract({ - address: sushi.masterchef, + address: SUSHI.masterchef, abi: sushiMasterchefAbi, chainId: chain.id, functionName: "emergencyWithdraw", @@ -84,7 +84,7 @@ export const ExitButton = ({ farm }: { farm: Farm }) => { //-- Curve --// const { data: curveExitConfig, error: curveError } = useSimulateContract({ - address: curve.gauge, + address: CURVE.gauge, abi: curveGaugeAbi, chainId: chain.id, functionName: "withdraw", diff --git a/src/components/farms/row/InternalFarmContent.tsx b/src/components/farms/row/InternalFarmContent.tsx index db524b0a..02d14c51 100644 --- a/src/components/farms/row/InternalFarmContent.tsx +++ b/src/components/farms/row/InternalFarmContent.tsx @@ -2,7 +2,7 @@ import { stakingPoolsAbi } from "@/abi/stakingPools"; import { useAllowance } from "@/hooks/useAllowance"; import { useChain } from "@/hooks/useChain"; import { useWatchQuery } from "@/hooks/useWatchQuery"; -import { stakingPoolsAddresses } from "@/lib/config/farms"; +import { STAKING_POOL_ADDRESSES } from "@/lib/config/farms"; import { QueryKeys } from "@/lib/queries/queriesSchema"; import { Farm } from "@/lib/types"; import { isInputZero } from "@/utils/inputNotZero"; @@ -36,7 +36,7 @@ export const InternalFarmContent = ({ farm }: { farm: Farm }) => { const { address = zeroAddress } = useAccount(); const { data: withdrawBalance, queryKey: balanceQueryKey } = useReadContract({ - address: stakingPoolsAddresses[mainnet.id], + address: STAKING_POOL_ADDRESSES[mainnet.id], abi: stakingPoolsAbi, chainId: chain.id, functionName: "getStakeTotalDeposited", @@ -52,13 +52,13 @@ export const InternalFarmContent = ({ farm }: { farm: Farm }) => { //-- Deposit --// const { isApprovalNeeded, approveConfig, approve } = useAllowance({ tokenAddress: farm.poolTokenAddress, - spender: stakingPoolsAddresses[mainnet.id], + spender: STAKING_POOL_ADDRESSES[mainnet.id], amount: depositAmount, decimals: 18, }); const { data: depositConfig } = useSimulateContract({ - address: stakingPoolsAddresses[mainnet.id], + address: STAKING_POOL_ADDRESSES[mainnet.id], abi: stakingPoolsAbi, chainId: chain.id, functionName: "deposit", @@ -94,7 +94,7 @@ export const InternalFarmContent = ({ farm }: { farm: Farm }) => { //-- Withdraw --// const { data: withdrawConfig } = useSimulateContract({ - address: stakingPoolsAddresses[mainnet.id], + address: STAKING_POOL_ADDRESSES[mainnet.id], abi: stakingPoolsAbi, chainId: chain.id, functionName: "withdraw", @@ -126,7 +126,7 @@ export const InternalFarmContent = ({ farm }: { farm: Farm }) => { //-- Claim --// const { data: claimConfig } = useSimulateContract({ - address: stakingPoolsAddresses[mainnet.id], + address: STAKING_POOL_ADDRESSES[mainnet.id], abi: stakingPoolsAbi, chainId: chain.id, functionName: "claim", diff --git a/src/components/farms/row/SushiFarmContent.tsx b/src/components/farms/row/SushiFarmContent.tsx index c2261254..ae5c6009 100644 --- a/src/components/farms/row/SushiFarmContent.tsx +++ b/src/components/farms/row/SushiFarmContent.tsx @@ -1,7 +1,7 @@ import { useAllowance } from "@/hooks/useAllowance"; import { useChain } from "@/hooks/useChain"; import { useWatchQuery } from "@/hooks/useWatchQuery"; -import { sushi } from "@/lib/config/farms"; +import { SUSHI } from "@/lib/config/farms"; import { QueryKeys } from "@/lib/queries/queriesSchema"; import { Farm } from "@/lib/types"; import { isInputZero } from "@/utils/inputNotZero"; @@ -35,7 +35,7 @@ export const SushiFarmContent = ({ farm }: { farm: Farm }) => { const { address = zeroAddress } = useAccount(); const { data: withdrawBalance, queryKey: balanceQueryKey } = useReadContract({ - address: sushi.masterchef, + address: SUSHI.masterchef, abi: sushiMasterchefAbi, chainId: chain.id, functionName: "userInfo", @@ -51,13 +51,13 @@ export const SushiFarmContent = ({ farm }: { farm: Farm }) => { //-- Deposit --// const { isApprovalNeeded, approveConfig, approve } = useAllowance({ tokenAddress: farm.poolTokenAddress, - spender: sushi.masterchef, + spender: SUSHI.masterchef, amount: depositAmount, decimals: 18, }); const { data: depositConfig } = useSimulateContract({ - address: sushi.masterchef, + address: SUSHI.masterchef, abi: sushiMasterchefAbi, chainId: chain.id, functionName: "deposit", @@ -93,7 +93,7 @@ export const SushiFarmContent = ({ farm }: { farm: Farm }) => { //-- Withdraw --// const { data: withdrawConfig } = useSimulateContract({ - address: sushi.masterchef, + address: SUSHI.masterchef, abi: sushiMasterchefAbi, chainId: chain.id, functionName: "withdraw", @@ -125,7 +125,7 @@ export const SushiFarmContent = ({ farm }: { farm: Farm }) => { //-- Claim --// const { data: claimConfig } = useSimulateContract({ - address: sushi.masterchef, + address: SUSHI.masterchef, abi: sushiMasterchefAbi, chainId: chain.id, functionName: "harvest", diff --git a/src/components/transmuters/Transmuters.tsx b/src/components/transmuters/Transmuters.tsx index e63823bb..e1b0d952 100644 --- a/src/components/transmuters/Transmuters.tsx +++ b/src/components/transmuters/Transmuters.tsx @@ -7,7 +7,7 @@ import { useChain } from "@/hooks/useChain"; import { TransmuterAccordionRow } from "@/components/transmuters/row/TransmuterAccordionRow"; import { useTransmuters } from "@/lib/queries/useTransmuters"; import { Button } from "../ui/button"; -import { externalLiquidityProviders } from "@/lib/config/externalLiquidityProviders"; +import { EXTERNAL_LIQUIDITY_PROVIDERS } from "@/lib/config/externalLiquidityProviders"; import { windowOpen } from "@/utils/windowOpen"; import { LoadingBar } from "../common/LoadingBar"; import { ScrollArea, ScrollBar } from "../ui/scroll-area"; @@ -53,12 +53,12 @@ export const Transmuters = () => {

- {externalLiquidityProviders[chain.id].map((provider) => ( + {EXTERNAL_LIQUIDITY_PROVIDERS[chain.id].map((provider) => (