From a0d8070adcb560534539cfe350dd953ac4368d3e Mon Sep 17 00:00:00 2001 From: gary <1032230992@qq.com> Date: Wed, 13 Apr 2022 23:59:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9hcc=E5=90=88=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useContract.ts | 5 +++++ src/utils/addressHelpers.ts | 3 +++ src/utils/contractHelpers.ts | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/src/hooks/useContract.ts b/src/hooks/useContract.ts index 7ca056c..56e5464 100644 --- a/src/hooks/useContract.ts +++ b/src/hooks/useContract.ts @@ -3,6 +3,7 @@ import useActiveWeb3React from 'hooks/useActiveWeb3React' import { getBep20Contract, getCakeContract, + getHccContract, getBunnyFactoryContract, getBunnySpecialContract, getPancakeRabbitContract, @@ -68,6 +69,10 @@ export const useCake = () => { const { library } = useActiveWeb3React() return useMemo(() => getCakeContract(library.getSigner()), [library]) } +export const useHcc = () => { + const { library } = useActiveWeb3React() + return useMemo(() => getHccContract(library.getSigner()), [library]) +} export const useBunnyFactory = () => { const { library } = useActiveWeb3React() diff --git a/src/utils/addressHelpers.ts b/src/utils/addressHelpers.ts index 64010fb..9d988c8 100644 --- a/src/utils/addressHelpers.ts +++ b/src/utils/addressHelpers.ts @@ -11,6 +11,9 @@ export const getAddress = (address: Address): string => { export const getCakeAddress = () => { return getAddress(tokens.cake.address) } +export const getHccAddress = () => { + return getAddress(tokens.hcc.address) +} export const getMasterChefAddress = () => { return getAddress(addresses.masterChef) } diff --git a/src/utils/contractHelpers.ts b/src/utils/contractHelpers.ts index 001d861..a2a0e2e 100644 --- a/src/utils/contractHelpers.ts +++ b/src/utils/contractHelpers.ts @@ -11,6 +11,7 @@ import { getBunnyFactoryAddress, getBunnySpecialAddress, getCakeAddress, + getHccAddress, getLotteryV2Address, getMasterChefAddress, getPointCenterIfoAddress, @@ -34,6 +35,7 @@ import bep20Abi from 'config/abi/erc20.json' import erc721Abi from 'config/abi/erc721.json' import lpTokenAbi from 'config/abi/lpToken.json' import cakeAbi from 'config/abi/cake.json' +import hccAbi from 'config/abi/hcc.json' import ifoV1Abi from 'config/abi/ifoV1.json' import ifoV2Abi from 'config/abi/ifoV2.json' import pointCenterIfo from 'config/abi/pointCenterIfo.json' @@ -88,6 +90,9 @@ export const getPointCenterIfoContract = (signer?: ethers.Signer | ethers.provid export const getCakeContract = (signer?: ethers.Signer | ethers.providers.Provider) => { return getContract(cakeAbi, getCakeAddress(), signer) } +export const getHccContract = (signer?: ethers.Signer | ethers.providers.Provider) => { + return getContract(hccAbi, getHccAddress(), signer) +} export const getProfileContract = (signer?: ethers.Signer | ethers.providers.Provider) => { return getContract(profileABI, getPancakeProfileAddress(), signer) }