feat: 修改董事会
This commit is contained in:
parent
196f9a8119
commit
1bff22307b
|
|
@ -1,14 +1,14 @@
|
||||||
REACT_APP_CHAIN_ID = "56"
|
REACT_APP_CHAIN_ID = "97"
|
||||||
REACT_APP_GTAG = "GTM-PXLD3XW"
|
REACT_APP_GTAG = "GTM-PXLD3XW"
|
||||||
|
|
||||||
# 10+ nodes balanced, US/EU
|
# 10+ nodes balanced, US/EU
|
||||||
REACT_APP_NODE_1 = "https://bsc-dataseed1.ninicoin.io"
|
REACT_APP_NODE_1 = "https://data-seed-prebsc-1-s1.binance.org:8545"
|
||||||
|
|
||||||
# 10+ nodes balanced, US/EU
|
# 10+ nodes balanced, US/EU
|
||||||
REACT_APP_NODE_2 = "https://bsc-dataseed1.defibit.io"
|
REACT_APP_NODE_2 = "https://data-seed-prebsc-1-s1.binance.org:8545"
|
||||||
|
|
||||||
# 10+ nodes balanced in each region, global
|
# 10+ nodes balanced in each region, global
|
||||||
REACT_APP_NODE_3 = "https://bsc-dataseed.binance.org"
|
REACT_APP_NODE_3 = "https://data-seed-prebsc-1-s1.binance.org:8545"
|
||||||
|
|
||||||
REACT_APP_GRAPH_API_PROFILE = "https://api.thegraph.com/subgraphs/name/pancakeswap/profile"
|
REACT_APP_GRAPH_API_PROFILE = "https://api.thegraph.com/subgraphs/name/pancakeswap/profile"
|
||||||
REACT_APP_GRAPH_API_PREDICTION = "https://api.thegraph.com/subgraphs/name/pancakeswap/prediction"
|
REACT_APP_GRAPH_API_PREDICTION = "https://api.thegraph.com/subgraphs/name/pancakeswap/prediction"
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@
|
||||||
"canvas-confetti": "^1.3.3",
|
"canvas-confetti": "^1.3.3",
|
||||||
"cids": "^1.0.0",
|
"cids": "^1.0.0",
|
||||||
"date-fns": "^2.21.3",
|
"date-fns": "^2.21.3",
|
||||||
|
"dayjs": "^1.11.1",
|
||||||
"easymde": "^2.15.0",
|
"easymde": "^2.15.0",
|
||||||
"ethers": "^5.1.4",
|
"ethers": "^5.1.4",
|
||||||
"graphql": "^15.5.0",
|
"graphql": "^15.5.0",
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,7 @@ const App: React.FC = () => {
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="/board">
|
<Route path="/board">
|
||||||
<Board />
|
<Board />
|
||||||
|
</Route>
|
||||||
<Route path="/nft">
|
<Route path="/nft">
|
||||||
<Nft />
|
<Nft />
|
||||||
</Route>
|
</Route>
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,11 @@ const config: (t: ContextApi['t']) => MenuEntry[] = (t) => [
|
||||||
icon: 'TicketIcon',
|
icon: 'TicketIcon',
|
||||||
href: '/nft',
|
href: '/nft',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: t('Board'),
|
||||||
|
icon: 'TicketIcon',
|
||||||
|
href: '/board',
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// label: t('Prediction (BETA)'),
|
// label: t('Prediction (BETA)'),
|
||||||
// icon: 'PredictionsIcon',
|
// icon: 'PredictionsIcon',
|
||||||
|
|
|
||||||
|
|
@ -1,464 +1,387 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
"internalType": "address",
|
"internalType": "contract IERC20",
|
||||||
"name": "_candy",
|
"name": "_HCC",
|
||||||
"type": "address"
|
"type": "address"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"internalType": "address",
|
"internalType": "address",
|
||||||
"name": "_xCandy",
|
"name": "_HCCBODReawardPool",
|
||||||
"type": "address"
|
"type": "address"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"internalType": "bool",
|
"internalType": "uint256",
|
||||||
"name": "_turnOnCondition",
|
"name": "_minStakeAmount",
|
||||||
"type": "bool"
|
"type": "uint256"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"type": "constructor"
|
"type": "constructor"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"anonymous": false,
|
"anonymous": false,
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
"indexed": true,
|
"indexed": true,
|
||||||
"internalType": "address",
|
"internalType": "address",
|
||||||
"name": "user",
|
"name": "user",
|
||||||
"type": "address"
|
"type": "address"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"indexed": false,
|
"indexed": false,
|
||||||
"internalType": "uint256",
|
"internalType": "uint256",
|
||||||
"name": "amount",
|
"name": "value",
|
||||||
"type": "uint256"
|
"type": "uint256"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "Deposit",
|
"name": "Deposit",
|
||||||
"type": "event"
|
"type": "event"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"anonymous": false,
|
"anonymous": false,
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
"indexed": true,
|
"indexed": true,
|
||||||
"internalType": "address",
|
"internalType": "address",
|
||||||
"name": "user",
|
"name": "user",
|
||||||
"type": "address"
|
"type": "address"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"indexed": false,
|
"indexed": false,
|
||||||
"internalType": "uint256",
|
"internalType": "uint256",
|
||||||
"name": "amount",
|
"name": "amount",
|
||||||
"type": "uint256"
|
"type": "uint256"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "EmergencyWithdraw",
|
"name": "EmergencyWithdraw",
|
||||||
"type": "event"
|
"type": "event"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"anonymous": false,
|
"anonymous": false,
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
"indexed": true,
|
"indexed": true,
|
||||||
"internalType": "address",
|
"internalType": "address",
|
||||||
"name": "to",
|
"name": "previousOwner",
|
||||||
"type": "address"
|
"type": "address"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"indexed": false,
|
"indexed": true,
|
||||||
"internalType": "uint256",
|
"internalType": "address",
|
||||||
"name": "amount",
|
"name": "newOwner",
|
||||||
"type": "uint256"
|
"type": "address"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "NodeReward",
|
"name": "OwnershipTransferred",
|
||||||
"type": "event"
|
"type": "event"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"anonymous": false,
|
"anonymous": false,
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
"indexed": true,
|
"indexed": false,
|
||||||
"internalType": "address",
|
"internalType": "address",
|
||||||
"name": "previousOwner",
|
"name": "newHCCBODReawardPool",
|
||||||
"type": "address"
|
"type": "address"
|
||||||
},
|
}
|
||||||
{
|
],
|
||||||
"indexed": true,
|
"name": "SetHCCBODReawardPoolEvent",
|
||||||
"internalType": "address",
|
"type": "event"
|
||||||
"name": "newOwner",
|
},
|
||||||
"type": "address"
|
{
|
||||||
}
|
"anonymous": false,
|
||||||
],
|
"inputs": [
|
||||||
"name": "OwnershipTransferred",
|
{
|
||||||
"type": "event"
|
"indexed": false,
|
||||||
},
|
"internalType": "uint256",
|
||||||
{
|
"name": "newLockTime",
|
||||||
"anonymous": false,
|
"type": "uint256"
|
||||||
"inputs": [
|
}
|
||||||
{
|
],
|
||||||
"indexed": true,
|
"name": "SetLockTimeEvent",
|
||||||
"internalType": "address",
|
"type": "event"
|
||||||
"name": "user",
|
},
|
||||||
"type": "address"
|
{
|
||||||
},
|
"anonymous": false,
|
||||||
{
|
"inputs": [
|
||||||
"indexed": false,
|
{
|
||||||
"internalType": "uint256",
|
"indexed": false,
|
||||||
"name": "amount",
|
"internalType": "uint256",
|
||||||
"type": "uint256"
|
"name": "newMinStakeAmount",
|
||||||
}
|
"type": "uint256"
|
||||||
],
|
}
|
||||||
"name": "Withdraw",
|
],
|
||||||
"type": "event"
|
"name": "SetMinStakeAmontEvent",
|
||||||
},
|
"type": "event"
|
||||||
{
|
},
|
||||||
"anonymous": false,
|
{
|
||||||
"inputs": [
|
"anonymous": false,
|
||||||
{
|
"inputs": [
|
||||||
"indexed": true,
|
{
|
||||||
"internalType": "address",
|
"indexed": true,
|
||||||
"name": "from",
|
"internalType": "address",
|
||||||
"type": "address"
|
"name": "user",
|
||||||
},
|
"type": "address"
|
||||||
{
|
},
|
||||||
"indexed": false,
|
{
|
||||||
"internalType": "uint256",
|
"indexed": false,
|
||||||
"name": "amount",
|
"internalType": "uint256",
|
||||||
"type": "uint256"
|
"name": "amount",
|
||||||
}
|
"type": "uint256"
|
||||||
],
|
}
|
||||||
"name": "WithdrawNodeReward",
|
],
|
||||||
"type": "event"
|
"name": "Withdraw",
|
||||||
},
|
"type": "event"
|
||||||
{
|
},
|
||||||
"inputs": [],
|
{
|
||||||
"name": "Candy",
|
"inputs": [],
|
||||||
"outputs": [
|
"name": "HCC",
|
||||||
{
|
"outputs": [
|
||||||
"internalType": "contract IHRC20",
|
{
|
||||||
"name": "",
|
"internalType": "contract IERC20",
|
||||||
"type": "address"
|
"name": "",
|
||||||
}
|
"type": "address"
|
||||||
],
|
}
|
||||||
"stateMutability": "view",
|
],
|
||||||
"type": "function"
|
"stateMutability": "view",
|
||||||
},
|
"type": "function"
|
||||||
{
|
},
|
||||||
"inputs": [],
|
{
|
||||||
"name": "XCandy",
|
"inputs": [],
|
||||||
"outputs": [
|
"name": "HCCBODReawardPool",
|
||||||
{
|
"outputs": [
|
||||||
"internalType": "contract IHRC20",
|
{
|
||||||
"name": "",
|
"internalType": "address",
|
||||||
"type": "address"
|
"name": "",
|
||||||
}
|
"type": "address"
|
||||||
],
|
}
|
||||||
"stateMutability": "view",
|
],
|
||||||
"type": "function"
|
"stateMutability": "view",
|
||||||
},
|
"type": "function"
|
||||||
{
|
},
|
||||||
"inputs": [
|
{
|
||||||
{
|
"inputs": [],
|
||||||
"internalType": "address",
|
"name": "_poolInfo",
|
||||||
"name": "from",
|
"outputs": [
|
||||||
"type": "address"
|
{
|
||||||
},
|
"internalType": "uint256",
|
||||||
{
|
"name": "accHCCPerShare",
|
||||||
"internalType": "uint256",
|
"type": "uint256"
|
||||||
"name": "rewardNum",
|
},
|
||||||
"type": "uint256"
|
{
|
||||||
}
|
"internalType": "uint256",
|
||||||
],
|
"name": "totalAmount",
|
||||||
"name": "addNodeReward",
|
"type": "uint256"
|
||||||
"outputs": [
|
}
|
||||||
{
|
],
|
||||||
"internalType": "bool",
|
"stateMutability": "view",
|
||||||
"name": "",
|
"type": "function"
|
||||||
"type": "bool"
|
},
|
||||||
}
|
{
|
||||||
],
|
"inputs": [
|
||||||
"stateMutability": "nonpayable",
|
{
|
||||||
"type": "function"
|
"internalType": "uint256",
|
||||||
},
|
"name": "_amount",
|
||||||
{
|
"type": "uint256"
|
||||||
"inputs": [
|
},
|
||||||
{
|
{
|
||||||
"internalType": "address",
|
"internalType": "address",
|
||||||
"name": "account",
|
"name": "_userAddress",
|
||||||
"type": "address"
|
"type": "address"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "addWhitelisted",
|
"name": "deposit",
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [],
|
||||||
{
|
"name": "emergencyWithdrawHCC",
|
||||||
"internalType": "address",
|
"outputs": [],
|
||||||
"name": "",
|
"stateMutability": "nonpayable",
|
||||||
"type": "address"
|
"type": "function"
|
||||||
}
|
},
|
||||||
],
|
{
|
||||||
"name": "canGetRewardMap",
|
"inputs": [],
|
||||||
"outputs": [
|
"name": "lockTime",
|
||||||
{
|
"outputs": [
|
||||||
"internalType": "uint256",
|
{
|
||||||
"name": "",
|
"internalType": "uint256",
|
||||||
"type": "uint256"
|
"name": "",
|
||||||
}
|
"type": "uint256"
|
||||||
],
|
}
|
||||||
"stateMutability": "view",
|
],
|
||||||
"type": "function"
|
"stateMutability": "view",
|
||||||
},
|
"type": "function"
|
||||||
{
|
},
|
||||||
"inputs": [
|
{
|
||||||
{
|
"inputs": [],
|
||||||
"internalType": "uint256",
|
"name": "minStakeAmount",
|
||||||
"name": "_thresholdDivider",
|
"outputs": [
|
||||||
"type": "uint256"
|
{
|
||||||
}
|
"internalType": "uint256",
|
||||||
],
|
"name": "",
|
||||||
"name": "changeThresholdDivider",
|
"type": "uint256"
|
||||||
"outputs": [],
|
}
|
||||||
"stateMutability": "nonpayable",
|
],
|
||||||
"type": "function"
|
"stateMutability": "view",
|
||||||
},
|
"type": "function"
|
||||||
{
|
},
|
||||||
"inputs": [],
|
{
|
||||||
"name": "conditionTurnOn",
|
"inputs": [],
|
||||||
"outputs": [
|
"name": "owner",
|
||||||
{
|
"outputs": [
|
||||||
"internalType": "bool",
|
{
|
||||||
"name": "",
|
"internalType": "address",
|
||||||
"type": "bool"
|
"name": "",
|
||||||
}
|
"type": "address"
|
||||||
],
|
}
|
||||||
"stateMutability": "view",
|
],
|
||||||
"type": "function"
|
"stateMutability": "view",
|
||||||
},
|
"type": "function"
|
||||||
{
|
},
|
||||||
"inputs": [
|
{
|
||||||
{
|
"inputs": [],
|
||||||
"internalType": "uint256",
|
"name": "paused",
|
||||||
"name": "_amount",
|
"outputs": [
|
||||||
"type": "uint256"
|
{
|
||||||
}
|
"internalType": "bool",
|
||||||
],
|
"name": "",
|
||||||
"name": "enterStake",
|
"type": "bool"
|
||||||
"outputs": [],
|
}
|
||||||
"stateMutability": "nonpayable",
|
],
|
||||||
"type": "function"
|
"stateMutability": "view",
|
||||||
},
|
"type": "function"
|
||||||
{
|
},
|
||||||
"inputs": [],
|
{
|
||||||
"name": "firstStakeThreshold",
|
"inputs": [
|
||||||
"outputs": [
|
{
|
||||||
{
|
"internalType": "address",
|
||||||
"internalType": "uint256",
|
"name": "_user",
|
||||||
"name": "",
|
"type": "address"
|
||||||
"type": "uint256"
|
}
|
||||||
}
|
],
|
||||||
],
|
"name": "pendingHCC",
|
||||||
"stateMutability": "view",
|
"outputs": [
|
||||||
"type": "function"
|
{
|
||||||
},
|
"internalType": "uint256",
|
||||||
{
|
"name": "",
|
||||||
"inputs": [
|
"type": "uint256"
|
||||||
{
|
}
|
||||||
"internalType": "address",
|
],
|
||||||
"name": "_findAddress",
|
"stateMutability": "view",
|
||||||
"type": "address"
|
"type": "function"
|
||||||
}
|
},
|
||||||
],
|
{
|
||||||
"name": "getIsNodeMembers",
|
"inputs": [],
|
||||||
"outputs": [
|
"name": "renounceOwnership",
|
||||||
{
|
"outputs": [],
|
||||||
"internalType": "bool",
|
"stateMutability": "nonpayable",
|
||||||
"name": "",
|
"type": "function"
|
||||||
"type": "bool"
|
},
|
||||||
}
|
{
|
||||||
],
|
"inputs": [
|
||||||
"stateMutability": "view",
|
{
|
||||||
"type": "function"
|
"internalType": "address",
|
||||||
},
|
"name": "_HCCBODReawardPool",
|
||||||
{
|
"type": "address"
|
||||||
"inputs": [
|
}
|
||||||
{
|
],
|
||||||
"internalType": "address",
|
"name": "setHCCBODReawardPool",
|
||||||
"name": "account",
|
"outputs": [],
|
||||||
"type": "address"
|
"stateMutability": "nonpayable",
|
||||||
}
|
"type": "function"
|
||||||
],
|
},
|
||||||
"name": "isWhitelisted",
|
{
|
||||||
"outputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
"internalType": "bool",
|
"internalType": "uint256",
|
||||||
"name": "",
|
"name": "_lockTime",
|
||||||
"type": "bool"
|
"type": "uint256"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"stateMutability": "view",
|
"name": "setLockTime",
|
||||||
"type": "function"
|
"outputs": [],
|
||||||
},
|
"stateMutability": "nonpayable",
|
||||||
{
|
"type": "function"
|
||||||
"inputs": [],
|
},
|
||||||
"name": "leaveStake",
|
{
|
||||||
"outputs": [],
|
"inputs": [
|
||||||
"stateMutability": "nonpayable",
|
{
|
||||||
"type": "function"
|
"internalType": "uint256",
|
||||||
},
|
"name": "_minStakeAmount",
|
||||||
{
|
"type": "uint256"
|
||||||
"inputs": [],
|
}
|
||||||
"name": "leaveStakePrecheck",
|
],
|
||||||
"outputs": [
|
"name": "setMinStakeAmount",
|
||||||
{
|
"outputs": [],
|
||||||
"internalType": "bool",
|
"stateMutability": "nonpayable",
|
||||||
"name": "",
|
"type": "function"
|
||||||
"type": "bool"
|
},
|
||||||
}
|
{
|
||||||
],
|
"inputs": [],
|
||||||
"stateMutability": "view",
|
"name": "setPause",
|
||||||
"type": "function"
|
"outputs": [],
|
||||||
},
|
"stateMutability": "nonpayable",
|
||||||
{
|
"type": "function"
|
||||||
"inputs": [
|
},
|
||||||
{
|
{
|
||||||
"internalType": "address",
|
"inputs": [
|
||||||
"name": "",
|
{
|
||||||
"type": "address"
|
"internalType": "address",
|
||||||
}
|
"name": "newOwner",
|
||||||
],
|
"type": "address"
|
||||||
"name": "nodeMembers",
|
}
|
||||||
"outputs": [
|
],
|
||||||
{
|
"name": "transferOwnership",
|
||||||
"internalType": "bool",
|
"outputs": [],
|
||||||
"name": "",
|
"stateMutability": "nonpayable",
|
||||||
"type": "bool"
|
"type": "function"
|
||||||
}
|
},
|
||||||
],
|
{
|
||||||
"stateMutability": "view",
|
"inputs": [],
|
||||||
"type": "function"
|
"name": "updatePool",
|
||||||
},
|
"outputs": [],
|
||||||
{
|
"stateMutability": "nonpayable",
|
||||||
"inputs": [],
|
"type": "function"
|
||||||
"name": "nodeToPeriod",
|
},
|
||||||
"outputs": [
|
{
|
||||||
{
|
"inputs": [
|
||||||
"internalType": "uint256",
|
{
|
||||||
"name": "",
|
"internalType": "address",
|
||||||
"type": "uint256"
|
"name": "",
|
||||||
}
|
"type": "address"
|
||||||
],
|
}
|
||||||
"stateMutability": "view",
|
],
|
||||||
"type": "function"
|
"name": "userInfo",
|
||||||
},
|
"outputs": [
|
||||||
{
|
{
|
||||||
"inputs": [],
|
"internalType": "uint256",
|
||||||
"name": "owner",
|
"name": "amount",
|
||||||
"outputs": [
|
"type": "uint256"
|
||||||
{
|
},
|
||||||
"internalType": "address",
|
{
|
||||||
"name": "",
|
"internalType": "uint256",
|
||||||
"type": "address"
|
"name": "rewardDebt",
|
||||||
}
|
"type": "uint256"
|
||||||
],
|
},
|
||||||
"stateMutability": "view",
|
{
|
||||||
"type": "function"
|
"internalType": "uint256",
|
||||||
},
|
"name": "unLockTime",
|
||||||
{
|
"type": "uint256"
|
||||||
"inputs": [
|
}
|
||||||
{
|
],
|
||||||
"internalType": "address",
|
"stateMutability": "view",
|
||||||
"name": "account",
|
"type": "function"
|
||||||
"type": "address"
|
},
|
||||||
}
|
{
|
||||||
],
|
"inputs": [],
|
||||||
"name": "removeWhitelisted",
|
"name": "withdrawHCC",
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
}
|
||||||
{
|
]
|
||||||
"inputs": [],
|
|
||||||
"name": "renounceOwnership",
|
|
||||||
"outputs": [],
|
|
||||||
"stateMutability": "nonpayable",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"internalType": "bool",
|
|
||||||
"name": "_turnOn",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "switchCondition",
|
|
||||||
"outputs": [],
|
|
||||||
"stateMutability": "nonpayable",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [],
|
|
||||||
"name": "thresholdDivider",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "newOwner",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transferOwnership",
|
|
||||||
"outputs": [],
|
|
||||||
"stateMutability": "nonpayable",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "userInfo",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "amount",
|
|
||||||
"type": "uint256"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "stakeTs",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [],
|
|
||||||
"name": "withDrawReward",
|
|
||||||
"outputs": [],
|
|
||||||
"stateMutability": "nonpayable",
|
|
||||||
"type": "function"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
@ -0,0 +1,405 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "address", "name": "_hccAddress", "type": "address" },
|
||||||
|
{ "internalType": "address", "name": "_otherPaymentAddress", "type": "address" },
|
||||||
|
{ "internalType": "uint256", "name": "_hccPirce", "type": "uint256" },
|
||||||
|
{ "internalType": "uint256", "name": "_otherPaymentPirce", "type": "uint256" }
|
||||||
|
],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "constructor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [
|
||||||
|
{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" },
|
||||||
|
{ "indexed": true, "internalType": "address", "name": "approved", "type": "address" },
|
||||||
|
{ "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }
|
||||||
|
],
|
||||||
|
"name": "Approval",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [
|
||||||
|
{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" },
|
||||||
|
{ "indexed": true, "internalType": "address", "name": "operator", "type": "address" },
|
||||||
|
{ "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" }
|
||||||
|
],
|
||||||
|
"name": "ApprovalForAll",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [
|
||||||
|
{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" },
|
||||||
|
{ "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" },
|
||||||
|
{ "indexed": true, "internalType": "uint256", "name": "code", "type": "uint256" }
|
||||||
|
],
|
||||||
|
"name": "CreateNft",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [{ "indexed": false, "internalType": "address", "name": "newHccAddress", "type": "address" }],
|
||||||
|
"name": "HccAddressChange",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [{ "indexed": false, "internalType": "uint256", "name": "newHccPrice", "type": "uint256" }],
|
||||||
|
"name": "HccPriceChange",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [{ "indexed": false, "internalType": "address", "name": "newOtherPaymentAddress", "type": "address" }],
|
||||||
|
"name": "OtherPaymentAddressChange",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [{ "indexed": false, "internalType": "uint256", "name": "newOtherPaymentPirce", "type": "uint256" }],
|
||||||
|
"name": "OtherPaymentPirceChange",
|
||||||
|
"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": "bool", "name": "pause", "type": "bool" }],
|
||||||
|
"name": "PauseEvent",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [
|
||||||
|
{ "indexed": true, "internalType": "address", "name": "from", "type": "address" },
|
||||||
|
{ "indexed": true, "internalType": "address", "name": "to", "type": "address" },
|
||||||
|
{ "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }
|
||||||
|
],
|
||||||
|
"name": "Transfer",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "START_AT",
|
||||||
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "_lastTokenID",
|
||||||
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "address", "name": "to", "type": "address" },
|
||||||
|
{ "internalType": "uint256", "name": "_timestamp", "type": "uint256" },
|
||||||
|
{ "internalType": "uint256", "name": "code", "type": "uint256" },
|
||||||
|
{ "internalType": "bytes", "name": "_signature", "type": "bytes" }
|
||||||
|
],
|
||||||
|
"name": "adminMint",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "address", "name": "to", "type": "address" },
|
||||||
|
{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }
|
||||||
|
],
|
||||||
|
"name": "approve",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "address", "name": "owner", "type": "address" }],
|
||||||
|
"name": "balanceOf",
|
||||||
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "baseTokenURI",
|
||||||
|
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "executorAddress",
|
||||||
|
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }],
|
||||||
|
"name": "getApproved",
|
||||||
|
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "hccAddress",
|
||||||
|
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "hccPirce",
|
||||||
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "address", "name": "owner", "type": "address" },
|
||||||
|
{ "internalType": "address", "name": "operator", "type": "address" }
|
||||||
|
],
|
||||||
|
"name": "isApprovedForAll",
|
||||||
|
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{ "inputs": [], "name": "mint", "outputs": [], "stateMutability": "nonpayable", "type": "function" },
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "name",
|
||||||
|
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "otherPaymentAddress",
|
||||||
|
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "otherPaymentPirce",
|
||||||
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "owner",
|
||||||
|
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }],
|
||||||
|
"name": "ownerOf",
|
||||||
|
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }],
|
||||||
|
"name": "rawOwnerOf",
|
||||||
|
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{ "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" },
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "address", "name": "from", "type": "address" },
|
||||||
|
{ "internalType": "address", "name": "to", "type": "address" },
|
||||||
|
{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }
|
||||||
|
],
|
||||||
|
"name": "safeTransferFrom",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "address", "name": "from", "type": "address" },
|
||||||
|
{ "internalType": "address", "name": "to", "type": "address" },
|
||||||
|
{ "internalType": "uint256", "name": "tokenId", "type": "uint256" },
|
||||||
|
{ "internalType": "bytes", "name": "_data", "type": "bytes" }
|
||||||
|
],
|
||||||
|
"name": "safeTransferFrom",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "address", "name": "operator", "type": "address" },
|
||||||
|
{ "internalType": "bool", "name": "approved", "type": "bool" }
|
||||||
|
],
|
||||||
|
"name": "setApprovalForAll",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "string", "name": "baseURI", "type": "string" }],
|
||||||
|
"name": "setBaseURI",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "address", "name": "executor", "type": "address" }],
|
||||||
|
"name": "setExecutorAddress",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "address", "name": "newHccAddress", "type": "address" }],
|
||||||
|
"name": "setHccAddress",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "uint256", "name": "newHccPirce", "type": "uint256" }],
|
||||||
|
"name": "setHccPirce",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "address", "name": "newOtherPaymentAddress", "type": "address" }],
|
||||||
|
"name": "setOtherPaymentAddress",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "uint256", "name": "newOtherPaymentPirce", "type": "uint256" }],
|
||||||
|
"name": "setOtherPaymentPirce",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "bool", "name": "_pause", "type": "bool" }],
|
||||||
|
"name": "setPause",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "address", "name": "wallet", "type": "address" },
|
||||||
|
{ "internalType": "uint256", "name": "code", "type": "uint256" },
|
||||||
|
{ "internalType": "uint256", "name": "_timestamp", "type": "uint256" },
|
||||||
|
{ "internalType": "bytes", "name": "_signature", "type": "bytes" }
|
||||||
|
],
|
||||||
|
"name": "signatureWallet",
|
||||||
|
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
||||||
|
"stateMutability": "pure",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }],
|
||||||
|
"name": "supportsInterface",
|
||||||
|
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "symbol",
|
||||||
|
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "uint256", "name": "index", "type": "uint256" }],
|
||||||
|
"name": "tokenByIndex",
|
||||||
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "address", "name": "owner", "type": "address" },
|
||||||
|
{ "internalType": "uint256", "name": "index", "type": "uint256" }
|
||||||
|
],
|
||||||
|
"name": "tokenOfOwnerByIndex",
|
||||||
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }],
|
||||||
|
"name": "tokenURI",
|
||||||
|
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "totalSupply",
|
||||||
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "totalToken",
|
||||||
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "address", "name": "from", "type": "address" },
|
||||||
|
{ "internalType": "address", "name": "to", "type": "address" },
|
||||||
|
{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }
|
||||||
|
],
|
||||||
|
"name": "transferFrom",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }],
|
||||||
|
"name": "transferOwnership",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }],
|
||||||
|
"name": "walletOfOwner",
|
||||||
|
"outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "address", "name": "tokenAddress", "type": "address" },
|
||||||
|
{ "internalType": "address", "name": "to", "type": "address" },
|
||||||
|
{ "internalType": "uint256", "name": "value", "type": "uint256" }
|
||||||
|
],
|
||||||
|
"name": "withDrawToken",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -1,17 +1,19 @@
|
||||||
import contracts from './contracts'
|
import addresses from 'config/constants/contracts'
|
||||||
|
import boardChef from 'config/abi/board.json'
|
||||||
import tokens from './tokens'
|
import tokens from './tokens'
|
||||||
import { BoardConfig } from './types'
|
import { BoardConfig } from './types'
|
||||||
|
|
||||||
const BoardList: BoardConfig[] = [
|
const bordsList: BoardConfig[] = [
|
||||||
{
|
{
|
||||||
pid: 1,
|
pid: 1,
|
||||||
name: 'Nodes',
|
name: 'Board',
|
||||||
img: 'nodes',
|
img: 'nodes',
|
||||||
stringId: 100004,
|
|
||||||
tokenSymbol: tokens.hcc.symbol,
|
tokenSymbol: tokens.hcc.symbol,
|
||||||
tokenAddresses: tokens.hcc.address,
|
tokenAddresses: tokens.hcc.address,
|
||||||
tokenDecimals: 18,
|
tokenDecimals: 18,
|
||||||
|
contractAddress: addresses.boardChef,
|
||||||
|
abi: boardChef,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
export default BoardList
|
export default bordsList
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,12 @@ export default {
|
||||||
56: '0x6ab8463a4185b80905e05a9ff80a2d6b714b9e95',
|
56: '0x6ab8463a4185b80905e05a9ff80a2d6b714b9e95',
|
||||||
},
|
},
|
||||||
boardChef: {
|
boardChef: {
|
||||||
97: '0x4BC67bBC22a245035fDd1F00DCa7d4F2E1e8f636',
|
97: '0x0dF74009bF2b85b2B19FC7aF67DD5AAF2cde4Ce0',
|
||||||
56: '0xD34871F12ace1BB8034E18009104b9dA60B84250', // NEED CHANGE 节点董事会合约
|
56: '0xD34871F12ace1BB8034E18009104b9dA60B84250', // NEED CHANGE 节点董事会合约
|
||||||
},
|
},
|
||||||
referralChef: {
|
referralChef: {
|
||||||
97: '0x3Dcf2586519a25719658Afb2cDB4CEf0DD647Ea3',
|
97: '0xE79D28722220fcC13833476E327DEA3a663f64DB',
|
||||||
56: '0x88F46EF2Ee08494D84942DCA3bd24cDEf7C88Ae2', // NEED CHANGE 邀请合约
|
56: '0x88F46EF2Ee08494D84942DCA3bd24cDEf7C88Ae2', // NEED CHANGE 邀请或则军团长
|
||||||
},
|
},
|
||||||
lotteryV2: {
|
lotteryV2: {
|
||||||
97: '0x5790c3534F30437641541a0FA04C992799602998',
|
97: '0x5790c3534F30437641541a0FA04C992799602998',
|
||||||
|
|
|
||||||
|
|
@ -91,3 +91,4 @@ export const BLOCKED_ADDRESSES: string[] = [
|
||||||
export { default as farmsConfig } from './farms'
|
export { default as farmsConfig } from './farms'
|
||||||
export { default as poolsConfig } from './pools'
|
export { default as poolsConfig } from './pools'
|
||||||
export { default as ifosConfig } from './ifo'
|
export { default as ifosConfig } from './ifo'
|
||||||
|
export { default as boardConfig } from './boards'
|
||||||
|
|
|
||||||
|
|
@ -60,11 +60,20 @@ export const USDC = new Token(
|
||||||
)
|
)
|
||||||
|
|
||||||
const tokens = {
|
const tokens = {
|
||||||
|
usdt: {
|
||||||
|
symbol: 'USDT',
|
||||||
|
address: {
|
||||||
|
56: '0x55d398326f99059fF775485246999027B3197955',
|
||||||
|
97: '0xaC893B498E2005Af4cb8b03D710F187EC23a8f5f',
|
||||||
|
},
|
||||||
|
decimals: 18,
|
||||||
|
projectLink: 'https://tether.to/',
|
||||||
|
},
|
||||||
hcc: {
|
hcc: {
|
||||||
symbol: 'HCC',
|
symbol: 'HCC',
|
||||||
address: {
|
address: {
|
||||||
56: '0x20de22029ab63cf9A7Cf5fEB2b737Ca1eE4c82A6',
|
56: '0x20de22029ab63cf9A7Cf5fEB2b737Ca1eE4c82A6',
|
||||||
97: '0x71D239B4564DC00d994AbF6E6cD7582dd873649E',
|
97: '0xbdd6c43fb8e97a73e464fca5ab6f3d2f402be20c',
|
||||||
},
|
},
|
||||||
decimals: 18,
|
decimals: 18,
|
||||||
projectLink: 'https://tranchess.com/',
|
projectLink: 'https://tranchess.com/',
|
||||||
|
|
@ -902,15 +911,7 @@ const tokens = {
|
||||||
decimals: 18,
|
decimals: 18,
|
||||||
projectLink: 'https://chain.link/',
|
projectLink: 'https://chain.link/',
|
||||||
},
|
},
|
||||||
usdt: {
|
|
||||||
symbol: 'USDT',
|
|
||||||
address: {
|
|
||||||
56: '0x55d398326f99059fF775485246999027B3197955',
|
|
||||||
97: '0xE02dF9e3e622DeBdD69fb838bB799E3F168902c5',
|
|
||||||
},
|
|
||||||
decimals: 18,
|
|
||||||
projectLink: 'https://tether.to/',
|
|
||||||
},
|
|
||||||
btcb: {
|
btcb: {
|
||||||
symbol: 'BTCB',
|
symbol: 'BTCB',
|
||||||
address: {
|
address: {
|
||||||
|
|
|
||||||
|
|
@ -185,4 +185,6 @@ export interface BoardConfig {
|
||||||
tokenSymbol: string
|
tokenSymbol: string
|
||||||
tokenAddresses: Address
|
tokenAddresses: Address
|
||||||
tokenDecimals: number
|
tokenDecimals: number
|
||||||
|
contractAddress: Address
|
||||||
|
abi: any
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ export const CAKE_PER_YEAR = CAKE_PER_BLOCK.times(BLOCKS_PER_YEAR)
|
||||||
export const BASE_URL = 'https://pancakeswap.finance'
|
export const BASE_URL = 'https://pancakeswap.finance'
|
||||||
export const BASE_ADD_LIQUIDITY_URL = `${BASE_URL}/add`
|
export const BASE_ADD_LIQUIDITY_URL = `${BASE_URL}/add`
|
||||||
export const BASE_LIQUIDITY_POOL_URL = `${BASE_URL}/pool`
|
export const BASE_LIQUIDITY_POOL_URL = `${BASE_URL}/pool`
|
||||||
export const BASE_BSC_SCAN_URL = BASE_BSC_SCAN_URLS[ChainId.MAINNET]
|
export const BASE_BSC_SCAN_URL = BASE_BSC_SCAN_URLS[ChainId.TESTNET]
|
||||||
export const LOTTERY_MAX_NUMBER_OF_TICKETS = 50
|
export const LOTTERY_MAX_NUMBER_OF_TICKETS = 50
|
||||||
export const LOTTERY_TICKET_PRICE = 1
|
export const LOTTERY_TICKET_PRICE = 1
|
||||||
export const DEFAULT_TOKEN_DECIMAL = BIG_TEN.pow(18)
|
export const DEFAULT_TOKEN_DECIMAL = BIG_TEN.pow(18)
|
||||||
|
|
|
||||||
|
|
@ -100,9 +100,9 @@ export const useMasterchef = () => {
|
||||||
const { library } = useActiveWeb3React()
|
const { library } = useActiveWeb3React()
|
||||||
return useMemo(() => getMasterchefContract(library.getSigner()), [library])
|
return useMemo(() => getMasterchefContract(library.getSigner()), [library])
|
||||||
}
|
}
|
||||||
export const useBoardchef = () => {
|
export const useBoardchef = (id: number) => {
|
||||||
const { library } = useActiveWeb3React()
|
const { library } = useActiveWeb3React()
|
||||||
return useMemo(() => getBoardchefContract(library.getSigner()), [library])
|
return useMemo(() => getBoardchefContract(id, library.getSigner()), [library])
|
||||||
}
|
}
|
||||||
export const useReferralchef = () => {
|
export const useReferralchef = () => {
|
||||||
const { library } = useActiveWeb3React()
|
const { library } = useActiveWeb3React()
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ const fetchBoards = async () => {
|
||||||
const data = await Promise.all(
|
const data = await Promise.all(
|
||||||
boardsConfig.map(async (boardConfig) => {
|
boardsConfig.map(async (boardConfig) => {
|
||||||
const tokenAddress = getAddress(boardConfig.tokenAddresses)
|
const tokenAddress = getAddress(boardConfig.tokenAddresses)
|
||||||
const BoardChefAddress = getBoardAddress()
|
const BoardChefAddress = getAddress(boardConfig.contractAddress)
|
||||||
const calls = [
|
const calls = [
|
||||||
// 查节点的代币数量
|
// 查节点的代币数量
|
||||||
{
|
{
|
||||||
|
|
@ -26,18 +26,27 @@ const fetchBoards = async () => {
|
||||||
// eslint-disable-next-line prefer-const
|
// eslint-disable-next-line prefer-const
|
||||||
let [tokenBalance, tokenDecimals] = await multicall(erc20, calls)
|
let [tokenBalance, tokenDecimals] = await multicall(erc20, calls)
|
||||||
tokenBalance = new BigNumber(tokenBalance).div(new BigNumber(10).pow(tokenDecimals))
|
tokenBalance = new BigNumber(tokenBalance).div(new BigNumber(10).pow(tokenDecimals))
|
||||||
let [minStakeAmount] = await multicall(boardchefABI, [
|
// eslint-disable-next-line prefer-const
|
||||||
|
let [minStakeAmount, lockTime] = await multicall(boardConfig.abi, [
|
||||||
// 最低质押额度
|
// 最低质押额度
|
||||||
{
|
{
|
||||||
address: BoardChefAddress,
|
address: BoardChefAddress,
|
||||||
name: 'firstStakeThreshold',
|
name: 'minStakeAmount',
|
||||||
|
},
|
||||||
|
// 最低质押额度
|
||||||
|
{
|
||||||
|
address: BoardChefAddress,
|
||||||
|
name: 'lockTime',
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
lockTime = new BigNumber(lockTime).toJSON()
|
||||||
|
console.log(lockTime)
|
||||||
minStakeAmount = new BigNumber(minStakeAmount).div(new BigNumber(10).pow(tokenDecimals)).toJSON()
|
minStakeAmount = new BigNumber(minStakeAmount).div(new BigNumber(10).pow(tokenDecimals)).toJSON()
|
||||||
return {
|
return {
|
||||||
...boardConfig,
|
...boardConfig,
|
||||||
tokenBalance: tokenBalance.toJSON(),
|
tokenBalance: tokenBalance.toJSON(),
|
||||||
minStakeAmount,
|
minStakeAmount,
|
||||||
|
lockTime,
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,11 @@ import boardABI from 'config/abi/board.json'
|
||||||
import multicall from 'utils/multicall'
|
import multicall from 'utils/multicall'
|
||||||
import boardsConfig from 'config/constants/boards'
|
import boardsConfig from 'config/constants/boards'
|
||||||
import { getAddress, getBoardAddress } from 'utils/addressHelpers'
|
import { getAddress, getBoardAddress } from 'utils/addressHelpers'
|
||||||
import contracts from 'config/constants/contracts'
|
|
||||||
import tokens from 'config/constants/tokens'
|
|
||||||
|
|
||||||
export const fetchBoardUserAllowances = async (account: string) => {
|
export const fetchBoardUserAllowances = async (account: string) => {
|
||||||
const calls = boardsConfig.map((board) => {
|
const calls = boardsConfig.map((board) => {
|
||||||
const tokenAddresses = getAddress(board.tokenAddresses)
|
const tokenAddresses = getAddress(board.tokenAddresses)
|
||||||
const boardChefAdress = getBoardAddress()
|
const boardChefAdress = getAddress(board.contractAddress)
|
||||||
return { address: tokenAddresses, name: 'allowance', params: [account, boardChefAdress] }
|
return { address: tokenAddresses, name: 'allowance', params: [account, boardChefAdress] }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -38,54 +36,30 @@ export const fetchBoardUserTokenBalances = async (account: string) => {
|
||||||
return parsedTokenBalances
|
return parsedTokenBalances
|
||||||
}
|
}
|
||||||
|
|
||||||
export const fetchBoardUserStakedBalances = async (account: string) => {
|
export const fetchBoardUserInfo = async (account: string) => {
|
||||||
const calls = boardsConfig.map((board) => {
|
const data = await Promise.all(
|
||||||
const boardChefAdress = getBoardAddress()
|
boardsConfig.map(async (board) => {
|
||||||
return {
|
const boardChefAdress = getAddress(board.contractAddress)
|
||||||
address: boardChefAdress,
|
const calls = [
|
||||||
name: 'userInfo',
|
{
|
||||||
params: [account],
|
address: boardChefAdress,
|
||||||
}
|
name: 'userInfo',
|
||||||
})
|
params: [account],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
address: boardChefAdress,
|
||||||
|
name: 'pendingHCC',
|
||||||
|
params: [account],
|
||||||
|
},
|
||||||
|
]
|
||||||
|
const [userInfo, estimatedProfit] = await multicall(boardABI, calls)
|
||||||
|
return {
|
||||||
|
stakedBalance: new BigNumber(userInfo.amount._hex).toJSON(),
|
||||||
|
unLockTime: new BigNumber(userInfo.unLockTime._hex).toNumber(),
|
||||||
|
estimatedProfit: new BigNumber(estimatedProfit).toJSON(),
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
const rawStakedBalances = await multicall(boardABI, calls)
|
return data
|
||||||
const parsedStakedBalances = rawStakedBalances.map((stakedBalance) => {
|
|
||||||
return {
|
|
||||||
stakedBalance: new BigNumber(stakedBalance[0]._hex).toJSON(),
|
|
||||||
stakedTime: new BigNumber(stakedBalance[1]._hex).toNumber(),
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return parsedStakedBalances
|
|
||||||
}
|
|
||||||
|
|
||||||
export const fetchBoardUserUnlockTime = async (account: string) => {
|
|
||||||
const calls = boardsConfig.map((board) => {
|
|
||||||
const boardChefAdress = getBoardAddress()
|
|
||||||
return {
|
|
||||||
address: boardChefAdress,
|
|
||||||
name: 'boardToPeriod',
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const rawUnlockTime = await multicall(boardABI, calls)
|
|
||||||
const parsedUnlockTime = rawUnlockTime.map((time) => {
|
|
||||||
return new BigNumber(time[0]._hex).toNumber()
|
|
||||||
})
|
|
||||||
return parsedUnlockTime
|
|
||||||
}
|
|
||||||
|
|
||||||
export const fetchUserXCandyBalance = async (account: string) => {
|
|
||||||
const calls = boardsConfig.map((board) => {
|
|
||||||
return {
|
|
||||||
address: getAddress(tokens.hcc.address),
|
|
||||||
name: 'balanceOf',
|
|
||||||
params: [account],
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const rawXTokenBalance = await multicall(erc20ABI, calls)
|
|
||||||
const parsedXTokenBalance = rawXTokenBalance.map((item) => {
|
|
||||||
return new BigNumber(item[0]._hex).toJSON()
|
|
||||||
})
|
|
||||||
return parsedXTokenBalance
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,7 @@ import { createSlice } from '@reduxjs/toolkit'
|
||||||
import BigNumber from 'bignumber.js'
|
import BigNumber from 'bignumber.js'
|
||||||
import boardsConfig from 'config/constants/boards'
|
import boardsConfig from 'config/constants/boards'
|
||||||
import fetchBoards from './fetchBoards'
|
import fetchBoards from './fetchBoards'
|
||||||
import {
|
import { fetchBoardUserAllowances, fetchBoardUserTokenBalances, fetchBoardUserInfo } from './fetchBoardsUser'
|
||||||
fetchBoardUserAllowances,
|
|
||||||
fetchBoardUserTokenBalances,
|
|
||||||
fetchBoardUserStakedBalances,
|
|
||||||
fetchBoardUserUnlockTime,
|
|
||||||
fetchUserXCandyBalance,
|
|
||||||
} from './fetchBoardsUser'
|
|
||||||
import { BoardsState, Boards } from '../types'
|
import { BoardsState, Boards } from '../types'
|
||||||
|
|
||||||
const initialState: BoardsState = { data: [...boardsConfig] }
|
const initialState: BoardsState = { data: [...boardsConfig] }
|
||||||
|
|
@ -46,17 +40,15 @@ export const fetchBoardsPublicDataAsync = () => async (dispatch) => {
|
||||||
export const fetchBoardUserDataAsync = (account) => async (dispatch) => {
|
export const fetchBoardUserDataAsync = (account) => async (dispatch) => {
|
||||||
const userBoardAllowances = await fetchBoardUserAllowances(account)
|
const userBoardAllowances = await fetchBoardUserAllowances(account)
|
||||||
const userBoardTokenBalances = await fetchBoardUserTokenBalances(account)
|
const userBoardTokenBalances = await fetchBoardUserTokenBalances(account)
|
||||||
const userStakedBalances = await fetchBoardUserStakedBalances(account)
|
const userInfo = await fetchBoardUserInfo(account)
|
||||||
const userUnlockTimes = await fetchBoardUserUnlockTime(account)
|
|
||||||
const userXCandyBalances = await fetchUserXCandyBalance(account)
|
|
||||||
const arrayOfUserDataObjects = userBoardAllowances.map((nodeAllowance, index) => {
|
const arrayOfUserDataObjects = userBoardAllowances.map((nodeAllowance, index) => {
|
||||||
return {
|
return {
|
||||||
index,
|
index,
|
||||||
allowance: userBoardAllowances[index],
|
allowance: userBoardAllowances[index],
|
||||||
tokenBalance: userBoardTokenBalances[index],
|
tokenBalance: userBoardTokenBalances[index],
|
||||||
stakedBalance: userStakedBalances[index].stakedBalance,
|
stakedBalance: userInfo[index].stakedBalance,
|
||||||
xCandyBalance: userXCandyBalances[index],
|
unlockTime: userInfo[index].unLockTime,
|
||||||
unlockTime: userUnlockTimes[index] + userStakedBalances[index].stakedTime,
|
estimatedProfit: userInfo[index].estimatedProfit,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,7 @@ export const useBoardUser = (pid) => {
|
||||||
tokenBalance: board.userData ? new BigNumber(board.userData.tokenBalance) : new BigNumber(0),
|
tokenBalance: board.userData ? new BigNumber(board.userData.tokenBalance) : new BigNumber(0),
|
||||||
stakedBalance: board.userData ? new BigNumber(board.userData.stakedBalance) : new BigNumber(0),
|
stakedBalance: board.userData ? new BigNumber(board.userData.stakedBalance) : new BigNumber(0),
|
||||||
unlockTime: board.userData ? board.userData.unlockTime : 0,
|
unlockTime: board.userData ? board.userData.unlockTime : 0,
|
||||||
xCandyBalance: board.userData ? board.userData.xCandyBalance : 0,
|
estimatedProfit: board.userData ? board.userData.estimatedProfit : 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// cake
|
// cake
|
||||||
|
|
|
||||||
|
|
@ -516,7 +516,7 @@ export interface Boards extends BoardConfig {
|
||||||
tokenBalance: BigNumber
|
tokenBalance: BigNumber
|
||||||
stakedBalance: BigNumber
|
stakedBalance: BigNumber
|
||||||
unlockTime: number
|
unlockTime: number
|
||||||
xCandyBalance: number
|
estimatedProfit: number
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export interface BoardsState {
|
export interface BoardsState {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
import BigNumber from 'bignumber.js'
|
||||||
|
import { DEFAULT_GAS_LIMIT, DEFAULT_TOKEN_DECIMAL } from 'config'
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
gasLimit: DEFAULT_GAS_LIMIT,
|
||||||
|
}
|
||||||
|
|
||||||
|
export const stakeBoard = async (masterChefContract, pid, amount) => {
|
||||||
|
const value = new BigNumber(amount).times(DEFAULT_TOKEN_DECIMAL).toString()
|
||||||
|
|
||||||
|
const tx = await masterChefContract.deposit(pid, value, options)
|
||||||
|
const receipt = await tx.wait()
|
||||||
|
return receipt.status
|
||||||
|
}
|
||||||
|
|
||||||
|
export const unstakeBoard = async (masterChefContract, pid, amount) => {
|
||||||
|
const value = new BigNumber(amount).times(DEFAULT_TOKEN_DECIMAL).toString()
|
||||||
|
const tx = await masterChefContract.withdrawHCC(pid, value, options)
|
||||||
|
const receipt = await tx.wait()
|
||||||
|
return receipt.status
|
||||||
|
}
|
||||||
|
|
||||||
|
export const harvestBoard = async (masterChefContract, pid) => {
|
||||||
|
const tx = await masterChefContract.harvest(pid, '0', options)
|
||||||
|
const receipt = await tx.wait()
|
||||||
|
return receipt.status
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
export * from './estimateGas'
|
export * from './estimateGas'
|
||||||
export * from './farms'
|
export * from './farms'
|
||||||
export * from './pools'
|
export * from './pools'
|
||||||
|
export * from './boards'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { ethers } from 'ethers'
|
import { ethers } from 'ethers'
|
||||||
import { simpleRpcProvider } from 'utils/providers'
|
import { simpleRpcProvider } from 'utils/providers'
|
||||||
import { poolsConfig } from 'config/constants'
|
import { poolsConfig, boardConfig } from 'config/constants'
|
||||||
import { PoolCategory } from 'config/constants/types'
|
import { PoolCategory } from 'config/constants/types'
|
||||||
|
|
||||||
// Addresses
|
// Addresses
|
||||||
|
|
@ -115,8 +115,9 @@ export const getLotteryV2Contract = (signer?: ethers.Signer | ethers.providers.P
|
||||||
export const getMasterchefContract = (signer?: ethers.Signer | ethers.providers.Provider) => {
|
export const getMasterchefContract = (signer?: ethers.Signer | ethers.providers.Provider) => {
|
||||||
return getContract(masterChef, getMasterChefAddress(), signer)
|
return getContract(masterChef, getMasterChefAddress(), signer)
|
||||||
}
|
}
|
||||||
export const getBoardchefContract = (signer?: ethers.Signer | ethers.providers.Provider) => {
|
export const getBoardchefContract = (id: number, signer?: ethers.Signer | ethers.providers.Provider) => {
|
||||||
return getContract(boardChef, getBoardAddress(), signer)
|
const config = boardConfig.find((board) => board.pid === id)
|
||||||
|
return getContract(config.abi, getAddress(config.contractAddress), signer)
|
||||||
}
|
}
|
||||||
export const getReferralchefContract = (signer?: ethers.Signer | ethers.providers.Provider) => {
|
export const getReferralchefContract = (signer?: ethers.Signer | ethers.providers.Provider) => {
|
||||||
return getContract(referralChef, getReferralAddress(), signer)
|
return getContract(referralChef, getReferralAddress(), signer)
|
||||||
|
|
|
||||||
|
|
@ -88,10 +88,9 @@ const NodeCard: React.FC<NodeCardProps> = ({ board, account }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FCard>
|
<FCard>
|
||||||
{/* {true && <StyledCardAccent />} */}
|
|
||||||
<CardHeading name={t(board.name)} img={board.img} tokenSymbol={board.tokenSymbol} />
|
<CardHeading name={t(board.name)} img={board.img} tokenSymbol={board.tokenSymbol} />
|
||||||
<CardActionsContainer node={board} account={account} />
|
<CardActionsContainer board={board} account={account} />
|
||||||
<Divider />
|
{/* <Divider />
|
||||||
<ExpandableSectionButton
|
<ExpandableSectionButton
|
||||||
onClick={() => setShowExpandableSection(!showExpandableSection)}
|
onClick={() => setShowExpandableSection(!showExpandableSection)}
|
||||||
expanded={showExpandableSection}
|
expanded={showExpandableSection}
|
||||||
|
|
@ -101,7 +100,7 @@ const NodeCard: React.FC<NodeCardProps> = ({ board, account }) => {
|
||||||
bscScanAddress={`${process.env.REACT_APP_NETWORK_URL}/address/${getBoardAddress()}`}
|
bscScanAddress={`${process.env.REACT_APP_NETWORK_URL}/address/${getBoardAddress()}`}
|
||||||
totalValueFormated={board.tokenBalance || '-'}
|
totalValueFormated={board.tokenBalance || '-'}
|
||||||
/>
|
/>
|
||||||
</ExpandingWrapper>
|
</ExpandingWrapper> */}
|
||||||
</FCard>
|
</FCard>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,20 +19,20 @@ const Action = styled.div`
|
||||||
`
|
`
|
||||||
|
|
||||||
interface NodeCardActionsProps {
|
interface NodeCardActionsProps {
|
||||||
node: Boards
|
board: Boards
|
||||||
provider?: ProviderType
|
provider?: ProviderType
|
||||||
account?: string
|
account?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const CardActions: React.FC<NodeCardActionsProps> = ({ node, account }) => {
|
const CardActions: React.FC<NodeCardActionsProps> = ({ board, account }) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const [requestedApproval, setRequestedApproval] = useState(false)
|
const [requestedApproval, setRequestedApproval] = useState(false)
|
||||||
const pid = node.pid
|
const pid = board.pid
|
||||||
const { allowance, tokenBalance, stakedBalance, xCandyBalance } = useBoardUser(pid)
|
const { allowance, tokenBalance, stakedBalance, estimatedProfit } = useBoardUser(pid)
|
||||||
const isApproved = account && allowance && allowance.isGreaterThan(0)
|
const isApproved = account && allowance && allowance.isGreaterThan(0)
|
||||||
const tokenContract = useERC20(getAddress(node.tokenAddresses))
|
const tokenContract = useERC20(getAddress(board.tokenAddresses))
|
||||||
|
|
||||||
const { onApprove } = useApproveBoard(tokenContract)
|
const { onApprove } = useApproveBoard(tokenContract, pid)
|
||||||
|
|
||||||
const handleApprove = useCallback(async () => {
|
const handleApprove = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -50,15 +50,12 @@ const CardActions: React.FC<NodeCardActionsProps> = ({ node, account }) => {
|
||||||
<StakeAction stakedBalance={stakedBalance} tokenBalance={tokenBalance} pid={pid} />
|
<StakeAction stakedBalance={stakedBalance} tokenBalance={tokenBalance} pid={pid} />
|
||||||
<Flex flexDirection="column" alignItems="flex-start" mt="10">
|
<Flex flexDirection="column" alignItems="flex-start" mt="10">
|
||||||
<Flex>
|
<Flex>
|
||||||
<Text bold textTransform="uppercase" color="secondary" fontSize="12px" pr="3px">
|
|
||||||
{TOKEN_SYMBOL}
|
|
||||||
</Text>
|
|
||||||
<Text color="textSubtle" fontSize="12px">
|
<Text color="textSubtle" fontSize="12px">
|
||||||
{t('Amount')}
|
{t('TotalProfit')}
|
||||||
</Text>
|
</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Text bold textTransform="uppercase" fontSize="20px">
|
<Text bold textTransform="uppercase" fontSize="20px">
|
||||||
{getBalanceNumber(new BigNumber(xCandyBalance))}
|
{getBalanceNumber(new BigNumber(estimatedProfit))}
|
||||||
</Text>
|
</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
</>
|
</>
|
||||||
|
|
@ -73,7 +70,7 @@ const CardActions: React.FC<NodeCardActionsProps> = ({ node, account }) => {
|
||||||
<Action>
|
<Action>
|
||||||
<Flex>
|
<Flex>
|
||||||
<Text bold textTransform="uppercase" color="secondary" fontSize="12px" pr="3px">
|
<Text bold textTransform="uppercase" color="secondary" fontSize="12px" pr="3px">
|
||||||
{node.tokenSymbol}
|
{board.tokenSymbol}
|
||||||
</Text>
|
</Text>
|
||||||
<Text bold textTransform="uppercase" color="textSubtle" fontSize="12px">
|
<Text bold textTransform="uppercase" color="textSubtle" fontSize="12px">
|
||||||
{t('Staked')}
|
{t('Staked')}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ const CardHeading: React.FC<ExpandableSectionProps> = ({ name, img, tokenSymbol
|
||||||
<Image src={`/images/nodes/${img}.png`} width={64} height={64} />
|
<Image src={`/images/nodes/${img}.png`} width={64} height={64} />
|
||||||
<Flex>
|
<Flex>
|
||||||
<Heading mb="4px">{name}</Heading>
|
<Heading mb="4px">{name}</Heading>
|
||||||
<Question text={t('To join board, you need to stake at least 0.1% total supply of Token')} />
|
{/* <Question text={t('To join board, you need to stake at least 0.1% total supply of Token')} /> */}
|
||||||
</Flex>
|
</Flex>
|
||||||
</Wrapper>
|
</Wrapper>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ const DetailsSection: React.FC<ExpandableSectionProps> = ({ bscScanAddress, remo
|
||||||
{/* )} */}
|
{/* )} */}
|
||||||
<Flex justifyContent="flex-start">
|
<Flex justifyContent="flex-start">
|
||||||
<Link external href={bscScanAddress} bold={false}>
|
<Link external href={bscScanAddress} bold={false}>
|
||||||
{t( 'View on BscScan')}
|
{t('View on BscScan')}
|
||||||
</Link>
|
</Link>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Wrapper>
|
</Wrapper>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
import React, { useMemo } from 'react'
|
import React, { useMemo } from 'react'
|
||||||
// import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import styled from 'styled-components'
|
import styled from 'styled-components'
|
||||||
import BigNumber from 'bignumber.js'
|
import BigNumber from 'bignumber.js'
|
||||||
import { Button, Flex, Heading, IconButton, AddIcon, MinusIcon, useModal } from '@pancakeswap/uikit'
|
import { Button, Flex, Heading, IconButton, AddIcon, MinusIcon, useModal } from '@pancakeswap/uikit'
|
||||||
|
|
||||||
// import { NODE_UNLOCK_TIME } from 'config/index'
|
|
||||||
import { getBalanceNumber } from 'utils/formatBalance'
|
import { getBalanceNumber } from 'utils/formatBalance'
|
||||||
import { useBoardsFromPid } from 'state/hooks'
|
import { useBoardsFromPid } from 'state/hooks'
|
||||||
import { useTranslation } from 'contexts/Localization'
|
import { useTranslation } from 'contexts/Localization'
|
||||||
|
|
@ -52,20 +50,11 @@ const StakeAction: React.FC<NodeCardActionsProps> = ({ stakedBalance, tokenBalan
|
||||||
<WithdrawModal max={stakedBalance} tokenDecimals={tokenDecimals} onConfirm={onUnstake} tokenName={tokenName} />,
|
<WithdrawModal max={stakedBalance} tokenDecimals={tokenDecimals} onConfirm={onUnstake} tokenName={tokenName} />,
|
||||||
)
|
)
|
||||||
const handleUnstake = () => {
|
const handleUnstake = () => {
|
||||||
// const unstakeDay = new Date().getDay()
|
const unlockTime = userData.unlockTime * 1000
|
||||||
// const unlockTime = userData.unlockTime * 1000
|
if (unlockTime > new Date().getTime()) {
|
||||||
// // 只能周五解锁 NEED CHANGE
|
toastWarning(t('Unlock time %unlockTime%', { unlockTime: dayjs(unlockTime).format('YYYY-MM-DD HH:mm') }))
|
||||||
// if (unstakeDay !== NODE_UNLOCK_TIME || unlockTime > new Date().getTime()) {
|
// return
|
||||||
// toastWarning(
|
}
|
||||||
// TranslateString(101012, 'Unlock time'),
|
|
||||||
// `${dayjs(unlockTime).format('YYYY-MM-DD HH:mm')} Next Friday`, // NEED CHANGE
|
|
||||||
// )
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// if (new BigNumber(userData.stakedBalance).toJSON() !== new BigNumber(userData.xCandyBalance).toJSON()) {
|
|
||||||
// toastWarning(TranslateString(100103, 'Hint'), TranslateString(101019, 'Unlocking conditions are not met'))
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// onUnstake()
|
// onUnstake()
|
||||||
}
|
}
|
||||||
const renderStakingButtons = () => {
|
const renderStakingButtons = () => {
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ import { useCallback } from 'react'
|
||||||
import { ethers, Contract } from 'ethers'
|
import { ethers, Contract } from 'ethers'
|
||||||
import { useBoardchef } from 'hooks/useContract'
|
import { useBoardchef } from 'hooks/useContract'
|
||||||
|
|
||||||
const useApproveBoard = (lpContract: Contract) => {
|
const useApproveBoard = (lpContract: Contract, pid) => {
|
||||||
const boardChefContract = useBoardchef()
|
const boardChefContract = useBoardchef(pid)
|
||||||
const handleApprove = useCallback(async () => {
|
const handleApprove = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
const tx = await lpContract.approve(boardChefContract.address, ethers.constants.MaxUint256)
|
const tx = await lpContract.approve(boardChefContract.address, ethers.constants.MaxUint256)
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
import { useCallback } from 'react'
|
import { useCallback } from 'react'
|
||||||
import { harvestFarm } from 'utils/calls'
|
import { harvestBoard } from 'utils/calls'
|
||||||
import { useBoardchef } from 'hooks/useContract'
|
import { useBoardchef } from 'hooks/useContract'
|
||||||
|
|
||||||
const useHarvestBoard = (boardPid: number) => {
|
const useHarvestBoard = (boardPid: number) => {
|
||||||
const boardChefContract = useBoardchef()
|
const boardChefContract = useBoardchef(boardPid)
|
||||||
|
|
||||||
const handleHarvest = useCallback(async () => {
|
const handleHarvest = useCallback(async () => {
|
||||||
await harvestFarm(boardChefContract, boardPid)
|
await harvestBoard(boardChefContract, boardPid)
|
||||||
}, [boardPid, boardChefContract])
|
}, [boardPid, boardChefContract])
|
||||||
|
|
||||||
return { onReward: handleHarvest }
|
return { onReward: handleHarvest }
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
import { useCallback } from 'react'
|
import { useCallback } from 'react'
|
||||||
import { stakeFarm } from 'utils/calls'
|
import { stakeBoard } from 'utils/calls'
|
||||||
import { useBoardchef } from 'hooks/useContract'
|
import { useBoardchef } from 'hooks/useContract'
|
||||||
|
|
||||||
const useStakeBoard = (pid: number) => {
|
const useStakeBoard = (pid: number) => {
|
||||||
const boardChefContract = useBoardchef()
|
const boardChefContract = useBoardchef(pid)
|
||||||
|
|
||||||
const handleStake = useCallback(
|
const handleStake = useCallback(
|
||||||
async (amount: string) => {
|
async (amount: string) => {
|
||||||
const txHash = await stakeFarm(boardChefContract, pid, amount)
|
const txHash = await stakeBoard(boardChefContract, pid, amount)
|
||||||
console.info(txHash)
|
console.info(txHash)
|
||||||
},
|
},
|
||||||
[boardChefContract, pid],
|
[boardChefContract, pid],
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
import { useCallback } from 'react'
|
import { useCallback } from 'react'
|
||||||
import { unstakeFarm } from 'utils/calls'
|
import { unstakeBoard } from 'utils/calls'
|
||||||
import { useBoardchef } from 'hooks/useContract'
|
import { useBoardchef } from 'hooks/useContract'
|
||||||
|
|
||||||
const useUnstakeBoard = (pid: number) => {
|
const useUnstakeBoard = (pid: number) => {
|
||||||
const boardChefContract = useBoardchef()
|
const boardChefContract = useBoardchef(pid)
|
||||||
|
|
||||||
const handleUnstake = useCallback(
|
const handleUnstake = useCallback(
|
||||||
async (amount: string) => {
|
async (amount: string) => {
|
||||||
await unstakeFarm(boardChefContract, pid, amount)
|
await unstakeBoard(boardChefContract, pid, amount)
|
||||||
},
|
},
|
||||||
[boardChefContract, pid],
|
[boardChefContract, pid],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -7638,6 +7638,11 @@ date-fns@^2.0.1, date-fns@^2.21.3:
|
||||||
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.22.1.tgz#1e5af959831ebb1d82992bf67b765052d8f0efc4"
|
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.22.1.tgz#1e5af959831ebb1d82992bf67b765052d8f0efc4"
|
||||||
integrity sha512-yUFPQjrxEmIsMqlHhAhmxkuH769baF21Kk+nZwZGyrMoyLA+LugaQtC0+Tqf9CBUUULWwUJt6Q5ySI3LJDDCGg==
|
integrity sha512-yUFPQjrxEmIsMqlHhAhmxkuH769baF21Kk+nZwZGyrMoyLA+LugaQtC0+Tqf9CBUUULWwUJt6Q5ySI3LJDDCGg==
|
||||||
|
|
||||||
|
dayjs@^1.11.1:
|
||||||
|
version "1.11.1"
|
||||||
|
resolved "https://registry.npmjs.org/dayjs/-/dayjs-1.11.1.tgz#90b33a3dda3417258d48ad2771b415def6545eb0"
|
||||||
|
integrity sha512-ER7EjqVAMkRRsxNCC5YqJ9d9VQYuWdGt7aiH2qA5R5wt8ZmWaP2dLUSIK6y/kVzLMlmh1Tvu5xUf4M/wdGJ5KA==
|
||||||
|
|
||||||
debug-fabulous@0.0.X:
|
debug-fabulous@0.0.X:
|
||||||
version "0.0.4"
|
version "0.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/debug-fabulous/-/debug-fabulous-0.0.4.tgz#fa071c5d87484685424807421ca4b16b0b1a0763"
|
resolved "https://registry.yarnpkg.com/debug-fabulous/-/debug-fabulous-0.0.4.tgz#fa071c5d87484685424807421ca4b16b0b1a0763"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue