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"
|
||||
|
||||
# 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
|
||||
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
|
||||
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_PREDICTION = "https://api.thegraph.com/subgraphs/name/pancakeswap/prediction"
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@
|
|||
"canvas-confetti": "^1.3.3",
|
||||
"cids": "^1.0.0",
|
||||
"date-fns": "^2.21.3",
|
||||
"dayjs": "^1.11.1",
|
||||
"easymde": "^2.15.0",
|
||||
"ethers": "^5.1.4",
|
||||
"graphql": "^15.5.0",
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ const App: React.FC = () => {
|
|||
</Route>
|
||||
<Route path="/board">
|
||||
<Board />
|
||||
</Route>
|
||||
<Route path="/nft">
|
||||
<Nft />
|
||||
</Route>
|
||||
|
|
|
|||
|
|
@ -45,6 +45,11 @@ const config: (t: ContextApi['t']) => MenuEntry[] = (t) => [
|
|||
icon: 'TicketIcon',
|
||||
href: '/nft',
|
||||
},
|
||||
{
|
||||
label: t('Board'),
|
||||
icon: 'TicketIcon',
|
||||
href: '/board',
|
||||
},
|
||||
// {
|
||||
// label: t('Prediction (BETA)'),
|
||||
// icon: 'PredictionsIcon',
|
||||
|
|
|
|||
|
|
@ -1,464 +1,387 @@
|
|||
[
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_candy",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_xCandy",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "_turnOnCondition",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"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": "to",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "NodeReward",
|
||||
"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": true,
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "Withdraw",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "from",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": false,
|
||||
"internalType": "uint256",
|
||||
"name": "amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "WithdrawNodeReward",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "Candy",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "contract IHRC20",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "XCandy",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "contract IHRC20",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "from",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "rewardNum",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "addNodeReward",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "addWhitelisted",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "canGetRewardMap",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_thresholdDivider",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "changeThresholdDivider",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "conditionTurnOn",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_amount",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "enterStake",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "firstStakeThreshold",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_findAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "getIsNodeMembers",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "isWhitelisted",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "leaveStake",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "leaveStakePrecheck",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "nodeMembers",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "nodeToPeriod",
|
||||
"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": "address",
|
||||
"name": "account",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "removeWhitelisted",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"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"
|
||||
}
|
||||
]
|
||||
[
|
||||
{
|
||||
"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": "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"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_amount",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "_userAddress",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "deposit",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "emergencyWithdrawHCC",
|
||||
"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"
|
||||
}
|
||||
]
|
||||
|
|
@ -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 { BoardConfig } from './types'
|
||||
|
||||
const BoardList: BoardConfig[] = [
|
||||
const bordsList: BoardConfig[] = [
|
||||
{
|
||||
pid: 1,
|
||||
name: 'Nodes',
|
||||
name: 'Board',
|
||||
img: 'nodes',
|
||||
stringId: 100004,
|
||||
tokenSymbol: tokens.hcc.symbol,
|
||||
tokenAddresses: tokens.hcc.address,
|
||||
tokenDecimals: 18,
|
||||
contractAddress: addresses.boardChef,
|
||||
abi: boardChef,
|
||||
},
|
||||
]
|
||||
|
||||
export default BoardList
|
||||
export default bordsList
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@ export default {
|
|||
56: '0x6ab8463a4185b80905e05a9ff80a2d6b714b9e95',
|
||||
},
|
||||
boardChef: {
|
||||
97: '0x4BC67bBC22a245035fDd1F00DCa7d4F2E1e8f636',
|
||||
97: '0x0dF74009bF2b85b2B19FC7aF67DD5AAF2cde4Ce0',
|
||||
56: '0xD34871F12ace1BB8034E18009104b9dA60B84250', // NEED CHANGE 节点董事会合约
|
||||
},
|
||||
referralChef: {
|
||||
97: '0x3Dcf2586519a25719658Afb2cDB4CEf0DD647Ea3',
|
||||
56: '0x88F46EF2Ee08494D84942DCA3bd24cDEf7C88Ae2', // NEED CHANGE 邀请合约
|
||||
97: '0xE79D28722220fcC13833476E327DEA3a663f64DB',
|
||||
56: '0x88F46EF2Ee08494D84942DCA3bd24cDEf7C88Ae2', // NEED CHANGE 邀请或则军团长
|
||||
},
|
||||
lotteryV2: {
|
||||
97: '0x5790c3534F30437641541a0FA04C992799602998',
|
||||
|
|
|
|||
|
|
@ -91,3 +91,4 @@ export const BLOCKED_ADDRESSES: string[] = [
|
|||
export { default as farmsConfig } from './farms'
|
||||
export { default as poolsConfig } from './pools'
|
||||
export { default as ifosConfig } from './ifo'
|
||||
export { default as boardConfig } from './boards'
|
||||
|
|
|
|||
|
|
@ -60,11 +60,20 @@ export const USDC = new Token(
|
|||
)
|
||||
|
||||
const tokens = {
|
||||
usdt: {
|
||||
symbol: 'USDT',
|
||||
address: {
|
||||
56: '0x55d398326f99059fF775485246999027B3197955',
|
||||
97: '0xaC893B498E2005Af4cb8b03D710F187EC23a8f5f',
|
||||
},
|
||||
decimals: 18,
|
||||
projectLink: 'https://tether.to/',
|
||||
},
|
||||
hcc: {
|
||||
symbol: 'HCC',
|
||||
address: {
|
||||
56: '0x20de22029ab63cf9A7Cf5fEB2b737Ca1eE4c82A6',
|
||||
97: '0x71D239B4564DC00d994AbF6E6cD7582dd873649E',
|
||||
97: '0xbdd6c43fb8e97a73e464fca5ab6f3d2f402be20c',
|
||||
},
|
||||
decimals: 18,
|
||||
projectLink: 'https://tranchess.com/',
|
||||
|
|
@ -902,15 +911,7 @@ const tokens = {
|
|||
decimals: 18,
|
||||
projectLink: 'https://chain.link/',
|
||||
},
|
||||
usdt: {
|
||||
symbol: 'USDT',
|
||||
address: {
|
||||
56: '0x55d398326f99059fF775485246999027B3197955',
|
||||
97: '0xE02dF9e3e622DeBdD69fb838bB799E3F168902c5',
|
||||
},
|
||||
decimals: 18,
|
||||
projectLink: 'https://tether.to/',
|
||||
},
|
||||
|
||||
btcb: {
|
||||
symbol: 'BTCB',
|
||||
address: {
|
||||
|
|
|
|||
|
|
@ -185,4 +185,6 @@ export interface BoardConfig {
|
|||
tokenSymbol: string
|
||||
tokenAddresses: Address
|
||||
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_ADD_LIQUIDITY_URL = `${BASE_URL}/add`
|
||||
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_TICKET_PRICE = 1
|
||||
export const DEFAULT_TOKEN_DECIMAL = BIG_TEN.pow(18)
|
||||
|
|
|
|||
|
|
@ -100,9 +100,9 @@ export const useMasterchef = () => {
|
|||
const { library } = useActiveWeb3React()
|
||||
return useMemo(() => getMasterchefContract(library.getSigner()), [library])
|
||||
}
|
||||
export const useBoardchef = () => {
|
||||
export const useBoardchef = (id: number) => {
|
||||
const { library } = useActiveWeb3React()
|
||||
return useMemo(() => getBoardchefContract(library.getSigner()), [library])
|
||||
return useMemo(() => getBoardchefContract(id, library.getSigner()), [library])
|
||||
}
|
||||
export const useReferralchef = () => {
|
||||
const { library } = useActiveWeb3React()
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ const fetchBoards = async () => {
|
|||
const data = await Promise.all(
|
||||
boardsConfig.map(async (boardConfig) => {
|
||||
const tokenAddress = getAddress(boardConfig.tokenAddresses)
|
||||
const BoardChefAddress = getBoardAddress()
|
||||
const BoardChefAddress = getAddress(boardConfig.contractAddress)
|
||||
const calls = [
|
||||
// 查节点的代币数量
|
||||
{
|
||||
|
|
@ -26,18 +26,27 @@ const fetchBoards = async () => {
|
|||
// eslint-disable-next-line prefer-const
|
||||
let [tokenBalance, tokenDecimals] = await multicall(erc20, calls)
|
||||
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,
|
||||
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()
|
||||
return {
|
||||
...boardConfig,
|
||||
tokenBalance: tokenBalance.toJSON(),
|
||||
minStakeAmount,
|
||||
lockTime,
|
||||
}
|
||||
}),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -4,13 +4,11 @@ import boardABI from 'config/abi/board.json'
|
|||
import multicall from 'utils/multicall'
|
||||
import boardsConfig from 'config/constants/boards'
|
||||
import { getAddress, getBoardAddress } from 'utils/addressHelpers'
|
||||
import contracts from 'config/constants/contracts'
|
||||
import tokens from 'config/constants/tokens'
|
||||
|
||||
export const fetchBoardUserAllowances = async (account: string) => {
|
||||
const calls = boardsConfig.map((board) => {
|
||||
const tokenAddresses = getAddress(board.tokenAddresses)
|
||||
const boardChefAdress = getBoardAddress()
|
||||
const boardChefAdress = getAddress(board.contractAddress)
|
||||
return { address: tokenAddresses, name: 'allowance', params: [account, boardChefAdress] }
|
||||
})
|
||||
|
||||
|
|
@ -38,54 +36,30 @@ export const fetchBoardUserTokenBalances = async (account: string) => {
|
|||
return parsedTokenBalances
|
||||
}
|
||||
|
||||
export const fetchBoardUserStakedBalances = async (account: string) => {
|
||||
const calls = boardsConfig.map((board) => {
|
||||
const boardChefAdress = getBoardAddress()
|
||||
return {
|
||||
address: boardChefAdress,
|
||||
name: 'userInfo',
|
||||
params: [account],
|
||||
}
|
||||
})
|
||||
export const fetchBoardUserInfo = async (account: string) => {
|
||||
const data = await Promise.all(
|
||||
boardsConfig.map(async (board) => {
|
||||
const boardChefAdress = getAddress(board.contractAddress)
|
||||
const calls = [
|
||||
{
|
||||
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)
|
||||
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
|
||||
return data
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,13 +3,7 @@ import { createSlice } from '@reduxjs/toolkit'
|
|||
import BigNumber from 'bignumber.js'
|
||||
import boardsConfig from 'config/constants/boards'
|
||||
import fetchBoards from './fetchBoards'
|
||||
import {
|
||||
fetchBoardUserAllowances,
|
||||
fetchBoardUserTokenBalances,
|
||||
fetchBoardUserStakedBalances,
|
||||
fetchBoardUserUnlockTime,
|
||||
fetchUserXCandyBalance,
|
||||
} from './fetchBoardsUser'
|
||||
import { fetchBoardUserAllowances, fetchBoardUserTokenBalances, fetchBoardUserInfo } from './fetchBoardsUser'
|
||||
import { BoardsState, Boards } from '../types'
|
||||
|
||||
const initialState: BoardsState = { data: [...boardsConfig] }
|
||||
|
|
@ -46,17 +40,15 @@ export const fetchBoardsPublicDataAsync = () => async (dispatch) => {
|
|||
export const fetchBoardUserDataAsync = (account) => async (dispatch) => {
|
||||
const userBoardAllowances = await fetchBoardUserAllowances(account)
|
||||
const userBoardTokenBalances = await fetchBoardUserTokenBalances(account)
|
||||
const userStakedBalances = await fetchBoardUserStakedBalances(account)
|
||||
const userUnlockTimes = await fetchBoardUserUnlockTime(account)
|
||||
const userXCandyBalances = await fetchUserXCandyBalance(account)
|
||||
const userInfo = await fetchBoardUserInfo(account)
|
||||
const arrayOfUserDataObjects = userBoardAllowances.map((nodeAllowance, index) => {
|
||||
return {
|
||||
index,
|
||||
allowance: userBoardAllowances[index],
|
||||
tokenBalance: userBoardTokenBalances[index],
|
||||
stakedBalance: userStakedBalances[index].stakedBalance,
|
||||
xCandyBalance: userXCandyBalances[index],
|
||||
unlockTime: userUnlockTimes[index] + userStakedBalances[index].stakedTime,
|
||||
stakedBalance: userInfo[index].stakedBalance,
|
||||
unlockTime: userInfo[index].unLockTime,
|
||||
estimatedProfit: userInfo[index].estimatedProfit,
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ export const useBoardUser = (pid) => {
|
|||
tokenBalance: board.userData ? new BigNumber(board.userData.tokenBalance) : new BigNumber(0),
|
||||
stakedBalance: board.userData ? new BigNumber(board.userData.stakedBalance) : new BigNumber(0),
|
||||
unlockTime: board.userData ? board.userData.unlockTime : 0,
|
||||
xCandyBalance: board.userData ? board.userData.xCandyBalance : 0,
|
||||
estimatedProfit: board.userData ? board.userData.estimatedProfit : 0,
|
||||
}
|
||||
}
|
||||
// cake
|
||||
|
|
|
|||
|
|
@ -516,7 +516,7 @@ export interface Boards extends BoardConfig {
|
|||
tokenBalance: BigNumber
|
||||
stakedBalance: BigNumber
|
||||
unlockTime: number
|
||||
xCandyBalance: number
|
||||
estimatedProfit: number
|
||||
}
|
||||
}
|
||||
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 './farms'
|
||||
export * from './pools'
|
||||
export * from './boards'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ethers } from 'ethers'
|
||||
import { simpleRpcProvider } from 'utils/providers'
|
||||
import { poolsConfig } from 'config/constants'
|
||||
import { poolsConfig, boardConfig } from 'config/constants'
|
||||
import { PoolCategory } from 'config/constants/types'
|
||||
|
||||
// Addresses
|
||||
|
|
@ -115,8 +115,9 @@ export const getLotteryV2Contract = (signer?: ethers.Signer | ethers.providers.P
|
|||
export const getMasterchefContract = (signer?: ethers.Signer | ethers.providers.Provider) => {
|
||||
return getContract(masterChef, getMasterChefAddress(), signer)
|
||||
}
|
||||
export const getBoardchefContract = (signer?: ethers.Signer | ethers.providers.Provider) => {
|
||||
return getContract(boardChef, getBoardAddress(), signer)
|
||||
export const getBoardchefContract = (id: number, signer?: ethers.Signer | ethers.providers.Provider) => {
|
||||
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) => {
|
||||
return getContract(referralChef, getReferralAddress(), signer)
|
||||
|
|
|
|||
|
|
@ -88,10 +88,9 @@ const NodeCard: React.FC<NodeCardProps> = ({ board, account }) => {
|
|||
|
||||
return (
|
||||
<FCard>
|
||||
{/* {true && <StyledCardAccent />} */}
|
||||
<CardHeading name={t(board.name)} img={board.img} tokenSymbol={board.tokenSymbol} />
|
||||
<CardActionsContainer node={board} account={account} />
|
||||
<Divider />
|
||||
<CardActionsContainer board={board} account={account} />
|
||||
{/* <Divider />
|
||||
<ExpandableSectionButton
|
||||
onClick={() => setShowExpandableSection(!showExpandableSection)}
|
||||
expanded={showExpandableSection}
|
||||
|
|
@ -101,7 +100,7 @@ const NodeCard: React.FC<NodeCardProps> = ({ board, account }) => {
|
|||
bscScanAddress={`${process.env.REACT_APP_NETWORK_URL}/address/${getBoardAddress()}`}
|
||||
totalValueFormated={board.tokenBalance || '-'}
|
||||
/>
|
||||
</ExpandingWrapper>
|
||||
</ExpandingWrapper> */}
|
||||
</FCard>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,20 +19,20 @@ const Action = styled.div`
|
|||
`
|
||||
|
||||
interface NodeCardActionsProps {
|
||||
node: Boards
|
||||
board: Boards
|
||||
provider?: ProviderType
|
||||
account?: string
|
||||
}
|
||||
|
||||
const CardActions: React.FC<NodeCardActionsProps> = ({ node, account }) => {
|
||||
const CardActions: React.FC<NodeCardActionsProps> = ({ board, account }) => {
|
||||
const { t } = useTranslation()
|
||||
const [requestedApproval, setRequestedApproval] = useState(false)
|
||||
const pid = node.pid
|
||||
const { allowance, tokenBalance, stakedBalance, xCandyBalance } = useBoardUser(pid)
|
||||
const pid = board.pid
|
||||
const { allowance, tokenBalance, stakedBalance, estimatedProfit } = useBoardUser(pid)
|
||||
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 () => {
|
||||
try {
|
||||
|
|
@ -50,15 +50,12 @@ const CardActions: React.FC<NodeCardActionsProps> = ({ node, account }) => {
|
|||
<StakeAction stakedBalance={stakedBalance} tokenBalance={tokenBalance} pid={pid} />
|
||||
<Flex flexDirection="column" alignItems="flex-start" mt="10">
|
||||
<Flex>
|
||||
<Text bold textTransform="uppercase" color="secondary" fontSize="12px" pr="3px">
|
||||
{TOKEN_SYMBOL}
|
||||
</Text>
|
||||
<Text color="textSubtle" fontSize="12px">
|
||||
{t('Amount')}
|
||||
{t('TotalProfit')}
|
||||
</Text>
|
||||
</Flex>
|
||||
<Text bold textTransform="uppercase" fontSize="20px">
|
||||
{getBalanceNumber(new BigNumber(xCandyBalance))}
|
||||
{getBalanceNumber(new BigNumber(estimatedProfit))}
|
||||
</Text>
|
||||
</Flex>
|
||||
</>
|
||||
|
|
@ -73,7 +70,7 @@ const CardActions: React.FC<NodeCardActionsProps> = ({ node, account }) => {
|
|||
<Action>
|
||||
<Flex>
|
||||
<Text bold textTransform="uppercase" color="secondary" fontSize="12px" pr="3px">
|
||||
{node.tokenSymbol}
|
||||
{board.tokenSymbol}
|
||||
</Text>
|
||||
<Text bold textTransform="uppercase" color="textSubtle" fontSize="12px">
|
||||
{t('Staked')}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ const CardHeading: React.FC<ExpandableSectionProps> = ({ name, img, tokenSymbol
|
|||
<Image src={`/images/nodes/${img}.png`} width={64} height={64} />
|
||||
<Flex>
|
||||
<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>
|
||||
</Wrapper>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const DetailsSection: React.FC<ExpandableSectionProps> = ({ bscScanAddress, remo
|
|||
{/* )} */}
|
||||
<Flex justifyContent="flex-start">
|
||||
<Link external href={bscScanAddress} bold={false}>
|
||||
{t( 'View on BscScan')}
|
||||
{t('View on BscScan')}
|
||||
</Link>
|
||||
</Flex>
|
||||
</Wrapper>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
import React, { useMemo } from 'react'
|
||||
// import dayjs from 'dayjs'
|
||||
import dayjs from 'dayjs'
|
||||
import styled from 'styled-components'
|
||||
import BigNumber from 'bignumber.js'
|
||||
import { Button, Flex, Heading, IconButton, AddIcon, MinusIcon, useModal } from '@pancakeswap/uikit'
|
||||
|
||||
// import { NODE_UNLOCK_TIME } from 'config/index'
|
||||
import { getBalanceNumber } from 'utils/formatBalance'
|
||||
import { useBoardsFromPid } from 'state/hooks'
|
||||
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} />,
|
||||
)
|
||||
const handleUnstake = () => {
|
||||
// const unstakeDay = new Date().getDay()
|
||||
// const unlockTime = userData.unlockTime * 1000
|
||||
// // 只能周五解锁 NEED CHANGE
|
||||
// if (unstakeDay !== NODE_UNLOCK_TIME || unlockTime > new Date().getTime()) {
|
||||
// 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
|
||||
// }
|
||||
const unlockTime = userData.unlockTime * 1000
|
||||
if (unlockTime > new Date().getTime()) {
|
||||
toastWarning(t('Unlock time %unlockTime%', { unlockTime: dayjs(unlockTime).format('YYYY-MM-DD HH:mm') }))
|
||||
// return
|
||||
}
|
||||
// onUnstake()
|
||||
}
|
||||
const renderStakingButtons = () => {
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import { useCallback } from 'react'
|
|||
import { ethers, Contract } from 'ethers'
|
||||
import { useBoardchef } from 'hooks/useContract'
|
||||
|
||||
const useApproveBoard = (lpContract: Contract) => {
|
||||
const boardChefContract = useBoardchef()
|
||||
const useApproveBoard = (lpContract: Contract, pid) => {
|
||||
const boardChefContract = useBoardchef(pid)
|
||||
const handleApprove = useCallback(async () => {
|
||||
try {
|
||||
const tx = await lpContract.approve(boardChefContract.address, ethers.constants.MaxUint256)
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { useCallback } from 'react'
|
||||
import { harvestFarm } from 'utils/calls'
|
||||
import { harvestBoard } from 'utils/calls'
|
||||
import { useBoardchef } from 'hooks/useContract'
|
||||
|
||||
const useHarvestBoard = (boardPid: number) => {
|
||||
const boardChefContract = useBoardchef()
|
||||
const boardChefContract = useBoardchef(boardPid)
|
||||
|
||||
const handleHarvest = useCallback(async () => {
|
||||
await harvestFarm(boardChefContract, boardPid)
|
||||
await harvestBoard(boardChefContract, boardPid)
|
||||
}, [boardPid, boardChefContract])
|
||||
|
||||
return { onReward: handleHarvest }
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { useCallback } from 'react'
|
||||
import { stakeFarm } from 'utils/calls'
|
||||
import { stakeBoard } from 'utils/calls'
|
||||
import { useBoardchef } from 'hooks/useContract'
|
||||
|
||||
const useStakeBoard = (pid: number) => {
|
||||
const boardChefContract = useBoardchef()
|
||||
const boardChefContract = useBoardchef(pid)
|
||||
|
||||
const handleStake = useCallback(
|
||||
async (amount: string) => {
|
||||
const txHash = await stakeFarm(boardChefContract, pid, amount)
|
||||
const txHash = await stakeBoard(boardChefContract, pid, amount)
|
||||
console.info(txHash)
|
||||
},
|
||||
[boardChefContract, pid],
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { useCallback } from 'react'
|
||||
import { unstakeFarm } from 'utils/calls'
|
||||
import { unstakeBoard } from 'utils/calls'
|
||||
import { useBoardchef } from 'hooks/useContract'
|
||||
|
||||
const useUnstakeBoard = (pid: number) => {
|
||||
const boardChefContract = useBoardchef()
|
||||
const boardChefContract = useBoardchef(pid)
|
||||
|
||||
const handleUnstake = useCallback(
|
||||
async (amount: string) => {
|
||||
await unstakeFarm(boardChefContract, pid, amount)
|
||||
await unstakeBoard(boardChefContract, pid, amount)
|
||||
},
|
||||
[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"
|
||||
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:
|
||||
version "0.0.4"
|
||||
resolved "https://registry.yarnpkg.com/debug-fabulous/-/debug-fabulous-0.0.4.tgz#fa071c5d87484685424807421ca4b16b0b1a0763"
|
||||
|
|
|
|||
Loading…
Reference in New Issue