diff --git a/public/locales/zh-CN.json b/public/locales/zh-CN.json index 1edfa37..6d71ba7 100644 --- a/public/locales/zh-CN.json +++ b/public/locales/zh-CN.json @@ -1119,5 +1119,8 @@ "The commission": "的提成!", "market value": "市值", "Loaded all": "已加载全部", - "Insufficient Balance": "余额不足" + "Insufficient Balance": "余额不足", + "HCC Currency amount": "HCC币总量", + "Lock up time": "锁仓时间", + "possess LP": "持有LP" } diff --git a/src/config/abi/boardPool.json b/src/config/abi/boardPool.json new file mode 100644 index 0000000..49938af --- /dev/null +++ b/src/config/abi/boardPool.json @@ -0,0 +1,198 @@ +[ + { + "inputs": [ + { "internalType": "contract IERC20", "name": "_HCC", "type": "address" }, + { "internalType": "address", "name": "_HCCBODReawardPool", "type": "address" }, + { "internalType": "uint256", "name": "_minStakeAmount", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "EmergencyWithdraw", + "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": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "newHCCBODReawardPool", "type": "address" }], + "name": "SetHCCBODReawardPoolEvent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint256", "name": "newLockTime", "type": "uint256" }], + "name": "SetLockTimeEvent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint256", "name": "newMinStakeAmount", "type": "uint256" }], + "name": "SetMinStakeAmontEvent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [], + "name": "HCC", + "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "HCCBODReawardPool", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "_poolInfo", + "outputs": [ + { "internalType": "uint256", "name": "accHCCPerShare", "type": "uint256" }, + { "internalType": "uint256", "name": "totalAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "num", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], + "name": "_userInfo", + "outputs": [ + { "internalType": "uint256", "name": "total", "type": "uint256" }, + { "internalType": "uint256", "name": "reward", "type": "uint256" }, + { "internalType": "uint256", "name": "lp", "type": "uint256" }, + { "internalType": "uint256", "name": "lockTime", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "emergencyWithdrawHCC", "outputs": [], "stateMutability": "nonpayable", "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": "minStakeAmount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], + "name": "pendingHCC", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "_HCCBODReawardPool", "type": "address" }], + "name": "setHCCBODReawardPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_lockTime", "type": "uint256" }], + "name": "setLockTime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_minStakeAmount", "type": "uint256" }], + "name": "setMinStakeAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "setPause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "updatePool", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "userInfo", + "outputs": [ + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "rewardDebt", "type": "uint256" }, + { "internalType": "uint256", "name": "unLockTime", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "withdrawHCC", "outputs": [], "stateMutability": "nonpayable", "type": "function" } +] diff --git a/src/config/abi/holderPool.json b/src/config/abi/holderPool.json new file mode 100644 index 0000000..bc3215b --- /dev/null +++ b/src/config/abi/holderPool.json @@ -0,0 +1,182 @@ +[ + { + "inputs": [ + { "internalType": "contract IERC20", "name": "_HCC", "type": "address" }, + { "internalType": "address", "name": "_HCCStakeReawardPool", "type": "address" }, + { "internalType": "uint256", "name": "_minStakeAmount", "type": "uint256" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "EmergencyWithdraw", + "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": [ + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "newHCCStakeReawardPool", "type": "address" }], + "name": "SetHCCStakeReawardPoolEvent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint256", "name": "newLockTime", "type": "uint256" }], + "name": "SetLockTimeEvent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint256", "name": "newMinStakeAmount", "type": "uint256" }], + "name": "SetMinStakeAmontEvent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [], + "name": "HCC", + "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "HCCStakeReawardPool", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "_poolInfo", + "outputs": [ + { "internalType": "uint256", "name": "accHCCPerShare", "type": "uint256" }, + { "internalType": "uint256", "name": "totalAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "num", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], + "name": "_userInfo", + "outputs": [ + { "internalType": "uint256", "name": "total", "type": "uint256" }, + { "internalType": "uint256", "name": "reward", "type": "uint256" }, + { "internalType": "uint256", "name": "lp", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "emergencyWithdrawHCC", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { "inputs": [], "name": "harvest", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "minStakeAmount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], + "name": "pendingHCC", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "_HCCStakeReawardPool", "type": "address" }], + "name": "setHCCStakeReawardPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_minStakeAmount", "type": "uint256" }], + "name": "setMinStakeAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "setPause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "updatePool", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "userInfo", + "outputs": [ + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "rewardDebt", "type": "uint256" } + ], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "withdrawHCC", "outputs": [], "stateMutability": "nonpayable", "type": "function" } +] diff --git a/src/config/constants/boards.ts b/src/config/constants/boards.ts index 2213da9..3c662de 100644 --- a/src/config/constants/boards.ts +++ b/src/config/constants/boards.ts @@ -1,6 +1,8 @@ import addresses from 'config/constants/contracts' import boardAbi from 'config/abi/board.json' +import boardPoolAbi from 'config/abi/boardPool.json' import holderAbi from 'config/abi/holder.json' +import holderPoolAbis from 'config/abi/holderPool.json' import tokens from './tokens' import { BoardConfig } from './types' @@ -15,6 +17,7 @@ const boardsList: BoardConfig[] = [ contractAddress: addresses.boardChef, contractRewardAddress: addresses.boardRewardChef, abi: boardAbi, + poolAbi: boardPoolAbi, }, { pid: 2, @@ -26,6 +29,7 @@ const boardsList: BoardConfig[] = [ contractAddress: addresses.holderChef, contractRewardAddress: addresses.holderRewardChef, abi: holderAbi, + poolAbi: holderPoolAbis, }, ] diff --git a/src/config/constants/contracts.ts b/src/config/constants/contracts.ts index 6f79a7e..11e8b54 100644 --- a/src/config/constants/contracts.ts +++ b/src/config/constants/contracts.ts @@ -8,7 +8,7 @@ export default { 56: '0x6ab8463a4185b80905e05a9ff80a2d6b714b9e95', }, boardChef: { - 97: '0xcf5411e9bd61bbd68ddf08e8a3f7680af8993cd0', + 97: '0x0e28f80e6560f0ebbba4bbdf155a946053e5056a', 56: '0xD34871F12ace1BB8034E18009104b9dA60B84250', // NEED CHANGE 节点董事会合约 }, boardRewardChef: { @@ -16,7 +16,7 @@ export default { 56: '0xD34871F12ace1BB8034E18009104b9dA60B84250', // NEED CHANGE 节点董事会分红合约 }, holderChef: { - 97: '0x20b74dfb41172fdce43758c014959b5e2586d2cf', + 97: '0xafa64f22a09fc197949c45281b2ad381a2b623a3', 56: '0xD34871F12ace1BB8034E18009104b9dA60B84250', // NEED CHANGE 持币人 }, holderRewardChef: { diff --git a/src/config/constants/types.ts b/src/config/constants/types.ts index 23c4ba7..7126189 100644 --- a/src/config/constants/types.ts +++ b/src/config/constants/types.ts @@ -188,5 +188,6 @@ export interface BoardConfig { contractAddress: Address contractRewardAddress: Address abi: any + poolAbi: any // rewardAbi: any } diff --git a/src/config/localization/translations.json b/src/config/localization/translations.json index 54a04f2..b4e22aa 100644 --- a/src/config/localization/translations.json +++ b/src/config/localization/translations.json @@ -1184,68 +1184,71 @@ "Confirm this transaction in your wallet": "Confirm this transaction in your wallet", "Dismiss": "Dismiss", - "Hcc Info":"HighCityCoin abbreviation HCC,cause HighCityTM cast,", - "Hcc Nft":"Its function is mainly in HighCitySwap On the purchase NFT、NFT Boxes and other tradeable products.", - "Hcc BTC":"meanwhile,HCC and BTC、ETH Have the same properties,They can trade freely.", - "Bazaar":"NFT Bazaar", - "HlighCitySwapInfo":"HIighCitySwap the birth of,From the founder Liu Bus Enthusiastic pursuit of blockchain technology,He has always believed that blockchain technology could be used more widely。for this purpose,He made a brave decision,Abandon investments in other areas,Focus on the practical application of blockchain technology,Put yourself in a familiar field -- social networking on the Internet,Integration with blockchain technology,HighCitySwap Thus was born.That's where we started,Thank you for your support,HighCity The team will always move forward.", - "Stage one: Origin":"Stage one: Origin", - "Stage two: Action":"Stage two: Action", - "Stage three: Creation":"Stage three: Creation", - "Stage four: Integration":"Stage four: Integration", - "Stage five: Closing the curtain":"Stage five: Closing the curtain", - "The project concept was born in May 2021":"The project concept was born in May 2021;", - "Set up HighClty team in June 2021":"Set up HighClty team in June 2021;", - "May 2021 -- January 2022 Team run-in":"May 2021 -- January 2022 Team run-in;", - "In April 2022, social networking and media release activities, HighCity coin started and dividend mechanism went online":"In April 2022, social networking and media release activities, HighCity coin started and dividend mechanism went online;", - "In March 2022, project approval, web design, roadmap announcement, smart contract development":"In March 2022, project approval, web design, roadmap announcement, smart contract development;", - "Launch of social software in December 2022":"Launch of social software in December 2022;", - "Created by NFT in May 2022":"Created by NFT in May 2022;", - "June 2022 social software development":"June 2022 social software development;", - "December 2022 NFT bonus binding social software":"December 2022 NFT bonus binding social software;", - "In December 2022, HighCity Ecology was preliminarily completed":"In December 2022, HighCity Ecology was preliminarily completed;", - "HighCity Ecology completed in December 2022":"HighCity Ecology completed in December 2022", - "Maintain dividend income growth in December 2022":"Maintain dividend income growth in December 2022;", - "Buy commander NFT":"Buy commander NFT", - "Upgrade recommendation rights, can enjoy the share of secondary recommendation":"Upgrade recommendation rights, can enjoy the share of secondary recommendation", - "Enjoy a higher percentage than ordinary users":"Enjoy a higher percentage than ordinary users", - "Commander NFT can be traded in the NFT market":"Commander NFT can be traded in the NFT market", - "First stage sharing ratio":"First stage sharing ratio", - "Secondary split ratio":"Secondary split ratio", - "Buy It Now":"Buy It Now", - "recommend":"recommend", - "The lower the number of":"The lower the number of", - "NFT total revenue":"NFT total revenue", - "HCC total revenue":"HCC total revenue", - "To get profit":"To get profit", - "No income is received temporarily":"No income is received temporarily", - "Upgrade commander":"Upgrade commander", - "Regimental recommendation":"Regimental recommendation", - "Number of secondary subordinates":"Number of secondary subordinates", - "Number of first-level subordinates":"Number of first-level subordinates", - "Immediately to receive":"Immediately to receive", - "buy again":"buy again", - "Connect the purse":"Connect the purse", - "HCC total revenue percentage :10%":"HCC total revenue percentage :10%", - "Contract address":"ontract address", - "Assets agreement":"Assets agreement", - "Assets and chain":"Assets and chain", - "each time":"1. When the countdown is less than 1 hour, the countdown time will be increased by 1 hour each time", - "last bid":"2. Each auction has a fixed 10% markup. After the countdown, the item will be awarded to the bidder who made the last bid", - "commission fee":"3. After the auction is successful, the platform will charge 6% of the publisher's earnings as a commission fee", - "announcement":"announcement", - "return":"return", - "Total capital pool":"Total capital pool", - "The total amount of dividends":"The total amount of dividends", - "Pending dividend":"Pending dividend", - "Number of boards":"Number of boards", - "Number of holders":"Number of holders", - "total revenue":"total revenue", - "revenue":"revenue", - "purchase":"purchase", - "Enter a keyword search":"Enter a keyword search", - "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!", - "market value":"market value", - "Loaded all":"Loaded all" + "Hcc Info": "HighCityCoin abbreviation HCC,cause HighCityTM cast,", + "Hcc Nft": "Its function is mainly in HighCitySwap On the purchase NFT、NFT Boxes and other tradeable products.", + "Hcc BTC": "meanwhile,HCC and BTC、ETH Have the same properties,They can trade freely.", + "Bazaar": "NFT Bazaar", + "HlighCitySwapInfo": "HIighCitySwap the birth of,From the founder Liu Bus Enthusiastic pursuit of blockchain technology,He has always believed that blockchain technology could be used more widely。for this purpose,He made a brave decision,Abandon investments in other areas,Focus on the practical application of blockchain technology,Put yourself in a familiar field -- social networking on the Internet,Integration with blockchain technology,HighCitySwap Thus was born.That's where we started,Thank you for your support,HighCity The team will always move forward.", + "Stage one: Origin": "Stage one: Origin", + "Stage two: Action": "Stage two: Action", + "Stage three: Creation": "Stage three: Creation", + "Stage four: Integration": "Stage four: Integration", + "Stage five: Closing the curtain": "Stage five: Closing the curtain", + "The project concept was born in May 2021": "The project concept was born in May 2021;", + "Set up HighClty team in June 2021": "Set up HighClty team in June 2021;", + "May 2021 -- January 2022 Team run-in": "May 2021 -- January 2022 Team run-in;", + "In April 2022, social networking and media release activities, HighCity coin started and dividend mechanism went online": "In April 2022, social networking and media release activities, HighCity coin started and dividend mechanism went online;", + "In March 2022, project approval, web design, roadmap announcement, smart contract development": "In March 2022, project approval, web design, roadmap announcement, smart contract development;", + "Launch of social software in December 2022": "Launch of social software in December 2022;", + "Created by NFT in May 2022": "Created by NFT in May 2022;", + "June 2022 social software development": "June 2022 social software development;", + "December 2022 NFT bonus binding social software": "December 2022 NFT bonus binding social software;", + "In December 2022, HighCity Ecology was preliminarily completed": "In December 2022, HighCity Ecology was preliminarily completed;", + "HighCity Ecology completed in December 2022": "HighCity Ecology completed in December 2022", + "Maintain dividend income growth in December 2022": "Maintain dividend income growth in December 2022;", + "Buy commander NFT": "Buy commander NFT", + "Upgrade recommendation rights, can enjoy the share of secondary recommendation": "Upgrade recommendation rights, can enjoy the share of secondary recommendation", + "Enjoy a higher percentage than ordinary users": "Enjoy a higher percentage than ordinary users", + "Commander NFT can be traded in the NFT market": "Commander NFT can be traded in the NFT market", + "First stage sharing ratio": "First stage sharing ratio", + "Secondary split ratio": "Secondary split ratio", + "Buy It Now": "Buy It Now", + "recommend": "recommend", + "The lower the number of": "The lower the number of", + "NFT total revenue": "NFT total revenue", + "HCC total revenue": "HCC total revenue", + "To get profit": "To get profit", + "No income is received temporarily": "No income is received temporarily", + "Upgrade commander": "Upgrade commander", + "Regimental recommendation": "Regimental recommendation", + "Number of secondary subordinates": "Number of secondary subordinates", + "Number of first-level subordinates": "Number of first-level subordinates", + "Immediately to receive": "Immediately to receive", + "buy again": "buy again", + "Connect the purse": "Connect the purse", + "HCC total revenue percentage :10%": "HCC total revenue percentage :10%", + "Contract address": "ontract address", + "Assets agreement": "Assets agreement", + "Assets and chain": "Assets and chain", + "each time": "1. When the countdown is less than 1 hour, the countdown time will be increased by 1 hour each time", + "last bid": "2. Each auction has a fixed 10% markup. After the countdown, the item will be awarded to the bidder who made the last bid", + "commission fee": "3. After the auction is successful, the platform will charge 6% of the publisher's earnings as a commission fee", + "announcement": "announcement", + "return": "return", + "Total capital pool": "Total capital pool", + "The total amount of dividends": "The total amount of dividends", + "Pending dividend": "Pending dividend", + "Number of boards": "Number of boards", + "Number of holders": "Number of holders", + "total revenue": "total revenue", + "revenue": "revenue", + "purchase": "purchase", + "Enter a keyword search": "Enter a keyword search", + "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!", + "market value": "market value", + "Loaded all": "Loaded all", + "HCC Currency amount": "HCC Currency amount", + "Lock up time": "Lock up time", + "possess LP": "possess LP" } diff --git a/src/utils/formatBalance.ts b/src/utils/formatBalance.ts index 30a0c32..c5f31e5 100644 --- a/src/utils/formatBalance.ts +++ b/src/utils/formatBalance.ts @@ -64,3 +64,7 @@ export const formatFixedNumber = (number: ethers.FixedNumber, displayDecimals = const [leftSide] = number.toString().split('.') return formatBigNumber(ethers.BigNumber.from(leftSide), displayDecimals, decimals) } + +export const formatDivNumber = (number: 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 ff2e6ed..267e3a6 100644 --- a/src/views/Board/components/BoardCard/BoardCard.tsx +++ b/src/views/Board/components/BoardCard/BoardCard.tsx @@ -9,6 +9,7 @@ import ExpandableSectionButton from 'components/ExpandableSectionButton' import DetailsSection from './DetailsSection' import CardHeading from './CardHeading' import CardActionsContainer from './CardActionsContainer' +import FlexText from './FlexText' const RainbowLight = keyframes` 0% { @@ -79,9 +80,10 @@ interface NodeCardProps { removed: boolean provider?: ProviderType account?: string + list?: any } -const NodeCard: React.FC = ({ board, account }) => { +const NodeCard: React.FC = ({ board, account, list }) => { const { t } = useTranslation() const [showExpandableSection, setShowExpandableSection] = useState(false) @@ -89,6 +91,23 @@ const NodeCard: React.FC = ({ board, account }) => { return ( +
+ {list.map((item) => { + return ( +
+ {board.name === item.name ? ( + <> + + {item.name === 'Board' ? : ''} + + + ) : ( + <> + )} +
+ ) + })} +
{/* = ({ name, value }) => { + return ( + + {name} + {value} + + ) +} +export default FlexText diff --git a/src/views/Board/index.tsx b/src/views/Board/index.tsx index fd30ee6..2933c82 100644 --- a/src/views/Board/index.tsx +++ b/src/views/Board/index.tsx @@ -51,6 +51,13 @@ const Boards: React.FC = () => { const [totalAmount, setTotalAmount] = useState(0) // 分红总额 const [shareOutBonus, setShareOutBonus] = useState(0) + + const [boardNum, setBoardNum] = useState(0) + const [holderNum, setHolder] = useState(0) + + const [withdrawAmount, setWithdrawAmount] = useState(0) + + const [boardsDataList, setBoardsDataList] = useState([]) // // 获取资金池总额 // const getCapital = async () => { // const calls = boardsConfig.map((board) => { @@ -85,6 +92,7 @@ const Boards: React.FC = () => { }, ]) return { + name: boardConfig.name, totalAmount: getBalanceAmount(new BigNumber(boardPoolInfo.totalAmount._hex)).toNumber(), num: new BigNumber(boardPoolInfo?.num?._hex).toNumber(), waitWithdrawAmount: getBalanceAmount(new BigNumber(waitWithdrawAmount.balance._hex)).toNumber(), @@ -92,14 +100,47 @@ const Boards: React.FC = () => { }), ) console.log(boardsData) + let total = 0 + let waitWithdrawAmountValue = 0 + boardsData.forEach((item) => { + total += item.totalAmount + waitWithdrawAmountValue += item.waitWithdrawAmount + if (item.name === 'Board') { + setBoardNum(item.num) + } else if (item.name === 'Holder') { + setHolder(item.waitWithdrawAmount) + } + }) + setTotalAmount(total) + setShareOutBonus(waitWithdrawAmountValue) + } + // 获取信息 + const fetchInfo = async () => { + const boardsData = await Promise.all( + boardsConfig.map(async (boardConfig) => { + const [boardUserInfo] = await multicall(boardConfig.poolAbi, [ + { + address: getAddress(boardConfig.contractAddress), + name: 'userInfo', + params: [account], + }, + ]) + return { + name: boardConfig.name, + amount: getBalanceAmount(new BigNumber(boardUserInfo.amount?._hex)).toNumber(), + rewardDebt: getBalanceAmount(new BigNumber(boardUserInfo.rewardDebt?._hex)).toNumber(), + unLockTime: new BigNumber(boardUserInfo?.unLockTime?._hex).toNumber(), + } + }), + ) + setBoardsDataList(boardsData) } - useEffect(() => { dispatch(fetchBoardsPublicDataAsync()) fetchBoardShares() if (account) { + fetchInfo() dispatch(fetchBoardUserDataAsync(account)) - // getCapital() } }, [account, dispatch, fastRefresh]) @@ -108,7 +149,7 @@ const Boards: React.FC = () => {
{boardsList.map((board) => ( - + ))}
@@ -125,8 +166,8 @@ const Boards: React.FC = () => { {/* */} - - + + {renderContent()} diff --git a/src/views/Referral/components/BuyNftModal.tsx b/src/views/Referral/components/BuyNftModal.tsx index e37443e..abee484 100644 --- a/src/views/Referral/components/BuyNftModal.tsx +++ b/src/views/Referral/components/BuyNftModal.tsx @@ -1,5 +1,6 @@ import React from 'react' import styled from 'styled-components' +import { formatDivNumber } from 'utils/formatBalance' import { useTranslation } from 'contexts/Localization' import { useReferralNormalConfigInfo, useReferralCommanderConfigInfo } from 'state/referral/hooks' import { Flex, Button, Modal, Image } from '@pancakeswap/uikit' @@ -66,8 +67,11 @@ const BuyNftModal: React.FC = ({ onDismiss }) => { /> - - + + diff --git a/src/views/Referral/components/Connected.tsx b/src/views/Referral/components/Connected.tsx index 9651bbc..93ffb5b 100644 --- a/src/views/Referral/components/Connected.tsx +++ b/src/views/Referral/components/Connected.tsx @@ -1,5 +1,6 @@ import React from 'react' import styled from 'styled-components' +import { formatDivNumber } from 'utils/formatBalance' import { useTranslation } from 'contexts/Localization' import { Button, useModal, Text } from '@pancakeswap/uikit' import { inviteReceive } from 'services/referral' @@ -55,7 +56,9 @@ const ConnectedCom: React.FC = () => { const { t } = useTranslation() const [onBuyModal] = useModal() const referralNormalConfigInfo = useReferralNormalConfigInfo() + console.log('referralNormalConfigInfo:', referralNormalConfigInfo) const referralRewardInfo = useReferralRewardInfo() + console.log('referralRewardInfo:', referralRewardInfo) const referralCommanderConfigInfo = useReferralCommanderConfigInfo() const getInviteReceive = async () => { await inviteReceive() @@ -86,7 +89,7 @@ const ConnectedCom: React.FC = () => { {`${t( 'By using the invitation at the top right of the page, new users can be invited to enter and obtained after users purchase coins', - )}${referralCommanderConfigInfo.dividendFirst / 10000}%${t('The commission')}`} + )}${formatDivNumber(referralCommanderConfigInfo.dividendFirst)}%${t('The commission')}`} {/* {t('each time')} {t('last bid')} {t('commission fee')} */} diff --git a/src/views/Referral/components/Regimental.tsx b/src/views/Referral/components/Regimental.tsx index d88649e..5c3bc6b 100644 --- a/src/views/Referral/components/Regimental.tsx +++ b/src/views/Referral/components/Regimental.tsx @@ -1,5 +1,6 @@ import React from 'react' import styled from 'styled-components' +import { formatDivNumber } from 'utils/formatBalance' import { useTranslation } from 'contexts/Localization' import { inviteReceive } from 'services/referral' import { useReferralCommanderConfigInfo, useReferralRewardInfo } from 'state/referral/hooks' @@ -95,17 +96,22 @@ const RegimentalCom: React.FC = () => { <> - - + + + - {/* { {`${t( 'By using the invitation at the top right of the page, new users can be invited to enter and obtained after users purchase coins', - )}${referralCommanderConfigInfo.dividendFirst / 10000}%${t('The commission')}`} + )}${formatDivNumber(referralCommanderConfigInfo.dividendFirst)}%${t('The commission')}`} {/* {t('each time')} {t('last bid')} {t('commission fee')} */}