diff --git a/src/components/Modals/TransactionsModal/TransactionStateModal.tsx b/src/components/Modals/TransactionsModal/TransactionStateModal.tsx
index f89d18b7..2cd94f4d 100644
--- a/src/components/Modals/TransactionsModal/TransactionStateModal.tsx
+++ b/src/components/Modals/TransactionsModal/TransactionStateModal.tsx
@@ -83,7 +83,7 @@ const TransactionStateModal: React.FC = () => {
{modalDetails?.trxState === TrxState.TransactionSuccessful ?
- "Transaction Succesful" :
+ "Transaction Successful" :
modalDetails?.trxState === TrxState.WaitingForConfirmation ?
modalDetails?.text ?? " Waiting for Confirmation" :
modalDetails?.trxState === TrxState.TransactionFailed ?
diff --git a/src/pages/AddLiquidity/index.tsx b/src/pages/AddLiquidity/index.tsx
index 55efa732..1f3aec19 100644
--- a/src/pages/AddLiquidity/index.tsx
+++ b/src/pages/AddLiquidity/index.tsx
@@ -55,7 +55,7 @@ import {
useUserGasPricePercentage,
useUpdateUserGasPreference,
} from "../../state/gas/hooks";
-import { clearSearchResult } from "../../state/farming/action";
+import { clearSearchResult } from "../../state/newFarming/action";
import {
GFailedTransaction,
GSuccessfullyTransaction,
diff --git a/src/pages/FarmingV2/ShowNewFarm.tsx b/src/pages/FarmingV2/ShowNewFarm.tsx
index b48ac615..1c46d24d 100644
--- a/src/pages/FarmingV2/ShowNewFarm.tsx
+++ b/src/pages/FarmingV2/ShowNewFarm.tsx
@@ -69,15 +69,13 @@ import {
} from "../../utils/addresses";
import {clearInputInfo, convertFromWei, convertToNumber} from "../../utils";
import {useRGPBalance} from "../../utils/hooks/useBalances";
-import {updateFarmAllowances} from "../../state/farm/actions";
+import { updateFarmAllowances } from "../../state/newfarm/actions";
import {useActiveWeb3React} from "../../utils/hooks/useActiveWeb3React";
import Joyride from "react-joyride";
import {steps} from "../../components/Onboarding/YieldSteps";
import {Contract} from "@ethersproject/contracts";
import {calculateGas} from "../Swap/components/sendToken";
import {useUserGasPricePercentage} from "../../state/gas/hooks";
-
-import {useFetchYieldFarmDetails, useUpdateFarm} from "../../state/newfarm/hooks";
import {useNewYieldFarmDetails, useUpdateNewFarm} from "../../state/LPFarm/hooks";
import {
GButtonClicked,
@@ -98,7 +96,7 @@ const ShowNewFarm = ({content, wallet, URLReferrerAddress, LoadingState, section
img: string;
ARYValue: string;
lpSymbol: string;
- tokensStaked: string[];
+ tokenStaked: string[];
availableToken: string;
deposit: string;
poolAllowance: any;
@@ -239,7 +237,7 @@ const ShowNewFarm = ({content, wallet, URLReferrerAddress, LoadingState, section
if (content.deposit === "RGP" && Number(content.id) === 1) {
const specialPoolV1Approval = await specialPoolV1Allowance(rgp);
changeApprovalButton(true, specialPoolV1Approval);
- } else if (content.deposit === "RGP" && Number(content.id) === 13) {
+ } else if (content.deposit === "RGP" && content.id === "special") {
const specialPoolV2Approval = await specialPoolV2Allowance(rgp);
changeApprovalButton(true, specialPoolV2Approval);
} else {
@@ -382,12 +380,12 @@ const ShowNewFarm = ({content, wallet, URLReferrerAddress, LoadingState, section
await RGPSpecialPoolV1Approval();
setApproveValueForOtherToken(true);
setApproveValueForRGP(true);
- } else if (content.deposit === "RGP" && Number(content.id) === 13) {
+ } else if (content.deposit === "RGP" && content.id === "special") {
await RGPSpecialPoolV2Approval();
setApproveValueForOtherToken(true);
setApproveValueForRGP(true);
} else {
- const pool = await smartSwapLPTokenPoolTwo(content.address, library);
+ const pool = await smartSwapLPTokenPoolTwo(content?.address, library);
if (!approveValueForOtherToken && !approveValueForRGP) {
await RGPApproval();
await LPApproval(pool,content.deposit);
@@ -622,7 +620,7 @@ const ShowNewFarm = ({content, wallet, URLReferrerAddress, LoadingState, section
return;
} else if (
Number(content.poolVersion) === 2 &&
- parseFloat(content.tokensStaked[1]) <= 0 &&
+ parseFloat(content.tokenStaked[1]) <= 0 &&
Number(depositTokenValue) < Number(minimumStakeAmount)
) {
setDepositInputHasError(true);
@@ -667,9 +665,7 @@ const ShowNewFarm = ({content, wallet, URLReferrerAddress, LoadingState, section
if (
parseFloat(unstakeToken) >
parseFloat(
- content.deposit === "RGP"
- ? content.tokensStaked[1]
- : content.tokenStaked[1]
+ content.tokenStaked[1]
)
) {
setInputHasError(true);
@@ -685,11 +681,7 @@ const ShowNewFarm = ({content, wallet, URLReferrerAddress, LoadingState, section
GButtonClicked(`max_button for ${input}`,content.deposit,"v2")
setDepositTokenValue(content.availableToken);
} else if (input === "unstake") {
- setUnstakeToken(
- content.deposit === "RGP"
- ? content.tokensStaked[1]
- : content.tokenStaked[1]
- );
+ setUnstakeToken(content.tokenStaked[1]);
}
} catch (e) {
console.log(
@@ -876,7 +868,7 @@ const ShowNewFarm = ({content, wallet, URLReferrerAddress, LoadingState, section
})
);
}
- } else if (id === 10793) {
+ } else if (id === "special") {
const specialPool = await RGPSpecialPool2(
RGPSPECIALPOOLADDRESSES2[chainId as number],
library
@@ -1102,7 +1094,7 @@ const ShowNewFarm = ({content, wallet, URLReferrerAddress, LoadingState, section
GFarmingSuccessTransaction("farming", "stake", val,"v2")
setDeposited(true);
setReload(true);
- setContentId(content.deposit === "RGP" ? undefined : content.id);
+ // setContentId(content.deposit === "RGP" ? undefined : content.id);
// callRefreshFarm(confirmations, status);
}
} catch (error: any) {
@@ -1595,11 +1587,11 @@ const ShowNewFarm = ({content, wallet, URLReferrerAddress, LoadingState, section
>
- {parseFloat(content.tokensStaked[1]).toFixed(4)}
+ {parseFloat(content.tokenStaked[1]).toFixed(4)}
{
- harvestTokens(
- content.deposit === "RGP" ? content.pId : content.id
+ harvestTokens(content.id
);
}}
className={"harvest"}
@@ -1839,7 +1830,7 @@ const ShowNewFarm = ({content, wallet, URLReferrerAddress, LoadingState, section
label={
content?.type !== "RGP"
? content?.tokenStaked[1]
- : content.tokensStaked[1]
+ : content.tokenStaked[1]
}
bg='gray.300'
color='black'
@@ -1847,7 +1838,7 @@ const ShowNewFarm = ({content, wallet, URLReferrerAddress, LoadingState, section
{parseFloat(
content.type !== "RGP"
? content?.tokenStaked[1]
- : content.tokensStaked[1]
+ : content.tokenStaked[1]
).toFixed(4)}
@@ -1874,7 +1865,7 @@ const ShowNewFarm = ({content, wallet, URLReferrerAddress, LoadingState, section
parseFloat(
content.type !== "RGP"
? content.tokenStaked[1]
- : content.tokensStaked[1]
+ : content.tokenStaked[1]
) <= 0
}
padding='10px 40px'
@@ -1960,9 +1951,7 @@ const ShowNewFarm = ({content, wallet, URLReferrerAddress, LoadingState, section
_hover={{ color: "white" }}
disabled={parseFloat(content.RGPEarned) <= 0}
onClick={() => {
- harvestTokens(
- content.deposit === "RGP" ? content.pId : content.id
- );
+ harvestTokens(content.id);
}}
className={"harvest"}
>
@@ -1999,9 +1988,7 @@ const ShowNewFarm = ({content, wallet, URLReferrerAddress, LoadingState, section
_hover={{ color: "white" }}
disabled={parseFloat(content.RGPEarned) <= 0}
onClick={() => {
- harvestTokens(
- content.deposit === "RGP" ? content.pId : content.id
- );
+ harvestTokens(content.id);
}}
className={"harvest"}
>
@@ -2517,7 +2504,7 @@ const ShowNewFarm = ({content, wallet, URLReferrerAddress, LoadingState, section
{`${
content.type === "RGP"
- ? content.tokensStaked[1]
+ ? content.tokenStaked[1]
: content.tokenStaked[1]
}
${content.deposit} Staked `}
diff --git a/src/pages/FarmingV2/ShowProductFarmDetails.tsx b/src/pages/FarmingV2/ShowProductFarmDetails.tsx
index 58a5563a..674a6962 100644
--- a/src/pages/FarmingV2/ShowProductFarmDetails.tsx
+++ b/src/pages/FarmingV2/ShowProductFarmDetails.tsx
@@ -37,7 +37,7 @@ import {
} from "../../utils/addresses";
import { clearInputInfo, convertFromWei, convertToNumber } from "../../utils";
import { useRGPBalance } from "../../utils/hooks/useBalances";
-import { updateFarmProductAllowances } from "../../state/farm/actions";
+import { updateFarmProductAllowances } from "../../state/newfarm/actions";
import { useActiveWeb3React } from "../../utils/hooks/useActiveWeb3React";
import { Contract } from "@ethersproject/contracts";
import { formatAmount, getERC20Token } from "../../utils/utilsFunctions";
@@ -679,11 +679,11 @@ return (
>
{/*
- {parseFloat(content.tokensStaked[1]).toFixed(4)}
+ {parseFloat(content.tokenStaked[1]).toFixed(4)}
*/}
{content.RGPStaked}
diff --git a/src/pages/FarmingV2/ShowYieldFarmDetails.tsx b/src/pages/FarmingV2/ShowYieldFarmDetails.tsx
index ce865f25..64959715 100644
--- a/src/pages/FarmingV2/ShowYieldFarmDetails.tsx
+++ b/src/pages/FarmingV2/ShowYieldFarmDetails.tsx
@@ -32,7 +32,6 @@ import {DARK_THEME, farmSection} from "./index";
import {addToast} from "../../components/Toast/toastSlice";
import {useDispatch, useSelector} from "react-redux";
import {setOpenModal, TrxState} from "../../state/application/reducer";
-import { setLoadingState } from "../../state/farm/actions";
import {ExplorerDataType, getExplorerLink} from "../../utils/getExplorerLink";
import {
MasterChefV2Contract,
@@ -51,7 +50,7 @@ import {
} from "../../utils/addresses";
import {clearInputInfo, convertFromWei, convertToNumber} from "../../utils";
import {useRGPBalance} from "../../utils/hooks/useBalances";
-import {updateFarmAllowances} from "../../state/farm/actions";
+import { updateFarmAllowances } from "../../state/newfarm/actions";
import {useActiveWeb3React} from "../../utils/hooks/useActiveWeb3React";
import Joyride from "react-joyride";
import {steps} from "../../components/Onboarding/YieldSteps";
@@ -87,7 +86,7 @@ const ShowYieldFarmDetails = ({
img: string;
ARYValue: string;
lpSymbol: string;
- tokensStaked: string[];
+ tokenStaked: string[];
availableToken: string;
deposit: string;
poolAllowance: any;
@@ -143,24 +142,14 @@ const ShowYieldFarmDetails = ({
const [contentid, setContentId] = useState(undefined);
const [loading, setLoading] = useState(true);
- // const data = useGetFarmData(reload, setReload);
-
-
const {loadingState} = useUpdateFarm({reload, setReload, content});
useFetchYieldFarmDetails({content, section, setLoading, loading});
- //const {loadingFarm} = useUpdateNewFarm({reload, setReload, content});
-
- // useNewYieldFarmDetails({content, section, setLoading, loading});
-
-
-
const closeModal = () => {
GButtonIntialized("close unstaked",content.deposit,"v2")
modal2Disclosure.onClose();
};
- // useUpdate(reload, setReload, contentid, setContentId);
const [userGasPricePercentage] = useUserGasPricePercentage();
const handleSetReferralField = () => {
if (showReferrerField === true && URLReferrerAddress === "") {
@@ -179,7 +168,7 @@ const ShowYieldFarmDetails = ({
};
useEffect(()=>{
const checkEnoughApproval = (allowance: any, balance: any) => {
- // console.log("checkEnoughApproval",allowance.toString(),balance);
+ console.log({allowance,balance})
if (allowance && balance) {
let approve = parseFloat(allowance) >= parseFloat(depositTokenValue);
@@ -224,7 +213,6 @@ useEffect(()=>{
account,
RGPSPECIALPOOLADDRESSES2[chainId as number]
);
- console.log({rgpApproval})
return !(rgpApproval.toString() <= 0);
}
};
@@ -235,7 +223,7 @@ useEffect(()=>{
if (content.deposit === "RGP" && Number(content.id) === 1) {
const specialPoolV1Approval = await specialPoolV1Allowance(rgp);
changeApprovalButton(true, specialPoolV1Approval);
- } else if (content.deposit === "RGP" && Number(content.id) === 13) {
+ } else if (content.deposit === "RGP" && content.id=== "special") {
const specialPoolV2Approval = await specialPoolV2Allowance(rgp);
@@ -243,7 +231,6 @@ useEffect(()=>{
} else {
const pool = await smartSwapLPTokenPoolTwo(content.address, library);
const approvalForRGPBNB = await poolAllowance(pool);
- console.log({approvalForRGPBNB,rgpApproval})
changeApprovalButton(approvalForRGPBNB, rgpApproval);
}
};
@@ -382,7 +369,7 @@ useEffect(()=>{
await RGPSpecialPoolV1Approval();
setApproveValueForOtherToken(true);
setApproveValueForRGP(true);
- } else if (content.deposit === "RGP" && Number(content.id) === 13) {
+ } else if (content.deposit === "RGP" && content.id === "special") {
await RGPSpecialPoolV2Approval();
setApproveValueForOtherToken(true);
setApproveValueForRGP(true);
@@ -535,7 +522,7 @@ useEffect(()=>{
return;
} else if (
Number(content.poolVersion) === 2 &&
- parseFloat(content.tokensStaked[1]) <= 0 &&
+ parseFloat(content.tokenStaked[1]) <= 0 &&
Number(depositTokenValue) < Number(minimumStakeAmount)
) {
setDepositInputHasError(true);
@@ -581,7 +568,7 @@ useEffect(()=>{
parseFloat(unstakeToken) >
parseFloat(
content.deposit === "RGP"
- ? content.tokensStaked[1]
+ ? content.tokenStaked[1]
: content.tokenStaked[1]
)
) {
@@ -598,11 +585,7 @@ useEffect(()=>{
GButtonClicked(`max_button for ${input}`,content.deposit,"v2")
setDepositTokenValue(content.availableToken);
} else if (input === "unstake") {
- setUnstakeToken(
- content.deposit === "RGP"
- ? content.tokensStaked[1]
- : content.tokenStaked[1]
- );
+ setUnstakeToken(content.tokenStaked[1]);
}
} catch (e) {
console.log(
@@ -626,7 +609,7 @@ useEffect(()=>{
if (account) {
if (val === "RGP" && Number(content.id) === 1) {
await RGPUnstake(val);
- } else if (val === "RGP" && Number(content.id) === 13) {
+ } else if (val === "RGP" && content.id === "special") {
await RGPUnstakeV2(val);
} else {
tokensWithdrawal(content.id,val);
@@ -789,7 +772,7 @@ useEffect(()=>{
})
);
}
- } else if (id === 10793) {
+ } else if (id === "special") {
const specialPool = await RGPSpecialPool2(
RGPSPECIALPOOLADDRESSES2[chainId as number],
library
@@ -1046,7 +1029,7 @@ useEffect(()=>{
if (account) {
if (val === "RGP" && Number(content.id) === 1) {
await RGPuseStake();
- } else if (val === "RGP" && Number(content.id) === 13) {
+ } else if (val === "RGP" && content.id=== "special") {
await RGPuseStakeV2();
} else {
LPDeposit(content.id,val);
@@ -1147,7 +1130,6 @@ useEffect(()=>{
await fetchTransactionData(data);
GFarmingSuccessTransaction("special pool", "stake", "RGP","v2") //122
- refreshSpecialData()
dispatch(
setOpenModal({
@@ -1155,6 +1137,8 @@ useEffect(()=>{
message: `Successfully staked ${depositTokenValue} RGP `,
})
);
+
+ // refreshSpecialData()
// callRefreshFarm(confirmations, status);
setReload(true);
} catch (error:any) {
@@ -1206,7 +1190,6 @@ useEffect(()=>{
: ethers.utils.parseUnits(format3, 9).toString(),
}
);
- const { confirmations, status } = await fetchTransactionData(data);
GFarmingSuccessTransaction("special pool", "unstake", "RGP","v1")
dispatch(
setOpenModal({
@@ -1215,6 +1198,7 @@ useEffect(()=>{
})
);
refreshSpecialData()
+ // setReload(true)
// dispatch the getTokenStaked action from here when data changes
// callRefreshFarm(confirmations, status);
} catch (e:any) {
@@ -1274,8 +1258,6 @@ useEffect(()=>{
);
refreshSpecialData()
- // dispatch the getTokenStaked action from here when data changes
- // callRefreshFarm(confirmations, status);
} catch (error:any) {
GFarmingFailedTransaction("special pool", "unstake", error.message, "RGP","v2")
dispatch(
@@ -1418,16 +1400,16 @@ useEffect(()=>{