feat: 修改hcc合约

This commit is contained in:
gary 2022-04-13 23:59:26 +08:00
parent ce83984982
commit a0d8070adc
3 changed files with 13 additions and 0 deletions

View File

@ -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()

View File

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

View File

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