diff --git a/package.json b/package.json index d824fdb..48b0649 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ghost-dao-interface", "private": true, - "version": "0.8.6", + "version": "0.8.7", "type": "module", "scripts": { "dev": "vite", diff --git a/src/constants.ts b/src/constants.ts index 0109acf..e1798f8 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -26,18 +26,7 @@ export const isNetworkAvailable = (chainId, addressChainId) => { } export const isNetworkLegacy = (chainId) => { - let isLegacy = false; - switch (chainId) { - case 11155111: - isLegacy = true - break; - case 63: - isLegacy = true - break; - default: - break; - } - return isLegacy; + return false; } export const isNetworkLegacyType = (chainId) => { diff --git a/src/containers/Bond/components/BondConfirmModal.jsx b/src/containers/Bond/components/BondConfirmModal.jsx index 42f344e..a62c253 100644 --- a/src/containers/Bond/components/BondConfirmModal.jsx +++ b/src/containers/Bond/components/BondConfirmModal.jsx @@ -144,7 +144,7 @@ export const BondConfirmModal = ({ isNative }); - if (txHash) tryStoreInHistory(chainId, sender, CONSTANTS.bond.key, txHash, CONSTANTS.bond.name); + if (txHash) tryStoreInHistory(chainId, sender, CONSTANTS.bond.key, txHash, CONSTANTS.bond.bond); setIsPending(false); handleConfirmCloseMaster(); diff --git a/src/containers/Bond/components/ClaimBonds.jsx b/src/containers/Bond/components/ClaimBonds.jsx index 49321c6..dbebc7e 100644 --- a/src/containers/Bond/components/ClaimBonds.jsx +++ b/src/containers/Bond/components/ClaimBonds.jsx @@ -23,6 +23,7 @@ import { useNotes, redeem, forceRedeem } from "../../../hooks/bonds"; import { useTokenSymbol } from "../../../hooks/tokens"; import { useGhstPrice } from "../../../hooks/prices"; import { useBreakoutModal } from "../../../hooks/breakoutModal"; +import { useLocalStorage } from "../../../hooks/localstorage"; export const ClaimBonds = ({ chainId, address, secondsTo }) => { const isSmallScreen = useScreenSize("md"); @@ -33,6 +34,7 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => { const [isPayoutGhst, _] = useState(true); const ghstPrice = useGhstPrice(chainId); + const { tryStoreInHistory, CONSTANTS } = useLocalStorage(); const { breakoutFromBonding } = useBreakoutModal(); const { epoch } = useEpoch(chainId); const { warmupExists } = useWarmupLength(chainId); @@ -59,8 +61,9 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => { setPendingIndexes(indexes); const defaultFunction = async () => { - await redeem({ chainId, user: address, isGhst: isPayoutGhst, indexes }); - await notesRefetch(); + const txHash = await redeem({ chainId, user: address, isGhst: isPayoutGhst, indexes }); + if (txHash) tryStoreInHistory(chainId, address, CONSTANTS.bond.key, txHash, CONSTANTS.bond.claim); + return txHash; }; if (isNetworkLegacy(chainId)) { @@ -79,11 +82,13 @@ export const ClaimBonds = ({ chainId, address, secondsTo }) => { const toExecute = async (receiver) => { const txHash = await forceRedeem({ chainId, user: address, receiver, indexes }); + if (txHash) tryStoreInHistory(chainId, address, CONSTANTS.bridgeIn.key, txHash, CONSTANTS.bridgeIn.name); return txHash; } breakoutFromBonding({ defaultFunction, toExecute, amount, warmupLeft }) } + setPendingIndexes([]); setIsPending(false); } diff --git a/src/containers/Breakout/BreakoutModal.jsx b/src/containers/Breakout/BreakoutModal.jsx index 8d39509..e62bff4 100644 --- a/src/containers/Breakout/BreakoutModal.jsx +++ b/src/containers/Breakout/BreakoutModal.jsx @@ -1,6 +1,6 @@ +import useSWR from 'swr'; import { useMemo, useState, useCallback, useEffect } from "react"; -import { Box, Typography, Link, Checkbox, FormControlLabel, useTheme } from "@mui/material"; -import { useNavigate } from 'react-router-dom'; +import { Box, Typography, Link, Checkbox, FormControlLabel, Skeleton, useTheme } from "@mui/material"; import { getBlockNumber } from "@wagmi/core"; import { useConfig } from "wagmi"; import { ss58Decode } from "@polkadot-labs/hdkd-helpers"; @@ -10,34 +10,57 @@ import CancelIcon from '@mui/icons-material/Cancel'; import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown'; import { CheckBoxOutlineBlank, CheckBoxOutlined } from "@mui/icons-material"; +import { BridgeGhostAddressCard } from "../Bridge/BridgeGhostAddress"; import Metric from "../../components/Metric/Metric"; import Modal from "../../components/Modal/Modal"; -import SwapCard from "../../components/Swap/SwapCard"; import Token from "../../components/Token/Token"; import GhostStyledIcon from "../../components/Icon/GhostIcon"; import { PrimaryButton, SecondaryButton } from "../../components/Button"; import { GATEKEEPER_ADDRESSES, EMPTY_ADDRESS } from "../../constants/addresses"; import { GHOST_CONNECT } from "../../constants/ecosystem"; -import { bridgeNumbers } from "../../constants"; +import { networkAvgBlockSpeed, bridgeNumbers } from "../../constants"; import { useLocalStorage } from "../../hooks/localstorage"; import { useBreakoutModal } from "../../hooks/breakoutModal"; import { useTokenSymbol } from "../../hooks/tokens"; -import { useEpoch, useGatekeeperApy, useGatekeeperAddress } from "../../hooks/staking"; +import { useEpoch, useGatekeeperApy, useGatekeeperMinimum, useGatekeeperAddress } from "../../hooks/staking"; import { useEvmNetwork, useCurrentIndex, useUnstableProvider } from "../../hooks/ghost"; import { formatNumber, shorten } from "../../helpers"; import { prettifySecondsInDays } from "../../helpers/timeUtil"; import { DecimalBigNumber } from "../../helpers/DecimalBigNumber"; const BreakoutModal = ({ chainId, address }) => { + const { casperApi, account } = useUnstableProvider(); + const [step, setStep] = useState(0); - const [receiver, setReceiver] = useState(""); + const [isPending, setIsPending] = useState(false); + const [receiver, setReceiver] = useState(account); const [convertedReceiver, setConvertedReceiver] = useState(undefined); const { symbol: ghstSymbol } = useTokenSymbol(chainId, "GHST"); const { symbol: ftsoSymbol } = useTokenSymbol(chainId, "FTSO"); - const evmNetwork = useEvmNetwork({ evmChainId: chainId }); + const { gatekeeperAddress } = useGatekeeperAddress(chainId); + + const { data: networkData, isLoading: isNetworkDataLoading } = useSWR( + casperApi ? ['networkData', casperApi, chainId] : null, + async () => { + const key = BigInt(chainId); + const res = await casperApi.query.GhostNetworks.Networks.getValue(key); + return res; + }, + ); + + const incomingFee = useMemo(() => { + const hundredPercent = 10000000; + const incomingShare = networkData ? networkData.incoming_share : 0; + return incomingShare / hundredPercent; + }, [networkData]); + + const gatekeepersMatch = useMemo(() => { + if (!networkData) return false; + return gatekeeperAddress.toUpperCase() == toHex(networkData.gatekeeper).toUpperCase(); + }, [gatekeeperAddress, networkData]); const { isOpened, @@ -45,28 +68,21 @@ const BreakoutModal = ({ chainId, address }) => { isStakingOpened, isClaimBondOpened, warmupPeriod, - setActiveTxIndex, defaultFunction, executableFunction, estimatedAmount } = useBreakoutModal(); - const incomingFee = useMemo(() => { - return new DecimalBigNumber( - evmNetwork ? evmNetwork.incoming_fee : 100000000, - 7 - ); - }, [evmNetwork]); - const closeModal = () => { - setActiveTxIndex(-1); closeModalPure(); } const closeModalPure = () => { - setStep(0); - setReceiver(""); - closeModalInner(); + if (!isPending) { + setStep(0); + setReceiver(""); + closeModalInner(); + } } const header = useMemo(() => { @@ -92,7 +108,12 @@ const BreakoutModal = ({ chainId, address }) => { - {step === 0 ? header : step === 1 ? `Start ${bridgeNumbers()} ${"Stake\u00B2"}` : "Bridge Confirmation"} + + {step === 0 ? header : step === 1 + ? `Start ${bridgeNumbers()} ${"Stake\u00B2"}` + : "Bridge Confirmation" + } + } open={isOpened} @@ -105,13 +126,18 @@ const BreakoutModal = ({ chainId, address }) => { ? setStep(1)} closeModal={closeModal} + incomingFee={incomingFee} + estimatedAmount={estimatedAmount} + gatekeepersMatch={gatekeepersMatch} + isNetworkDataLoading={isNetworkDataLoading} /> : step === 1 ? { bridgeNumbers={bridgeNumbers()} ghstSymbol={ghstSymbol} estimatedAmount={estimatedAmount} - incomingFee={incomingFee} goNext={() => setStep(2)} convertedReceiver={convertedReceiver} setConvertedReceiver={setConvertedReceiver} + incomingFee={incomingFee} + networkData={networkData} + gatekeepersMatch={gatekeepersMatch} + gatekeeperAddress={gatekeeperAddress} /> : } @@ -148,121 +178,25 @@ const BreakoutModal = ({ chainId, address }) => { ) } -const BridgeView = ({ - chainId, - receiver, - setReceiver, - convertedReceiver, - setConvertedReceiver, - bridgeNumbers, - ghstSymbol, - estimatedAmount, - goNext, - incomingFee -}) => { - const theme = useTheme(); - const [inputFocused, setInputFocused] = useState(false); - - const config = useConfig(); - const { gatekeeperAddress } = useGatekeeperAddress(chainId); - - const chainExplorerUrl = useMemo(() => { - const client = config?.getClient(); - return client?.chain?.blockExplorers?.default?.url; - }, [config]); - - return ( - <> - Bridge to start earning {bridgeNumbers} {"Stake\u00B2"} on your {ghstSymbol} balance: - - - {formatNumber(estimatedAmount, 5)} {ghstSymbol} - - - - Generate a unique address for per tx with GHOST Connect for privacy. - - - setInputFocused(true)} - onFocus={() => setInputFocused(false)} - onChange={event => setReceiver(event.currentTarget.value)} - placeholder={convertedReceiver ? shorten(receiver, 15, -10) : "GHOST address (sf prefixed)"} - value={convertedReceiver ? "" : receiver} - inputProps={{ "data-testid": "fromInput" }} - endString={convertedReceiver - ? - : inputFocused && receiver !== "" - ? - : undefined - } - type="text" - maxWidth="100%" - /> - - - - Gatekeeper - - - {shorten(gatekeeperAddress, 10, -8)} - - - - - Bridge Fee - {formatNumber(incomingFee, 4)}% - - - Est. Time - 20 mins - - - - - Proceed - - - ) -} - const WelcomeView = ({ - bridgeNumbers, goNext, isStakingOpened, chainId, + isPending, + setIsPending, warmupPeriod, ghstSymbol, ftsoSymbol, + estimatedAmount, defaultFunction, - closeModal + closeModal, + incomingFee, + gatekeepersMatch, + isNetworkDataLoading }) => { - const [refreshNeeded, setRefreshNeeded] = useState(false); - const [isPending, setIsPending] = useState(false); - const { epoch } = useEpoch(chainId); - const { gatekeeperAddress } = useGatekeeperAddress(chainId); const { gatekeepedApy, apyInner } = useGatekeeperApy(chainId); - - const { isExtensionMissing } = useUnstableProvider(); - - const refreshPage = () => window.location.reload(); - const getConnect = () => { - setRefreshNeeded(true) - window.open(GHOST_CONNECT, '_blank', 'noopener,noreferrer'); - } + const { existentialDeposit } = useGatekeeperMinimum(chainId); const callDefaultFunction = useCallback(async () => { setIsPending(true); @@ -290,7 +224,7 @@ const WelcomeView = ({ > {warmupPeriod > 0 ? `Warm-up ends in ${prettifySecondsInDays(epoch.length * warmupPeriod)}` - : `${isPending ? "Claiming..." : "Claim"} ${isStakingOpened ? "(3, 3) Stake" : "(1, 1) Bond"}` + : `${isPending ? "Claiming..." : `Claim ${isStakingOpened ? "(3, 3) Stake" : "(1, 1) Bond"}`}` } @@ -304,26 +238,143 @@ const WelcomeView = ({ Skip the Warm-up Now! Bridge your {ghstSymbol} to GHOST Chain and start{" "} - {bridgeNumbers}{" "} + {bridgeNumbers()}{" "} {"Stake\u00B2"} at: - {formatNumber(gatekeepedApy, 2)}% APY + + {formatNumber(gatekeepedApy, 2)}% APY + - {isExtensionMissing - ? (refreshNeeded ? "Refresh Page" : "Get GHOST Connect") - : `Start ${bridgeNumbers} ${"Stake\u00B2"}`} + {gatekeepersMatch + ? estimatedAmount.lt(existentialDeposit) ? "Below Existential Deposit" : `Start ${bridgeNumbers()} ${"Stake\u00B2"}` + : isNetworkDataLoading ? "Syncing with Gatekeeper..." : "Gatekeeper Outdated" + } + + + ) +} + +const BridgeView = ({ + chainId, + receiver, + setReceiver, + convertedReceiver, + setConvertedReceiver, + bridgeNumbers, + ghstSymbol, + estimatedAmount, + goNext, + incomingFee, + networkData, + gatekeepersMatch, + gatekeeperAddress +}) => { + const theme = useTheme(); + const config = useConfig(); + + const { account } = useUnstableProvider(); + const [inputFocused, setInputFocused] = useState(false); + + const blockDelayMetric = useMemo(() => { + if (!networkData) return null; + const blockSpeed = networkAvgBlockSpeed(chainId); + const finalityDelay = networkData.finality_delay; + const estimatedMins = (blockSpeed * finalityDelay) / 60n; + return { finalityDelay, text: `~${estimatedMins} mins` } + }, [chainId, networkData]); + + const chainExplorerUrl = useMemo(() => { + const client = config?.getClient(); + return client?.chain?.blockExplorers?.default?.url; + }, [config]); + + return ( + <> + + Bridge to start earning {bridgeNumbers} {"Stake\u00B2"} on your {ghstSymbol} balance: + + + + {formatNumber(estimatedAmount, 5)} {ghstSymbol} + + + + Generate a unique address for per tx with {" "} + + GHOST Connect + + {" "}for your privacy, or{" "} + setReceiver(account)} + sx={{ + color: theme.colors.primary[300], + verticalAlign: "baseline", + }} + > + click here + {" "} + to use connected one. + + + + + + + Gatekeeper + + + {shorten(gatekeeperAddress, 10, -8)} + + + + + Bridge Fee + {formatNumber(incomingFee, 5)}% + + + Est. Time + {blockDelayMetric + ? {blockDelayMetric.text} + : + } + + + + + {gatekeepersMatch ? "Proceed" : "Gatekeeper Outdated"} ) @@ -333,84 +384,45 @@ const ConfirmStep = ({ chainId, address, receiver, + isPending, + setIsPending, convertedReceiver, executableFunction, ghstSymbol, - bridgeNumbers, estimatedAmount, - bridgingRisk, - incomingFee, - setActiveTxIndex, closeModal, - evmNetwork + networkData, + gatekeepersMatch, + incomingFee }) => { const config = useConfig(); - const navigate = useNavigate(); const currentSession = useCurrentIndex(); const { getStorageValue, setStorageValue } = useLocalStorage(); - const [blockNumber, setBlockNumber] = useState(0n); - const [isPending, setIsPending] = useState(false); const [acknowledgeBridgingRisk, setAcknowledgeBridgingRisk] = useState(false); const [acknowledgeWalletCustody, setAcknowledgeWalletCustody] = useState(false); - getBlockNumber(config).then(block => setBlockNumber(block)); - const nativeSymbol = useMemo(() => config?.getClient()?.chain?.nativeCurrency?.symbol, [config]); - const networkName= useMemo(() => config?.getClient()?.chain?.name.toLowerCase(), [config]); const receivedEstimation = useMemo(() => { - const decimals = incomingFee._decimals + 2; const afterFee = new DecimalBigNumber( - BigInt(Math.pow(10, decimals) - incomingFee._value), - decimals + incomingFee ? BigInt((100 - incomingFee) * 100) : 0n, + 4 ); + return estimatedAmount.mul(afterFee); }, [incomingFee, estimatedAmount]); const execute = useCallback(async () => { setIsPending(true); try { - const txHash = await executableFunction()(convertedReceiver); - if (txHash) { - const expectedSessionIndex = (currentSession ?? 0) + (evmNetwork - ? Number((evmNetwork.avg_block_speed * evmNetwork.finality_delay) / (1000n * 14400n)) - : 0); - - const transaction = { - receiverAddress: receiver, - amount: estimatedAmount._value.toString(), - sessionIndex: expectedSessionIndex, - transactionHash: txHash, - blockNumber: Number(blockNumber), - chainId: chainId, - bridgeStability: 69, // TODO: avoid stability - timestamp: Date.now() - } - - const storedTransactions = getStorageValue(chainId, address, "bridge-txs", []); - const newStoredTransactions = [transaction, ...storedTransactions]; - setStorageValue(chainId, address, "bridge-txs", newStoredTransactions); - - setActiveTxIndex(0); - navigate(`${networkName}/bridge`); - } + await executableFunction()(convertedReceiver); } finally { setIsPending(false); closeModal(); } - }, [ - executableFunction, - convertedReceiver, - receiver, - networkName, - chainId, - address, - blockNumber, - evmNetwork, - currentSession, - ]); + }, [executableFunction, convertedReceiver]); return ( <> @@ -432,7 +444,7 @@ const ConfirmStep = ({ - {`You are bridging to GHOST Chain now to claim ${bridgeNumbers} ${"Stake\u00B2"} rewards.`} + {`You are bridging to GHOST Chain now to claim ${bridgeNumbers()} ${"Stake\u00B2"} rewards.`}
diff --git a/src/containers/Bridge/BridgeIn.jsx b/src/containers/Bridge/BridgeIn.jsx index ead2e2e..3c059d1 100644 --- a/src/containers/Bridge/BridgeIn.jsx +++ b/src/containers/Bridge/BridgeIn.jsx @@ -291,7 +291,7 @@ const BridgeIn = ({ chainId, address, config, connect }) => { return amount * result / hundredPercent }, [amount, networkData]); - const gatekeepersDifferent = useMemo(() => { + const gatekeepersMatch = useMemo(() => { if (!networkData) return false; return gatekeeperAddress.toUpperCase() == toHex(networkData.gatekeeper).toUpperCase(); }, [gatekeeperAddress, networkData]); @@ -541,7 +541,7 @@ const BridgeIn = ({ chainId, address, config, connect }) => { {isPending ? "Pending..." : "Bridge-In"} diff --git a/src/containers/History/BondModal.jsx b/src/containers/History/BondModal.jsx index 01b4b6e..a6877cb 100644 --- a/src/containers/History/BondModal.jsx +++ b/src/containers/History/BondModal.jsx @@ -8,16 +8,20 @@ import ArrowRightIcon from '@mui/icons-material/ArrowRight'; import GhostStyledIcon from "../../components/Icon/GhostIcon"; import Modal from "../../components/Modal/Modal"; +import Token from "../../components/Token/Token"; import { PrimaryButton } from "../../components/Button"; import { useBondInfo } from "../../hooks/bonds"; -import { formatCurrency, shorten } from "../../helpers"; +import { getTokenDecimals } from "../../hooks/helpers"; +import { useLocalStorage } from "../../hooks/localstorage"; +import { formatNumber, formatCurrency, shorten } from "../../helpers"; import { DecimalBigNumber } from "../../helpers/DecimalBigNumber"; import { abi as GhostBondDepository } from "../../abi/GhostBondDepository.json"; +import { abi as ERC20Token } from "../../abi/ERC20.json"; import TokenBox from "./TokenBox"; -const BondModal = ({ chainId, isOpen, close, config, historyRecord }) => { +const BondModalClaim = ({ chainId, isOpen, close, config, historyRecord }) => { if (historyRecord === null) return null; const { network } = useParams(); @@ -42,6 +46,157 @@ const BondModal = ({ chainId, isOpen, close, config, historyRecord }) => { hash: historyRecord.txHash, }); + const functionArgs = useMemo(() => { + if (!txData) return null; + const decoded = decodeFunctionData({ abi: GhostBondDepository, data: txData.input }); + if (!decoded) return null; + + return { + receiver: decoded.args.at(0), + isGhst: decoded.args.at(1), + bondIds: decoded.args.at(2), + } + }, [txData]); + + const allDecodedLogs = useMemo(() => { + if (!receipt?.logs) return []; + + return receipt.logs.map((log) => { + try { + const decoded = decodeEventLog({ + abi: ERC20Token, + data: log.data, + topics: log.topics, + }); + + return { + eventName: decoded.eventName, + args: decoded.args, + address: log.address + }; + } catch (e) { + return null; + } + }).filter(Boolean); + }, [receipt]); + + const claimedAmount = useMemo(() => { + return allDecodedLogs?.reduce((sum, item) => sum + item.args.value, 0n); + }, [allDecodedLogs]); + + return ( + + {functionArgs && "Bond Claim"} + {(!functionArgs) && "Parsing Transaction Hash"} + + } + onClose={() => close()} + > + {functionArgs && + + + + + + + + + + Receiver + + {shorten(functionArgs.receiver, 10, -8)} + + + + + Claimed + + {formatCurrency( + new DecimalBigNumber(claimedAmount ?? 0n, getTokenDecimals(functionArgs.isGhst ? "GHST" : "STNK")), + 5, + functionArgs.isGhst ? "GHST" : "STNK" + )} + + + + + Bond Indexes + + {functionArgs.bondIds.map((bond) => formatNumber(bond)).join(", ")} + + + + + + + View Transaction Details + + + } + + ) +} + +const BondModalBond = ({ chainId, isOpen, close, config, historyRecord }) => { + if (historyRecord === null) return null; + const { network } = useParams(); + const { CONSTANTS } = useLocalStorage(); + + const chainInfo = useMemo(() => { + const client = config?.getClient(); + + return { + url: client?.chain?.blockExplorers?.default?.url, + symbol: client?.chain?.nativeCurrency?.symbol, + }; + }, [config]); + + const { data: receipt, isLoading, error } = useTransactionReceipt({ + hash: historyRecord?.txHash, + query: { + enabled: !!historyRecord?.txHash && isOpen, + } + }); + + const { data: txData } = useTransaction({ + chainId, + hash: historyRecord.txHash, + }); + const functionArgs = useMemo(() => { if (!txData) return null; const decoded = decodeFunctionData({ abi: GhostBondDepository, data: txData.input }); @@ -186,4 +341,29 @@ const BondModal = ({ chainId, isOpen, close, config, historyRecord }) => { ) } +const BondModal = ({ chainId, isOpen, close, config, historyRecord }) => { + const { CONSTANTS } = useLocalStorage(); + + switch (historyRecord.name) { + case CONSTANTS.bond.bond: + return + case CONSTANTS.bond.claim: + return + default: + return null; + } +} + export default BondModal; diff --git a/src/hooks/bonds/index.js b/src/hooks/bonds/index.js index 0767909..e726ffe 100644 --- a/src/hooks/bonds/index.js +++ b/src/hooks/bonds/index.js @@ -44,7 +44,7 @@ export const useBondInfo = (chainId, chainName, indexes) => { const ftsoPrice = useFtsoPrice(chainId); const baseTokenPerUsd = useReservePrice(chainId); const originalCoefficient = useOrinalCoefficient(chainId); - + const { data: markets } = useReadContracts({ contracts: indexes?.map((id) => ({ abi: BondAbi, @@ -311,7 +311,7 @@ export const redeem = async ({ chainId, user, isGhst, indexes }) => { errorMsg: `Redeem of ${indexes.length} bonds failed. Check logs for error detalization.`, }; - await executeOnChainTransaction({ + const txHash = await executeOnChainTransaction({ chainId, args, messages, @@ -320,6 +320,8 @@ export const redeem = async ({ chainId, user, isGhst, indexes }) => { functionName: "redeem", account: user, }); + + return txHash; } export const forceRedeem = async ({ chainId, user, receiver, indexes }) => { diff --git a/src/hooks/breakoutModal/index.jsx b/src/hooks/breakoutModal/index.jsx index c2f8a8c..00a1c7b 100644 --- a/src/hooks/breakoutModal/index.jsx +++ b/src/hooks/breakoutModal/index.jsx @@ -7,7 +7,6 @@ export const useBreakoutModal = () => useContext(BreakoutModalContext); export const BreakoutModalProvider = ({ children }) => { const [isStakingOpened, setIsStakingOpened] = useState(false); const [isClaimBondOpened, setIsClaimBondOpened] = useState(false); - const [activeTxIndex, setActiveTxIndex] = useState(-1); const [warmupPeriod, setWarmupPeriod] = useState(0); const [estimatedAmount, setEstimatedAmount] = useState(0); const [defaultFunction, setDefaultFunction] = useState(emptyFunction); @@ -45,8 +44,6 @@ export const BreakoutModalProvider = ({ children }) => { { getTokenDecimals("GHST"), ); - return { existentialDeposit}; + return { existentialDeposit }; } export const useGatekeeperApy = (chainId) => {