feat: 军团长
This commit is contained in:
parent
0449882249
commit
a302304845
Binary file not shown.
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 66 KiB |
|
|
@ -12,7 +12,7 @@
|
||||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo.png" />
|
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo.png" />
|
||||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||||
<!-- Meta -->
|
<!-- Meta -->
|
||||||
<title>PancakeSwap</title>
|
<title>HighCity Swap</title>
|
||||||
<meta
|
<meta
|
||||||
name="description"
|
name="description"
|
||||||
content="Cheaper and faster than Uniswap? Discover PancakeSwap, the leading DEX on Binance Smart Chain (BSC) with the best farms in DeFi and a lottery for CAKE."
|
content="Cheaper and faster than Uniswap? Discover PancakeSwap, the leading DEX on Binance Smart Chain (BSC) with the best farms in DeFi and a lottery for CAKE."
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta name="twitter:title" content="🥞 PancakeSwap - A next evolution DeFi exchange on Binance Smart Chain (BSC)" />
|
<meta name="twitter:title" content="🥞 PancakeSwap - A next evolution DeFi exchange on Binance Smart Chain (BSC)" />
|
||||||
<!-- GTAG -->
|
<!-- GTAG -->
|
||||||
<script>
|
<!-- <script>
|
||||||
;(function (w, d, s, l, i) {
|
;(function (w, d, s, l, i) {
|
||||||
w[l] = w[l] || []
|
w[l] = w[l] || []
|
||||||
w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' })
|
w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' })
|
||||||
|
|
@ -38,18 +38,18 @@
|
||||||
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl
|
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl
|
||||||
f.parentNode.insertBefore(j, f)
|
f.parentNode.insertBefore(j, f)
|
||||||
})(window, document, 'script', 'dataLayer', '%REACT_APP_GTAG%')
|
})(window, document, 'script', 'dataLayer', '%REACT_APP_GTAG%')
|
||||||
</script>
|
</script> -->
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!-- GTAG (noscript) -->
|
<!-- GTAG (noscript) -->
|
||||||
<noscript>
|
<!-- <noscript>
|
||||||
<iframe
|
<iframe
|
||||||
src="https://www.googletagmanager.com/ns.html?id=%REACT_APP_GTAG%"
|
src="https://www.googletagmanager.com/ns.html?id=%REACT_APP_GTAG%"
|
||||||
height="0"
|
height="0"
|
||||||
width="0"
|
width="0"
|
||||||
style="display: none; visibility: hidden"
|
style="display: none; visibility: hidden"
|
||||||
></iframe>
|
></iframe>
|
||||||
</noscript>
|
</noscript> -->
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
<div id="portal-root"></div>
|
<div id="portal-root"></div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"short_name": "PancakeSwap",
|
"short_name": "HighCitySwap",
|
||||||
"name": "PancakeSwap",
|
"name": "HighCitySwap",
|
||||||
"description": "Farm CAKE with Pancake LP Tokens",
|
"description": "Farm CAKE with Pancake LP Tokens",
|
||||||
"homepage_url": "https://pancakeswap.finance",
|
"homepage_url": "https://pancakeswap.finance",
|
||||||
"start_url": ".",
|
"start_url": ".",
|
||||||
|
|
|
||||||
|
|
@ -1,322 +1,403 @@
|
||||||
[
|
[
|
||||||
|
{
|
||||||
|
"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,
|
"anonymous": false,
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" },
|
||||||
"indexed": true,
|
{ "indexed": true, "internalType": "address", "name": "approved", "type": "address" },
|
||||||
"internalType": "address",
|
{ "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }
|
||||||
"name": "from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": true,
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "to",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "amount",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
"name": "InviteReward",
|
"name": "Approval",
|
||||||
"type": "event"
|
"type": "event"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"anonymous": false,
|
"anonymous": false,
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" },
|
||||||
"indexed": true,
|
{ "indexed": true, "internalType": "address", "name": "operator", "type": "address" },
|
||||||
"internalType": "address",
|
{ "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" }
|
||||||
"name": "previousOwner",
|
],
|
||||||
"type": "address"
|
"name": "ApprovalForAll",
|
||||||
},
|
"type": "event"
|
||||||
{
|
},
|
||||||
"indexed": true,
|
{
|
||||||
"internalType": "address",
|
"anonymous": false,
|
||||||
"name": "newOwner",
|
"inputs": [
|
||||||
"type": "address"
|
{ "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",
|
"name": "OwnershipTransferred",
|
||||||
"type": "event"
|
"type": "event"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [{ "indexed": false, "internalType": "bool", "name": "pause", "type": "bool" }],
|
||||||
|
"name": "PauseEvent",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"anonymous": false,
|
"anonymous": false,
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{ "indexed": true, "internalType": "address", "name": "from", "type": "address" },
|
||||||
"indexed": true,
|
{ "indexed": true, "internalType": "address", "name": "to", "type": "address" },
|
||||||
"internalType": "address",
|
{ "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }
|
||||||
"name": "from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"indexed": false,
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "amount",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
"name": "WithdrawInviteReward",
|
"name": "Transfer",
|
||||||
"type": "event"
|
"type": "event"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [],
|
"inputs": [],
|
||||||
"name": "_candy",
|
"name": "START_AT",
|
||||||
"outputs": [
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
{
|
"stateMutability": "view",
|
||||||
"internalType": "contract ICandy",
|
"type": "function"
|
||||||
"name": "",
|
},
|
||||||
"type": "address"
|
{
|
||||||
}
|
"inputs": [],
|
||||||
],
|
"name": "_lastTokenID",
|
||||||
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
"stateMutability": "view",
|
"stateMutability": "view",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{ "internalType": "address", "name": "to", "type": "address" },
|
||||||
"internalType": "address",
|
{ "internalType": "uint256", "name": "_timestamp", "type": "uint256" },
|
||||||
"name": "child",
|
{ "internalType": "uint256", "name": "code", "type": "uint256" },
|
||||||
"type": "address"
|
{ "internalType": "bytes", "name": "_signature", "type": "bytes" }
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "invite",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
"name": "addInviteAddress",
|
"name": "adminMint",
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "bool",
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "nonpayable",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "from",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "invite",
|
|
||||||
"type": "address"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "rewardNum",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "addInviteReward",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "bool",
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "nonpayable",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "account",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "addWhitelisted",
|
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{ "internalType": "address", "name": "to", "type": "address" },
|
||||||
"internalType": "address",
|
{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }
|
||||||
"name": "",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "canGetRewardMap",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "",
|
|
||||||
"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",
|
"stateMutability": "view",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{ "internalType": "address", "name": "owner", "type": "address" },
|
||||||
"internalType": "address",
|
{ "internalType": "address", "name": "operator", "type": "address" }
|
||||||
"name": "findAddress",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "getInviteAddress",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "",
|
|
||||||
"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",
|
"stateMutability": "view",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [],
|
||||||
{
|
"name": "otherPaymentAddress",
|
||||||
"internalType": "address",
|
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
||||||
"name": "",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "inviteNumMap",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "int128",
|
|
||||||
"name": "",
|
|
||||||
"type": "int128"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
"stateMutability": "view",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [],
|
||||||
{
|
"name": "otherPaymentPirce",
|
||||||
"internalType": "address",
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
"name": "",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "inviteTotalRewardMap",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "uint256",
|
|
||||||
"name": "",
|
|
||||||
"type": "uint256"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "account",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "isWhitelisted",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "bool",
|
|
||||||
"name": "",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "leaderMap",
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"stateMutability": "view",
|
"stateMutability": "view",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [],
|
"inputs": [],
|
||||||
"name": "owner",
|
"name": "owner",
|
||||||
"outputs": [
|
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
||||||
{
|
"stateMutability": "view",
|
||||||
"internalType": "address",
|
"type": "function"
|
||||||
"name": "",
|
},
|
||||||
"type": "address"
|
{
|
||||||
}
|
"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",
|
"stateMutability": "view",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{ "internalType": "address", "name": "owner", "type": "address" },
|
||||||
"internalType": "address",
|
{ "internalType": "uint256", "name": "index", "type": "uint256" }
|
||||||
"name": "account",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
"name": "removeWhitelisted",
|
"name": "tokenOfOwnerByIndex",
|
||||||
"outputs": [],
|
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }],
|
||||||
|
"name": "tokenURI",
|
||||||
|
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
||||||
|
"stateMutability": "view",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [],
|
"inputs": [],
|
||||||
"name": "renounceOwnership",
|
"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": [],
|
"outputs": [],
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [
|
"inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }],
|
||||||
{
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "candy",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "setCandyTokenAddress",
|
|
||||||
"outputs": [],
|
|
||||||
"stateMutability": "nonpayable",
|
|
||||||
"type": "function"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"internalType": "address",
|
|
||||||
"name": "newOwner",
|
|
||||||
"type": "address"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "transferOwnership",
|
"name": "transferOwnership",
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"inputs": [],
|
"inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }],
|
||||||
"name": "withDrawReward",
|
"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": [],
|
"outputs": [],
|
||||||
"stateMutability": "nonpayable",
|
"stateMutability": "nonpayable",
|
||||||
"type": "function"
|
"type": "function"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,99 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "contract IERC20", "name": "_HCC", "type": "address" },
|
||||||
|
{ "internalType": "address", "name": "_executorAddress", "type": "address" }
|
||||||
|
],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "constructor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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": "sender", "type": "address" },
|
||||||
|
{ "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" },
|
||||||
|
{ "indexed": false, "internalType": "bytes", "name": "_signature", "type": "bytes" }
|
||||||
|
],
|
||||||
|
"name": "WithDrawEvnet",
|
||||||
|
"type": "event"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "HCC",
|
||||||
|
"outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "executorAddress",
|
||||||
|
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [],
|
||||||
|
"name": "owner",
|
||||||
|
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
||||||
|
"stateMutability": "view",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{ "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" },
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "address", "name": "_executorAddress", "type": "address" }],
|
||||||
|
"name": "setExecutor",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "address", "name": "to", "type": "address" },
|
||||||
|
{ "internalType": "uint256", "name": "amount", "type": "uint256" },
|
||||||
|
{ "internalType": "uint256", "name": "_expiredTime", "type": "uint256" },
|
||||||
|
{ "internalType": "bytes", "name": "_signature", "type": "bytes" }
|
||||||
|
],
|
||||||
|
"name": "signatureWallet",
|
||||||
|
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
||||||
|
"stateMutability": "pure",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }],
|
||||||
|
"name": "transferOwnership",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "address", "name": "to", "type": "address" },
|
||||||
|
{ "internalType": "uint256", "name": "_amount", "type": "uint256" },
|
||||||
|
{ "internalType": "uint256", "name": "_expiredTime", "type": "uint256" },
|
||||||
|
{ "internalType": "bytes", "name": "_signature", "type": "bytes" }
|
||||||
|
],
|
||||||
|
"name": "withDrawReward",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"inputs": [
|
||||||
|
{ "internalType": "address", "name": "to", "type": "address" },
|
||||||
|
{ "internalType": "uint256", "name": "value", "type": "uint256" }
|
||||||
|
],
|
||||||
|
"name": "withDrawToken",
|
||||||
|
"outputs": [],
|
||||||
|
"stateMutability": "nonpayable",
|
||||||
|
"type": "function"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -8,17 +8,21 @@ export default {
|
||||||
56: '0x6ab8463a4185b80905e05a9ff80a2d6b714b9e95',
|
56: '0x6ab8463a4185b80905e05a9ff80a2d6b714b9e95',
|
||||||
},
|
},
|
||||||
boardChef: {
|
boardChef: {
|
||||||
97: '0x88fd1e29160f6d498038254f1bd0f7729f812fa1',
|
97: '0xfe73bcc71c1e8f41f29c07ee921777ff8232eba7',
|
||||||
56: '0xD34871F12ace1BB8034E18009104b9dA60B84250', // NEED CHANGE 节点董事会合约
|
56: '0xD34871F12ace1BB8034E18009104b9dA60B84250', // NEED CHANGE 节点董事会合约
|
||||||
},
|
},
|
||||||
holderChef: {
|
holderChef: {
|
||||||
97: '0x0373aa1d09d58bb789db694d6b944b052ff26d91',
|
97: '0xc49ef97410f495164604be0de2baae908913c4cc',
|
||||||
56: '0xD34871F12ace1BB8034E18009104b9dA60B84250', // NEED CHANGE 持币人
|
56: '0xD34871F12ace1BB8034E18009104b9dA60B84250', // NEED CHANGE 持币人
|
||||||
},
|
},
|
||||||
referralChef: {
|
referralChef: {
|
||||||
97: '0xE79D28722220fcC13833476E327DEA3a663f64DB',
|
97: '0x2f2aec0ee0da9f81e28e78a072cfbea6f35b1e06',
|
||||||
56: '0x88F46EF2Ee08494D84942DCA3bd24cDEf7C88Ae2', // NEED CHANGE 邀请或则军团长
|
56: '0x88F46EF2Ee08494D84942DCA3bd24cDEf7C88Ae2', // NEED CHANGE 邀请或则军团长
|
||||||
},
|
},
|
||||||
|
referralRewardChef: {
|
||||||
|
97: '0xe031cf7053ea3b7605bb289efe2307356f6ace6d',
|
||||||
|
56: '0x88F46EF2Ee08494D84942DCA3bd24cDEf7C88Ae2', // NEED CHANGE 邀请或则军团长收益
|
||||||
|
},
|
||||||
lotteryV2: {
|
lotteryV2: {
|
||||||
97: '0x5790c3534F30437641541a0FA04C992799602998',
|
97: '0x5790c3534F30437641541a0FA04C992799602998',
|
||||||
56: '0x5aF6D33DE2ccEC94efb1bDF8f92Bd58085432d2c',
|
56: '0x5aF6D33DE2ccEC94efb1bDF8f92Bd58085432d2c',
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { ContextApi } from 'contexts/Localization/types'
|
||||||
import { PageMeta } from './types'
|
import { PageMeta } from './types'
|
||||||
|
|
||||||
export const DEFAULT_META: PageMeta = {
|
export const DEFAULT_META: PageMeta = {
|
||||||
title: 'PancakeSwap',
|
title: 'HighCitySwap',
|
||||||
description:
|
description:
|
||||||
'The most popular AMM on BSC by user count! Earn CAKE through yield farming or win it in the Lottery, then stake it in Syrup Pools to earn more tokens! Initial Farm Offerings (new token launch model pioneered by PancakeSwap), NFTs, and more, on a platform you can trust.',
|
'The most popular AMM on BSC by user count! Earn CAKE through yield farming or win it in the Lottery, then stake it in Syrup Pools to earn more tokens! Initial Farm Offerings (new token launch model pioneered by PancakeSwap), NFTs, and more, on a platform you can trust.',
|
||||||
image: 'https://pancakeswap.finance/images/hero.png',
|
image: 'https://pancakeswap.finance/images/hero.png',
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import {
|
||||||
getBunnySpecialPredictionContract,
|
getBunnySpecialPredictionContract,
|
||||||
getReferralchefContract,
|
getReferralchefContract,
|
||||||
getBoardchefContract,
|
getBoardchefContract,
|
||||||
|
getReferralRewardchefContract,
|
||||||
} from 'utils/contractHelpers'
|
} from 'utils/contractHelpers'
|
||||||
|
|
||||||
// Imports below migrated from Exchange useContract.ts
|
// Imports below migrated from Exchange useContract.ts
|
||||||
|
|
@ -108,6 +109,10 @@ export const useReferralchef = () => {
|
||||||
const { library } = useActiveWeb3React()
|
const { library } = useActiveWeb3React()
|
||||||
return useMemo(() => getReferralchefContract(library.getSigner()), [library])
|
return useMemo(() => getReferralchefContract(library.getSigner()), [library])
|
||||||
}
|
}
|
||||||
|
export const useReferralRewardchef = () => {
|
||||||
|
const { library } = useActiveWeb3React()
|
||||||
|
return useMemo(() => getReferralRewardchefContract(library.getSigner()), [library])
|
||||||
|
}
|
||||||
export const useSousChef = (id) => {
|
export const useSousChef = (id) => {
|
||||||
const { library } = useActiveWeb3React()
|
const { library } = useActiveWeb3React()
|
||||||
return useMemo(() => getSouschefContract(id, library.getSigner()), [id, library])
|
return useMemo(() => getSouschefContract(id, library.getSigner()), [id, library])
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ const useGetDocumentTitlePrice = () => {
|
||||||
const cakePriceBusd = useCakeBusdPrice()
|
const cakePriceBusd = useCakeBusdPrice()
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const cakePriceBusdString = cakePriceBusd ? cakePriceBusd.toFixed(2) : ''
|
const cakePriceBusdString = cakePriceBusd ? cakePriceBusd.toFixed(2) : ''
|
||||||
document.title = `Pancake Swap - ${cakePriceBusdString}`
|
document.title = `HighCity Swap - ${cakePriceBusdString}`
|
||||||
}, [cakePriceBusd])
|
}, [cakePriceBusd])
|
||||||
}
|
}
|
||||||
export default useGetDocumentTitlePrice
|
export default useGetDocumentTitlePrice
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,11 @@ export const getReferralInfo = () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const withdrawReward = () => {
|
||||||
|
return request.request({
|
||||||
|
url: '/high_city/app/api/invite/reward/receive',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export default getReferralInfo
|
export default getReferralInfo
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,9 @@ export const getBoardAddress = () => {
|
||||||
export const getReferralAddress = () => {
|
export const getReferralAddress = () => {
|
||||||
return getAddress(addresses.referralChef)
|
return getAddress(addresses.referralChef)
|
||||||
}
|
}
|
||||||
|
export const getReferralRewardAddress = () => {
|
||||||
|
return getAddress(addresses.referralRewardChef)
|
||||||
|
}
|
||||||
export const getWbnbAddress = () => {
|
export const getWbnbAddress = () => {
|
||||||
return getAddress(tokens.wbnb.address)
|
return getAddress(tokens.wbnb.address)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import {
|
||||||
getBunnySpecialPredictionAddress,
|
getBunnySpecialPredictionAddress,
|
||||||
getBoardAddress,
|
getBoardAddress,
|
||||||
getReferralAddress,
|
getReferralAddress,
|
||||||
|
getReferralRewardAddress,
|
||||||
} from 'utils/addressHelpers'
|
} from 'utils/addressHelpers'
|
||||||
|
|
||||||
// ABI
|
// ABI
|
||||||
|
|
@ -44,6 +45,7 @@ import pointCenterIfo from 'config/abi/pointCenterIfo.json'
|
||||||
import lotteryV2Abi from 'config/abi/lotteryV2.json'
|
import lotteryV2Abi from 'config/abi/lotteryV2.json'
|
||||||
import masterChef from 'config/abi/masterchef.json'
|
import masterChef from 'config/abi/masterchef.json'
|
||||||
import referralChef from 'config/abi/referral.json'
|
import referralChef from 'config/abi/referral.json'
|
||||||
|
import referralRewardChef from 'config/abi/referralReward.json'
|
||||||
import boardChef from 'config/abi/board.json'
|
import boardChef from 'config/abi/board.json'
|
||||||
import sousChef from 'config/abi/sousChef.json'
|
import sousChef from 'config/abi/sousChef.json'
|
||||||
import sousChefV2 from 'config/abi/sousChefV2.json'
|
import sousChefV2 from 'config/abi/sousChefV2.json'
|
||||||
|
|
@ -122,6 +124,9 @@ export const getBoardchefContract = (id: number, signer?: ethers.Signer | ethers
|
||||||
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)
|
||||||
}
|
}
|
||||||
|
export const getReferralRewardchefContract = (signer?: ethers.Signer | ethers.providers.Provider) => {
|
||||||
|
return getContract(referralRewardChef, getReferralRewardAddress(), signer)
|
||||||
|
}
|
||||||
export const getClaimRefundContract = (signer?: ethers.Signer | ethers.providers.Provider) => {
|
export const getClaimRefundContract = (signer?: ethers.Signer | ethers.providers.Provider) => {
|
||||||
return getContract(claimRefundAbi, getClaimRefundAddress(), signer)
|
return getContract(claimRefundAbi, getClaimRefundAddress(), signer)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,9 @@ import { BIG_TEN } from './bigNumber'
|
||||||
export const getDecimalAmount = (amount: BigNumber, decimals = 18) => {
|
export const getDecimalAmount = (amount: BigNumber, decimals = 18) => {
|
||||||
return new BigNumber(amount).times(BIG_TEN.pow(decimals))
|
return new BigNumber(amount).times(BIG_TEN.pow(decimals))
|
||||||
}
|
}
|
||||||
|
export const getDecimalAmountNumber = (amount: BigNumber | number, decimals = 18) => {
|
||||||
|
return new BigNumber(amount).times(BIG_TEN.pow(decimals)).toNumber()
|
||||||
|
}
|
||||||
|
|
||||||
export const getBalanceAmount = (amount: BigNumber | number, decimals = 18) => {
|
export const getBalanceAmount = (amount: BigNumber | number, decimals = 18) => {
|
||||||
return new BigNumber(amount).dividedBy(BIG_TEN.pow(decimals))
|
return new BigNumber(amount).dividedBy(BIG_TEN.pow(decimals))
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import { useTranslation } from 'contexts/Localization'
|
||||||
import { Flex, Button, Modal, Image } from '@pancakeswap/uikit'
|
import { Flex, Button, Modal, Image } from '@pancakeswap/uikit'
|
||||||
import TextFlex from './TextFlex'
|
import TextFlex from './TextFlex'
|
||||||
import FlexCom from './FlexCom'
|
import FlexCom from './FlexCom'
|
||||||
|
import { useBuyTransaction } from '../hooks'
|
||||||
|
|
||||||
const ModalDiv = styled(Modal)`
|
const ModalDiv = styled(Modal)`
|
||||||
width: 80%;
|
width: 80%;
|
||||||
|
|
@ -49,8 +50,11 @@ const ImageDiv = styled(Image)`
|
||||||
|
|
||||||
const BuyNftModal: React.FC = () => {
|
const BuyNftModal: React.FC = () => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
const sendBuyTransaction = useBuyTransaction()
|
||||||
// const onDismiss = () => {}
|
// const onDismiss = () => {}
|
||||||
|
const handleBuy = () => {
|
||||||
|
sendBuyTransaction()
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<ModalDiv title={t('Buy commander NFT')}>
|
<ModalDiv title={t('Buy commander NFT')}>
|
||||||
<Flex alignItems="center" flexWrap="wrap" justifyContent="center">
|
<Flex alignItems="center" flexWrap="wrap" justifyContent="center">
|
||||||
|
|
@ -71,7 +75,7 @@ const BuyNftModal: React.FC = () => {
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Flex>
|
<Flex>
|
||||||
<UpBtn>{t('Buy It Now')}</UpBtn>
|
<UpBtn onClick={handleBuy}>{t('Buy It Now')}</UpBtn>
|
||||||
</Flex>
|
</Flex>
|
||||||
</ModalDiv>
|
</ModalDiv>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
import { useState, useCallback } from 'react'
|
||||||
|
import { useReferralchef, useReferralRewardchef } from 'hooks/useContract'
|
||||||
|
import useTokenBalance, { useGetBnbBalance } from 'hooks/useTokenBalance'
|
||||||
|
import { getAddress } from 'utils/addressHelpers'
|
||||||
|
import tokensList from 'config/constants/tokens'
|
||||||
|
import useToast from 'hooks/useToast'
|
||||||
|
import { useTranslation } from 'contexts/Localization'
|
||||||
|
import { getBalanceNumber, getDecimalAmountNumber } from 'utils/formatBalance'
|
||||||
|
import { withdrawReward } from 'services/referral'
|
||||||
|
|
||||||
|
const useCheckTokenBalance = ({ isBnb, isHcc, isUsdt }) => {
|
||||||
|
const { balance: bnbTokenBalance } = useGetBnbBalance()
|
||||||
|
const { balance: usdtTokenBalance } = useTokenBalance(getAddress(tokensList.usdt.address))
|
||||||
|
const { balance: hccTokenBalance } = useTokenBalance(getAddress(tokensList.hcc.address))
|
||||||
|
const { toastWarning } = useToast()
|
||||||
|
const { t } = useTranslation()
|
||||||
|
const onCheck = useCallback(() => {
|
||||||
|
if (
|
||||||
|
(isBnb && getBalanceNumber(bnbTokenBalance) === 0) ||
|
||||||
|
(isHcc && getBalanceNumber(hccTokenBalance) === 0) ||
|
||||||
|
(isUsdt && getBalanceNumber(usdtTokenBalance) === 0)
|
||||||
|
) {
|
||||||
|
toastWarning(t('Insufficient Balance'))
|
||||||
|
}
|
||||||
|
}, [isBnb, isHcc, isUsdt])
|
||||||
|
return [onCheck]
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useBuyTransaction = () => {
|
||||||
|
const referralContract = useReferralchef()
|
||||||
|
const transaction = async () => {
|
||||||
|
const data = await withdrawReward()
|
||||||
|
const { to, amount, code, signature } = data
|
||||||
|
console.log(data)
|
||||||
|
const params = [to, amount, code, signature]
|
||||||
|
const price = getDecimalAmountNumber(amount)
|
||||||
|
const res = await referralContract.adminMint(...params, { value: price })
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
return transaction
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useWithdraw = () => {
|
||||||
|
const referralRewardContract = useReferralRewardchef()
|
||||||
|
const transaction = async () => {
|
||||||
|
const data = await withdrawReward()
|
||||||
|
const { to, amount, expiredTime, signature } = data
|
||||||
|
console.log(data)
|
||||||
|
const params = [to, amount, expiredTime, signature]
|
||||||
|
const price = getDecimalAmountNumber(amount)
|
||||||
|
const res = await referralRewardContract.withDrawReward(...params, { value: price })
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
return transaction
|
||||||
|
}
|
||||||
|
|
||||||
|
export default useCheckTokenBalance
|
||||||
|
|
@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
|
||||||
import styled from 'styled-components'
|
import styled from 'styled-components'
|
||||||
import { fetchReferralInfoAsync } from 'state/actions'
|
import { fetchReferralInfoAsync } from 'state/actions'
|
||||||
import { useAccount } from 'state/userInfo/hooks'
|
import { useAccount } from 'state/userInfo/hooks'
|
||||||
import { useReferralConfigInfo } from 'state/referral/hooks'
|
import { useReferralCommanderConfigInfo } from 'state/referral/hooks'
|
||||||
import { useDispatch } from 'react-redux'
|
import { useDispatch } from 'react-redux'
|
||||||
import UnunitedCom from './components/UnunitedCom'
|
import UnunitedCom from './components/UnunitedCom'
|
||||||
import ConnectedCom from './components/Connected'
|
import ConnectedCom from './components/Connected'
|
||||||
|
|
@ -42,7 +42,7 @@ const Nft: React.FC = () => {
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const account = useAccount()
|
const account = useAccount()
|
||||||
|
|
||||||
const referralConfigInfo = useReferralConfigInfo()
|
const referralConfigInfo = useReferralCommanderConfigInfo()
|
||||||
console.log(referralConfigInfo)
|
console.log(referralConfigInfo)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(fetchReferralInfoAsync(account))
|
dispatch(fetchReferralInfoAsync(account))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue