diff --git a/build.zip b/build.zip new file mode 100644 index 0000000..a38fca6 Binary files /dev/null and b/build.zip differ diff --git a/public/locales/zh-CN.json b/public/locales/zh-CN.json index 6f914ac..6e80e7a 100644 --- a/public/locales/zh-CN.json +++ b/public/locales/zh-CN.json @@ -1118,7 +1118,7 @@ "By using the invitation at the top right of the page, new users can be invited to enter and obtained after users purchase coins": "使用页面右上方的邀请,可邀请新用户进入,并在用户购买币后获得", "The commission": "的提成!", "footer %number% text": "使用页面右上方的邀请,可邀请新用户进入,并在用户购买币后获得 %number% 的提成!", - "market value": "市值", + "market value": "市值(24h)", "Loaded all": "已加载全部", "Insufficient Balance": "余额不足", "HCC Currency amount": "HCC币总量", diff --git a/src/config/constants/contracts.ts b/src/config/constants/contracts.ts index 3828c17..5db9f27 100644 --- a/src/config/constants/contracts.ts +++ b/src/config/constants/contracts.ts @@ -8,11 +8,11 @@ export default { 56: '0x6ab8463a4185b80905e05a9ff80a2d6b714b9e95', }, boardChef: { - 97: '0x2D807e54A07e3B404823359eeD854Aa54AC4F237', + 97: '0x4ECC687D67138694729433e77cD95eEE9a858E40', 56: '0xD34871F12ace1BB8034E18009104b9dA60B84250', // NEED CHANGE 节点董事会合约 }, boardRewardChef: { - 97: '0x2937a050705009270c9b5bc096d57d519ab7c39b', + 97: '0xbCb980b6A4CD67d81B63B0bFA734B4116B218700', 56: '0xD34871F12ace1BB8034E18009104b9dA60B84250', // NEED CHANGE 节点董事会分红合约 }, holderChef: { @@ -20,20 +20,20 @@ export default { 56: '0xD34871F12ace1BB8034E18009104b9dA60B84250', // NEED CHANGE 持币人 }, holderRewardChef: { - 97: '0x46271393dd6f2c8798a44f857888aa6a85af3527', + 97: '0x61FB526924c6BAC9A08E146Da103B19c0DFA1899', 56: '0x46271393dd6f2c8798a44f857888aa6a85af3527', // NEED CHANGE 持币人分红 }, referralChef: { - 97: '0x16ed5C884a0aA02c2E0FA9064F3EB5A8Da58B659', - 56: '0x88F46EF2Ee08494D84942DCA3bd24cDEf7C88Ae2', // NEED CHANGE 邀请或则军团长 + 97: '0xe94282DA5166AD3FEB82F7aE299b2D5DFDF392Ae', + 56: '0xf42D1e1883C2FAA058dfa0D301556EB2d964859a', // NEED CHANGE 邀请或则军团长 }, referralRewardChef: { - 97: '0x86a510e82aceb27ed9e9880fb981d4b42ff16cb4', - 56: '0x88F46EF2Ee08494D84942DCA3bd24cDEf7C88Ae2', // NEED CHANGE 邀请或则军团长收益 + 97: '0xf42D1e1883C2FAA058dfa0D301556EB2d964859a', + 56: '0xf42D1e1883C2FAA058dfa0D301556EB2d964859a', // NEED CHANGE 邀请或则军团长收益 }, idoPurchase: { - 97: '0x7657AF82EA0A59Cdc697d2c7b7b67E376ed36ec2', - 56: '0x7657AF82EA0A59Cdc697d2c7b7b67E376ed36ec2', // NEED CHANGE IDO兑换 + 97: '0xCCFD5B33774a1568A322FCa262D3378Ff8CcdeCB', + 56: '0xCCFD5B33774a1568A322FCa262D3378Ff8CcdeCB', // NEED CHANGE IDO兑换 }, lotteryV2: { 97: '0x5790c3534F30437641541a0FA04C992799602998', diff --git a/src/config/constants/tokens.ts b/src/config/constants/tokens.ts index 4fd5ca3..6dcd817 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: '0x6F9B2c66BbefE35a364280A2E8B51b255eC51678', + 97: '0xE7619D544bD06f4d7362c8aA06a4ca0Ea73ce8c2', }, decimals: 18, projectLink: 'https://tranchess.com/', diff --git a/src/config/localization/translations.json b/src/config/localization/translations.json index c520700..a11b707 100644 --- a/src/config/localization/translations.json +++ b/src/config/localization/translations.json @@ -1247,7 +1247,7 @@ "By using the invitation at the top right of the page, new users can be invited to enter and obtained after users purchase coins": "By using the invitation at the top right of the page, new users can be invited to enter and obtained after users purchase coins", "The commission": "The commission!", "footer %number% text": "By using the invitation at the top right of the page, new users can be invited to enter and obtained after users purchase coins %number% The commission!", - "market value": "market value", + "market value": "market value(24h)", "Loaded all": "Loaded all", "HCC Currency amount": "HCC Currency amount", "Lock up time": "Lock up time", diff --git a/src/views/Ido/components/IdoPurchaseCard.tsx b/src/views/Ido/components/IdoPurchaseCard.tsx index ac5b0fc..12a7804 100644 --- a/src/views/Ido/components/IdoPurchaseCard.tsx +++ b/src/views/Ido/components/IdoPurchaseCard.tsx @@ -1,6 +1,7 @@ import React, { useState, useEffect } from 'react' import dayjs from 'dayjs' import styled from 'styled-components' +import BigNumber from 'bignumber.js' import { useTranslation } from 'contexts/Localization' import { Text, Button, useModal } from '@pancakeswap/uikit' import { getAddress } from 'utils/addressHelpers' @@ -8,6 +9,7 @@ import { getPurchaseActivity } from 'services/idoPurchase' import { fetchIdoUserAllowances } from 'state/ido' import { useERC20 } from 'hooks/useContract' import useToast from 'hooks/useToast' +import { getDecimalAmountNumber, formatDivNumber } from 'utils/formatBalance' import tokens from 'config/constants/tokens' import { useAccount } from 'state/userInfo/hooks' @@ -113,12 +115,12 @@ const ExchangeCard: React.FC = ({ status, roundDetail, time }) => { const [hccPrice, setHccPrice] = useState('') const handleUsdtChange = (e: React.FormEvent) => { - const price = Number(e.currentTarget.value) * roundDetail?.price + const price = new BigNumber(e.currentTarget.value).multipliedBy(roundDetail?.price) setUsdtPrice(e.currentTarget.value) e.currentTarget.value ? setHccPrice(price.toString()) : setHccPrice('') } const handleHccChange = (e: React.FormEvent) => { - const price = Number(e.currentTarget.value) / roundDetail?.price + const price = new BigNumber(e.currentTarget.value).div(roundDetail?.price).toNumber() setHccPrice(e.currentTarget.value) e.currentTarget.value ? setUsdtPrice(price.toString()) : setUsdtPrice('') } @@ -127,7 +129,7 @@ const ExchangeCard: React.FC = ({ status, roundDetail, time }) => { // 立即兑换 const immediatelyChange = async () => { try { - const enoughBalance = onCheckBalance(hccPrice) + const enoughBalance = onCheckBalance(usdtPrice) if (enoughBalance) { const res = await buyTransaction(hccPrice) } diff --git a/src/views/Ido/components/RateText.tsx b/src/views/Ido/components/RateText.tsx index 72c027f..c48a132 100644 --- a/src/views/Ido/components/RateText.tsx +++ b/src/views/Ido/components/RateText.tsx @@ -62,10 +62,10 @@ const RateCom: React.FC = ({ status, roundDetail }) => { - {t('gross')}:{status === 'none' ? ' -------- ' : roundDetail?.total}HCC + {t('gross')}:{status === 'none' ? ' -------- ' : `${roundDetail?.total}HCC`} - {t('remaining quantity')}:{status === 'none' ? ' -------- ' : roundDetail?.remaining}HCC + {t('remaining quantity')}:{status === 'none' ? ' -------- ' : `${roundDetail?.remaining}HCC`} diff --git a/src/views/Ido/hooks/index.ts b/src/views/Ido/hooks/index.ts index 1d19729..0b5b929 100644 --- a/src/views/Ido/hooks/index.ts +++ b/src/views/Ido/hooks/index.ts @@ -51,9 +51,8 @@ export const useBuyTransaction = () => { const transaction = async (amount) => { const data = await getPurchaseActivity() const { id } = data - const params = [id, new BigNumber(amount).times(18).toString()] + const params = [id, new BigNumber(amount).times(new BigNumber(10).pow(18)).toString()] const res = await idoPurchase.purchaseWithLock(...params) - console.log(res) return res } return transaction @@ -82,7 +81,9 @@ export const useGetRound = () => { endTime: new BigNumber(item?.endTime._hex).toNumber() * 1000, price: 1 / formatDivNumber(item?.price._hex, 18), remaining: formatDivNumber(item?.remaining._hex, 18), + // remaining: new BigNumber(item?.remaining._hex).toString(), token: item?.token, + // total: new BigNumber(item?.total._hex).toString(), total: formatDivNumber(item?.total._hex, 18), } }) @@ -129,7 +130,6 @@ export const useHarvest = () => { const idoPurchase = useIdoPurchase() const transaction = async () => { const res = await idoPurchase.harvest() - console.log(res) return res } return transaction