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) }