diff --git a/packages/bot/src/runtime.ts b/packages/bot/src/runtime.ts index 81ee917..f716e85 100644 --- a/packages/bot/src/runtime.ts +++ b/packages/bot/src/runtime.ts @@ -36,7 +36,6 @@ export let runtime: { contracts: { BAKC: ContractAddress apeCoinStaking: ContractAddress - pool: ContractAddress } v1Contracts: { nBAYC: ContractAddress @@ -244,8 +243,7 @@ export namespace Runtime { }, contracts: { BAKC: protocol.BAKC, - apeCoinStaking: protocol.apeCoinStaking, - pool: protocol.pool + apeCoinStaking: protocol.apeCoinStaking }, v1Contracts, v2Contracts, diff --git a/packages/bot/src/supplyAndStake/fetch.ts b/packages/bot/src/supplyAndStake/fetch.ts index 2f5acee..03e446e 100644 --- a/packages/bot/src/supplyAndStake/fetch.ts +++ b/packages/bot/src/supplyAndStake/fetch.ts @@ -2,7 +2,7 @@ import { mapErrMsg, sameAddress } from "@para-space/utils" import { logger } from "@para-space/utils" import { BigNumber, ethers } from "ethers" import { chunk } from "lodash" -import { ComFactories, ComTypes, ParaSpaceEthMM, Provider } from "paraspace-provider" +import { ComFactories, ComTypes, EthTypes, ParaSpaceEthMM, Provider } from "paraspace-provider" import { APE_STAKING_POOL_ID } from "../constant" import { runtime } from "../runtime" import { strategy } from "../strategy" @@ -40,7 +40,8 @@ const validateBAKCOwnerAndApproved = async ( ) const bakcOwner = await bakc.ownerOf(stakeBakc.tokenId) const nBakcOwner = await nBakc.ownerOf(stakeBakc.tokenId) - const isApproved = await bakc.isApprovedForAll(bakcOwner, runtime.contracts.pool) + const pool: EthTypes.IPool = provider.connectContract(ParaSpaceEthMM.Pool, runtime.wallet) + const isApproved = await bakc.isApprovedForAll(bakcOwner, pool.address) return ( (sameAddress(stakeBakc.pair.mainTokenOwner, bakcOwner) || sameAddress(stakeBakc.pair.mainTokenOwner, nBakcOwner)) &&