diff --git a/public/locales/zh-CN.json b/public/locales/zh-CN.json index 1df6bc0..6f914ac 100644 --- a/public/locales/zh-CN.json +++ b/public/locales/zh-CN.json @@ -1153,5 +1153,11 @@ "gross": "总量", "remaining quantity": "剩余数量", "Immediately change": "立即兑换", - "IDO Exchange": "IDO 兑换" + "IDO Exchange": "IDO 兑换", + "Get": "领取", + "IDO Get": "IDO 领取", + "Estimated time of collection": "预计领取时间", + "amount": "金额", + "Change the end": "兑换结束", + "After purchase, it is expected to be available for collection in %time% time. Do you confirm the purchase": "购买后,预计%time%时间后可进行领取,是否确认购买" } diff --git a/src/components/Menu/index.tsx b/src/components/Menu/index.tsx index 3f604f6..e32d0b0 100644 --- a/src/components/Menu/index.tsx +++ b/src/components/Menu/index.tsx @@ -57,9 +57,14 @@ const Menu = (props) => { sign() } }, [unActiveAccount, hasWalletLogin, library]) - + const [price, setPrice] = useState(0) useEffect(() => { getDetails() + if (hccPriceUsdt.toString() === 'Infinity') { + setPrice(0) + } else { + setPrice(hccPriceUsdt.toNumber()) + } }, []) return ( { currentLang={currentLanguage.code} langs={languageList} setLang={setLanguage} - cakePriceUsd={hccPriceUsdt.toNumber()} + cakePriceUsd={price} links={config(t)} socialLink={socialLink} {...props} diff --git a/src/config/abi/idoPurchase.json b/src/config/abi/idoPurchase.json index f6f4bbd..9d7a8b5 100644 --- a/src/config/abi/idoPurchase.json +++ b/src/config/abi/idoPurchase.json @@ -17,6 +17,15 @@ "name": "AddRound", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Harvest", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -26,6 +35,12 @@ "name": "OwnershipTransferred", "type": "event" }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint256", "name": "newLockTime", "type": "uint256" }], + "name": "SetLockTimeEvent", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -74,6 +89,14 @@ "stateMutability": "view", "type": "function" }, + { "inputs": [], "name": "harvest", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "lockTime", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "owner", @@ -105,7 +128,24 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "round", "type": "uint256" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "purchaseWithLock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "uint256", "name": "_lockTime", "type": "uint256" }], + "name": "setLockTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "setPause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ @@ -127,5 +167,12 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "userInfo", + "outputs": [{ "internalType": "uint256", "name": "purchasedAmount", "type": "uint256" }], + "stateMutability": "view", + "type": "function" } ] diff --git a/src/config/constants/contracts.ts b/src/config/constants/contracts.ts index ceba19c..3828c17 100644 --- a/src/config/constants/contracts.ts +++ b/src/config/constants/contracts.ts @@ -8,7 +8,7 @@ export default { 56: '0x6ab8463a4185b80905e05a9ff80a2d6b714b9e95', }, boardChef: { - 97: '0x126935cae1988efbf8e310abe6be1f9046eaf0ac', + 97: '0x2D807e54A07e3B404823359eeD854Aa54AC4F237', 56: '0xD34871F12ace1BB8034E18009104b9dA60B84250', // NEED CHANGE 节点董事会合约 }, boardRewardChef: { @@ -24,7 +24,7 @@ export default { 56: '0x46271393dd6f2c8798a44f857888aa6a85af3527', // NEED CHANGE 持币人分红 }, referralChef: { - 97: '0x8a5dc1e8262d6a3de664624fdc13a533ba64e60d', + 97: '0x16ed5C884a0aA02c2E0FA9064F3EB5A8Da58B659', 56: '0x88F46EF2Ee08494D84942DCA3bd24cDEf7C88Ae2', // NEED CHANGE 邀请或则军团长 }, referralRewardChef: { @@ -32,8 +32,8 @@ export default { 56: '0x88F46EF2Ee08494D84942DCA3bd24cDEf7C88Ae2', // NEED CHANGE 邀请或则军团长收益 }, idoPurchase: { - 97: '0xc9f05c406876364fd13fbf15a9dc5de4f8cd1eda', - 56: '0x2bAA17bDeC5cDF2943309B245EF5310FF9c46B01', // NEED CHANGE IDO兑换 + 97: '0x7657AF82EA0A59Cdc697d2c7b7b67E376ed36ec2', + 56: '0x7657AF82EA0A59Cdc697d2c7b7b67E376ed36ec2', // NEED CHANGE IDO兑换 }, lotteryV2: { 97: '0x5790c3534F30437641541a0FA04C992799602998', diff --git a/src/config/constants/tokens.ts b/src/config/constants/tokens.ts index 4d39671..4fd5ca3 100644 --- a/src/config/constants/tokens.ts +++ b/src/config/constants/tokens.ts @@ -73,7 +73,7 @@ const tokens = { symbol: 'HCC', address: { 56: '0x20de22029ab63cf9A7Cf5fEB2b737Ca1eE4c82A6', - 97: '0x77f2efa78c1c2798ad3c753330aa4e1babcaeff8', + 97: '0x6F9B2c66BbefE35a364280A2E8B51b255eC51678', }, decimals: 18, projectLink: 'https://tranchess.com/', diff --git a/src/config/localization/translations.json b/src/config/localization/translations.json index 29721e2..c520700 100644 --- a/src/config/localization/translations.json +++ b/src/config/localization/translations.json @@ -1280,5 +1280,11 @@ "gross": "gross", "remaining quantity": "remaining quantity", "Immediately change": "Immediately change", - "IDO Exchange": "IDO Exchange" + "IDO Exchange": "IDO Exchange", + "Get": "Get", + "IDO Get": "IDO Get", + "Estimated time of collection": "Estimated time of collection", + "amount": "amount", + "Change the end": "Change the end", + "After purchase, it is expected to be available for collection in %time% time. Do you confirm the purchase": "After purchase, it is expected to be available for collection in %time% time. Do you confirm the purchase" } diff --git a/src/services/idoPurchase.ts b/src/services/idoPurchase.ts index eef2752..70792fe 100644 --- a/src/services/idoPurchase.ts +++ b/src/services/idoPurchase.ts @@ -2,7 +2,7 @@ import request from 'utils/request' export const getPurchaseActivity = () => { return request.request({ - url: '/high_city/app/api/purchasr/activity/current', + url: '/high_city/app/api/purchase/activity/current', method: 'get', }) } diff --git a/src/utils/contractHelpers.ts b/src/utils/contractHelpers.ts index e48fb78..d409630 100644 --- a/src/utils/contractHelpers.ts +++ b/src/utils/contractHelpers.ts @@ -129,6 +129,9 @@ export const getReferralchefContract = (signer?: ethers.Signer | ethers.provider export const getReferralRewardchefContract = (signer?: ethers.Signer | ethers.providers.Provider) => { return getContract(referralRewardChef, getReferralRewardAddress(), signer) } +export const getIdoPurchaseContract = (signer?: ethers.Signer | ethers.providers.Provider) => { + return getContract(idoPurchase, getIdoPurchaseAddress(), signer) +} export const getClaimRefundContract = (signer?: ethers.Signer | ethers.providers.Provider) => { return getContract(claimRefundAbi, getClaimRefundAddress(), signer) } @@ -158,6 +161,3 @@ export const getBunnySpecialCakeVaultContract = (signer?: ethers.Signer | ethers export const getBunnySpecialPredictionContract = (signer?: ethers.Signer | ethers.providers.Provider) => { return getContract(bunnySpecialPredictionAbi, getBunnySpecialPredictionAddress(), signer) } -export const getIdoPurchaseContract = (signer?: ethers.Signer | ethers.providers.Provider) => { - return getContract(idoPurchase, getIdoPurchaseAddress(), signer) -} diff --git a/src/utils/formatBalance.ts b/src/utils/formatBalance.ts index c5f31e5..fa8d632 100644 --- a/src/utils/formatBalance.ts +++ b/src/utils/formatBalance.ts @@ -65,6 +65,6 @@ export const formatFixedNumber = (number: ethers.FixedNumber, displayDecimals = return formatBigNumber(ethers.BigNumber.from(leftSide), displayDecimals, decimals) } -export const formatDivNumber = (number: number, decimals = 4) => { +export const formatDivNumber = (number: BigNumber | number, decimals = 4) => { return new BigNumber(number).div(BIG_TEN.pow(decimals)).toNumber() } diff --git a/src/views/Board/components/BoardCard/BoardCard.tsx b/src/views/Board/components/BoardCard/BoardCard.tsx index 2902e55..b2a5316 100644 --- a/src/views/Board/components/BoardCard/BoardCard.tsx +++ b/src/views/Board/components/BoardCard/BoardCard.tsx @@ -119,7 +119,7 @@ const BoardCard: React.FC = ({ board, account, boardsData }) => { const date2 = dayjs(date) const time = date2.diff(date1) if (time > 0) { - const hour = Math.floor((time / (1000 * 60 * 60)) % 24) + const hour = Math.floor(time / (1000 * 60 * 60)) const minute = Math.floor((time / (1000 * 60)) % 60) const second = Math.round((time / 1000) % 60) setCountDown(`${hour}:${minute}:${second}`) diff --git a/src/views/Board/components/BoardCard/CardActionsContainer.tsx b/src/views/Board/components/BoardCard/CardActionsContainer.tsx index 77c3136..f628472 100644 --- a/src/views/Board/components/BoardCard/CardActionsContainer.tsx +++ b/src/views/Board/components/BoardCard/CardActionsContainer.tsx @@ -1,4 +1,4 @@ -import React, { useState, useCallback, useMemo } from 'react' +import React, { useState, useCallback, useMemo, useEffect } from 'react' import BigNumber from 'bignumber.js' import styled from 'styled-components' import { provider as ProviderType } from 'web3-core' @@ -50,6 +50,15 @@ const CardActions: React.FC = ({ board, account }) => { const displayBalance = rawEarningsBalance.toFixed(3, BigNumber.ROUND_DOWN) const hccPriceUsdt = usePriceHccUsdt() + const [price, setPrice] = useState(0) + useEffect(() => { + if (hccPriceUsdt.toString() === 'Infinity') { + setPrice(0) + } else { + setPrice(Number(hccPriceUsdt.toNumber().toFixed(3))) + } + }, []) + const handleApprove = useCallback(async () => { try { setRequestedApproval(true) @@ -76,7 +85,7 @@ const CardActions: React.FC = ({ board, account }) => { {displayBalance} - {(Number(hccPriceUsdt.toNumber().toFixed(3)) * Number(displayBalance)).toFixed(3)} USDT + {price ? (price * Number(displayBalance)).toFixed(3) : 0} USDT diff --git a/src/views/Board/components/BoardCard/StakeAction.tsx b/src/views/Board/components/BoardCard/StakeAction.tsx index 70a84b6..26ef3da 100644 --- a/src/views/Board/components/BoardCard/StakeAction.tsx +++ b/src/views/Board/components/BoardCard/StakeAction.tsx @@ -39,7 +39,6 @@ const StakeAction: React.FC = ({ stakedBalance, tokenBalan const { t } = useTranslation() const { toastWarning } = useToast() const { onStake } = useStakeBoard(pid) - console.log(onStake) const { onUnstake } = useUnstakeBoard(pid) const { onUnstake: onUnstakeForce } = useUnstakeForceBoard(pid) const { tokenDecimals = 18, minStakeAmount, userData } = useBoardsFromPid(pid) diff --git a/src/views/Home/components/FristCom.tsx b/src/views/Home/components/FristCom.tsx index 1cc5179..743957d 100644 --- a/src/views/Home/components/FristCom.tsx +++ b/src/views/Home/components/FristCom.tsx @@ -141,6 +141,7 @@ const FristCom: React.FC = () => { market: 0, }) const hccPriceUsdt = usePriceHccUsdt() + const [price, setPrice] = useState(0) const [linkList, setLinkList] = useState([]) const getDetail = async () => { @@ -155,6 +156,11 @@ const FristCom: React.FC = () => { setDetail(data) } useEffect(() => { + if (hccPriceUsdt.toString() === 'Infinity') { + setPrice(0) + } else { + setPrice(hccPriceUsdt.toNumber()) + } getDetail() }, []) const openLink = (link) => { @@ -201,7 +207,7 @@ const FristCom: React.FC = () => { - + {/* {burned.map((item) => { return })} */} diff --git a/src/views/Ido/components/BuyModal.tsx b/src/views/Ido/components/BuyModal.tsx new file mode 100644 index 0000000..91c11ca --- /dev/null +++ b/src/views/Ido/components/BuyModal.tsx @@ -0,0 +1,37 @@ +import BigNumber from 'bignumber.js' +import React, { useCallback, useMemo, useState } from 'react' +import { Button, Modal, Text } from '@pancakeswap/uikit' +import { ModalActions, ModalInput } from 'components/Modal' +import { useTranslation } from 'contexts/Localization' +import useToast from 'hooks/useToast' +import { getFullDisplayBalance } from 'utils/formatBalance' + +interface AffirmModalProps { + title?: string + content?: string + onDismiss?: () => void + handSubmit?: () => void +} + +const BuyModal: React.FC = ({ title, content, onDismiss, handSubmit }) => { + const { t } = useTranslation() + const submit = async () => { + await handSubmit() + onDismiss() + } + return ( + + {!content ? t('Whether to cancel') : content} + + + + + + ) +} + +export default BuyModal diff --git a/src/views/Ido/components/GetCard.tsx b/src/views/Ido/components/GetCard.tsx new file mode 100644 index 0000000..5c6b3a2 --- /dev/null +++ b/src/views/Ido/components/GetCard.tsx @@ -0,0 +1,79 @@ +import React, { useMemo, useState, useEffect, useCallback } from 'react' +import dayjs from 'dayjs' +import styled, { keyframes } from 'styled-components' +import { useTranslation } from 'contexts/Localization' +import { Flex, Text, Button, Input } from '@pancakeswap/uikit' +import { useHarvest } from '../hooks' + +interface GetCardProps { + price?: number | string + time?: number | string +} + +const FCard = styled.div` + width: 434px; + background: ${(props) => props.theme.card.background}; + border-radius: 32px; + box-shadow: 0px 2px 30px 0px rgba(0, 0, 0, 0.1); + display: flex; + flex-direction: column; + position: relative; + text-align: left; + padding: 27px 20px; + margin-top: 50px; +` + +const ExchangeCard: React.FC = ({ price = 0, time = 0 }) => { + const { t } = useTranslation() + + // const account = useAccount() + // const lockTime = useLockTime() + // const [time, setTime] = useState(0) + // const userInfo = useUserInfo() + // const [price, setPrice] = useState(0) + // const init = async () => { + // const data = await lockTime() + // console.log(data) + // setTime(data) + // const info = await userInfo(account) + // console.log(info) + // setPrice(info) + // } + // useEffect(() => { + // if (account) { + // init() + // } + // }, [account]) + const harvest = useHarvest() + const getPrice = async () => { + const res = await harvest() + console.log(res) + } + + return ( + + {/* 锁仓时间大于当前时间 不可领取 */} + {/* 锁仓时间小于当前时间 可领取 */} + {/* 当前时间大于锁仓时间 不显示 */} + +
+ {t('IDO Get')} + {new Date().getTime() <= time && ( + + {t('Estimated time of collection')}:{dayjs(time).format('YYYY-MM-DD HH:mm:ss')} + + )} + + {t('amount')}: + {price}HCC + +
+ +
+
+ ) +} + +export default ExchangeCard diff --git a/src/views/Ido/components/HeaderStatus.tsx b/src/views/Ido/components/HeaderStatus.tsx new file mode 100644 index 0000000..867c35c --- /dev/null +++ b/src/views/Ido/components/HeaderStatus.tsx @@ -0,0 +1,40 @@ +import React from 'react' +import dayjs from 'dayjs' +import styled from 'styled-components' +import { useTranslation } from 'contexts/Localization' +import { Text } from '@pancakeswap/uikit' + +const TimeText = styled(Text)` + color: #7a6eaa; + font-size: 22px; +` +interface RoundDetailProps { + beginTime?: number + endTime?: number + price?: number + remaining?: number + token?: string + total?: number +} +interface Props { + status?: string + roundDetail?: RoundDetailProps +} + +const HeaderStatus: React.FC = ({ status, roundDetail }) => { + const { t } = useTranslation() + + return ( + + {status === 'none' && t('Change the end')} + {status === 'proceed' && + `${dayjs(roundDetail?.beginTime).format('YYYY-MM-DD HH:mm:ss')} ~ ${dayjs(roundDetail?.endTime).format( + 'YYYY-MM-DD HH:mm:ss', + )}`} + {status === 'end' && + `${t('Opening time of next exchange period:')}${dayjs(roundDetail?.beginTime).format('YYYY-MM-DD HH:mm:ss')}`} + + ) +} + +export default HeaderStatus diff --git a/src/views/Ido/components/IdoInput.tsx b/src/views/Ido/components/IdoInput.tsx index 312b72b..ca92de4 100644 --- a/src/views/Ido/components/IdoInput.tsx +++ b/src/views/Ido/components/IdoInput.tsx @@ -22,16 +22,23 @@ const CoinText = styled(Text)` interface InputProps { name: string value?: number | string + isDisabled?: boolean onChange: (e: React.FormEvent) => void } -const ExchangeInput: React.FC = ({ name, value, onChange }) => { +const ExchangeInput: React.FC = ({ name, value, onChange, isDisabled = true }) => { const { t } = useTranslation() return ( {name} - + ) } diff --git a/src/views/Ido/components/IdoPurchaseCard.tsx b/src/views/Ido/components/IdoPurchaseCard.tsx index 73454d2..ac5b0fc 100644 --- a/src/views/Ido/components/IdoPurchaseCard.tsx +++ b/src/views/Ido/components/IdoPurchaseCard.tsx @@ -1,20 +1,23 @@ -import React, { useMemo, useState, useEffect, useCallback } from 'react' -import styled, { keyframes } from 'styled-components' +import React, { useState, useEffect } from 'react' +import dayjs from 'dayjs' +import styled from 'styled-components' import { useTranslation } from 'contexts/Localization' -import { Flex, Text, Button, Input } from '@pancakeswap/uikit' -import { getAddress, getIdoPurchaseAddress } from 'utils/addressHelpers' +import { Text, Button, useModal } from '@pancakeswap/uikit' +import { getAddress } from 'utils/addressHelpers' import { getPurchaseActivity } from 'services/idoPurchase' -// import { useIdoPurchase } from 'hooks/useContract' import { fetchIdoUserAllowances } from 'state/ido' -import multicall from 'utils/multicall' -import { useERC20, useIdoPurchase } from 'hooks/useContract' -import idoPurchaseABI from 'config/abi/idoPurchase.json' +import { useERC20 } from 'hooks/useContract' +import useToast from 'hooks/useToast' import tokens from 'config/constants/tokens' import { useAccount } from 'state/userInfo/hooks' import UnlockButton from 'components/UnlockButton' import ExchangeInput from './IdoInput' -import { useApproveIdo, useBuyTransaction } from '../hooks' +import HeaderStatus from './HeaderStatus' +import RateText from './RateText' + +import BuyModal from './BuyModal' +import { useApproveIdo, useBuyTransaction, useCheckTokenBalance } from '../hooks' const FCard = styled.div` width: 650px; @@ -26,24 +29,19 @@ const FCard = styled.div` position: relative; text-align: center; padding: 50px 70px; + ${({ theme }) => theme.mediaQueries.xs} { + width: 350px; + padding: 20px 30px; + } + ${({ theme }) => theme.mediaQueries.lg} { + width: 650px; + padding: 50px 70px; + } ` const HeaderText = styled(Text)` font-size: 48px; color: #280d5f; ` -const TimeText = styled(Text)` - color: #7a6eaa; - font-size: 22px; -` - -const RateText = styled(Text)` - font-size: 30px; - color: #280d5f; -` -const RateNumber = styled(Text)` - font-size: 30px; - color: #1fc7d4; -` const FooterButton = styled.div` margin-top: 50px; width: 100%; @@ -51,36 +49,55 @@ const FooterButton = styled.div` const UnlockButtonDiv = styled(UnlockButton)` width: 100%; ` +interface DetailProps { + id?: string + name?: string + beginTime?: string + endTime?: string +} +interface RoundDetailProps { + beginTime?: number + endTime?: number + price?: number + remaining?: number + token?: string + total?: number +} +interface Props { + status?: string + roundDetail?: RoundDetailProps + time?: number +} -const ExchangeCard: React.FC = () => { +const ExchangeCard: React.FC = ({ status, roundDetail, time }) => { const { t } = useTranslation() - + const { toastSuccess, toastError } = useToast() const account = useAccount() const [allowanceList, setAllowanceList] = useState({ usdt: 0 }) + const [loading, setLoading] = useState(false) const getAllowances = async () => { const allowances = await fetchIdoUserAllowances(account) setAllowanceList({ usdt: allowances.usdt, }) } - - const getPurchasrInfo = async () => { + const [idoInfo, setIdoInfo] = useState({}) + const getPurchaseInfo = async () => { const data = await getPurchaseActivity() - console.log(data) + setIdoInfo(data) } useEffect(() => { if (account) { getAllowances() - getPurchasrInfo() + getPurchaseInfo() } }, [account]) const usdtContract = useERC20(getAddress(tokens.usdt.address)) const { onApprove: onUsdtApprove } = useApproveIdo(usdtContract) - const [loading, setLoading] = useState(false) const handleApprove = async (approve) => { try { setLoading(true) @@ -96,69 +113,59 @@ const ExchangeCard: React.FC = () => { const [hccPrice, setHccPrice] = useState('') const handleUsdtChange = (e: React.FormEvent) => { - const price = Number(e.currentTarget.value) * Number(hccPrice) - console.log(price) + const price = Number(e.currentTarget.value) * roundDetail?.price setUsdtPrice(e.currentTarget.value) - setHccPrice(price.toString()) + e.currentTarget.value ? setHccPrice(price.toString()) : setHccPrice('') } const handleHccChange = (e: React.FormEvent) => { + const price = Number(e.currentTarget.value) / roundDetail?.price setHccPrice(e.currentTarget.value) + e.currentTarget.value ? setUsdtPrice(price.toString()) : setUsdtPrice('') } const buyTransaction = useBuyTransaction() + const [onCheckBalance] = useCheckTokenBalance() // 立即兑换 const immediatelyChange = async () => { - console.log('立即兑换') - // "inputs": [ - // { "internalType": "uint256", "name": "round", "type": "uint256" }, - // { "internalType": "uint256", "name": "amount", "type": "uint256" } - // ], - // "name": "purchase", - const params = [ - '0x8ec8610ef88cdd222d45a22dd98c55a98b979664', - '50000000000000000000', - '0', - '1652787744', - '1525022104880209921', - '0x18e77720bdfb43fc6b0a9a9050b7001fcd8f859041bdb0986d053366238e41582ceacaaca5e8c9ac815f6cc054c7135638b38acf5cd0aeb8fe6112effe7901d81b', - ] - const res = await buyTransaction() - console.log(res) - // setTxId(res.hash) - const params1 = [1, 2] - // const tx = await useIdoPurchase.purchase(...params) - // console.log(idoPurchaseABI) - // const Info = await multicall(idoPurchaseABI, [ - // { - // address: getIdoPurchaseAddress(), - // name: 'purchase', - // params: params1, - // }, - // ]) - // console.log(Info) + try { + const enoughBalance = onCheckBalance(hccPrice) + if (enoughBalance) { + const res = await buyTransaction(hccPrice) + } + } catch (e: any) { + toastError(e?.error?.message || e.message) + } } + const [onPresentAffirm] = useModal( + , + ) + return ( - {t('IDO exchange in the first phase')} - {t('Opening time of next exchange period:')}2022.5.16 00:00 - - - {t('Exchange rate')}: - 1USDT=100HCC - - - {t('gross')}:100000HCC - - {t('remaining quantity')}:100000HCC - - - + {idoInfo?.name} + + + + {account ? ( allowanceList.usdt ? ( - + time ? ( + + ) : ( + + ) ) : (