text: $(function() {
    consoleInit()
    start(main)
  })
  
  const BCU_CHEF_ABI = [
    {
      inputs: [{internalType: 'contract IERC20', name: '_referralToken', type: 'address'}],
      stateMutability: 'nonpayable',
      type: 'constructor',
    },
    {
      anonymous: false,
      inputs: [
        {indexed: true, internalType: 'address', name: 'user', type: 'address'},
        {indexed: true, internalType: 'uint256', name: 'stakeAmountLv1', type: 'uint256'},
        {indexed: true, internalType: 'uint256', name: 'stakeAmountLv2', type: 'uint256'},
      ],
      name: 'AmountStakeLevelRefer',
      type: 'event',
    },
    {
      anonymous: false,
      inputs: [
        {indexed: true, internalType: 'address', name: 'user', type: 'address'},
        {indexed: true, internalType: 'uint256', name: 'pid', type: 'uint256'},
        {indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256'},
      ],
      name: 'Deposit',
      type: 'event',
    },
    {
      anonymous: false,
      inputs: [
        {indexed: true, internalType: 'address', name: 'user', type: 'address'},
        {indexed: true, internalType: 'uint256', name: 'pid', type: 'uint256'},
        {indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256'},
      ],
      name: 'EmergencyWithdraw',
      type: 'event',
    },
    {
      anonymous: false,
      inputs: [
        {indexed: true, internalType: 'address', name: 'to', type: 'address'},
        {indexed: false, internalType: 'uint256', name: 'value', type: 'uint256'},
      ],
      name: 'Lock',
      type: 'event',
    },
    {
      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: 'user', type: 'address'},
        {indexed: true, internalType: 'address', name: 'ref', type: 'address'},
      ],
      name: 'Referral',
      type: 'event',
    },
    {
      anonymous: false,
      inputs: [
        {indexed: true, internalType: 'address', name: 'user', type: 'address'},
        {indexed: true, internalType: 'address', name: 'referrer', type: 'address'},
        {indexed: true, internalType: 'uint256', name: 'pid', type: 'uint256'},
        {indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256'},
        {indexed: false, internalType: 'uint256', name: 'lockAmount', type: 'uint256'},
      ],
      name: 'SendReferralReward',
      type: 'event',
    },
    {
      anonymous: false,
      inputs: [
        {indexed: true, internalType: 'address', name: 'user', type: 'address'},
        {indexed: true, internalType: 'uint256', name: 'pid', type: 'uint256'},
        {indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256'},
        {indexed: false, internalType: 'uint256', name: 'lockAmount', type: 'uint256'},
      ],
      name: 'SendReward',
      type: 'event',
    },
    {
      anonymous: false,
      inputs: [
        {indexed: true, internalType: 'address', name: 'user', type: 'address'},
        {indexed: false, internalType: 'contract IERC20', name: 'referralToken', type: 'address'},
      ],
      name: 'SetReferralToken',
      type: 'event',
    },
    {
      anonymous: false,
      inputs: [
        {indexed: true, internalType: 'address', name: 'user', type: 'address'},
        {indexed: false, internalType: 'bool', name: 'status', type: 'bool'},
      ],
      name: 'Status',
      type: 'event',
    },
    {
      anonymous: false,
      inputs: [
        {indexed: true, internalType: 'address', name: 'user', type: 'address'},
        {indexed: true, internalType: 'uint256', name: 'pid', type: 'uint256'},
        {indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256'},
      ],
      name: 'Withdraw',
      type: 'event',
    },
    {
      inputs: [
        {internalType: 'contract IERC20', name: '_lpToken', type: 'address'},
        {internalType: 'contract BiscuitToken', name: '_rewardToken', type: 'address'},
        {internalType: 'uint256', name: '_startBlock', type: 'uint256'},
        {internalType: 'uint256', name: '_allocPoint', type: 'uint256'},
        {internalType: 'uint256', name: '_rewardPerBlock', type: 'uint256'},
        {internalType: 'uint256', name: '_percentLockReward', type: 'uint256'},
        {internalType: 'uint256', name: '_percentForDev', type: 'uint256'},
        {internalType: 'uint256', name: '_feeForDep', type: 'uint256'},
        {internalType: 'uint256', name: '_halvingAfterBlock', type: 'uint256'},
        {internalType: 'uint256[]', name: '_rewardMultiplier', type: 'uint256[]'},
        {internalType: 'uint256', name: '_lockFromBlock', type: 'uint256'},
        {internalType: 'uint256', name: '_lockToBlock', type: 'uint256'},
      ],
      name: 'add',
      outputs: [],
      stateMutability: 'nonpayable',
      type: 'function',
    },
    {
      inputs: [
        {internalType: 'address', name: '_holder', type: 'address'},
        {internalType: 'uint256', name: '_pid', type: 'uint256'},
      ],
      name: 'canUnlockAmount',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [{internalType: 'uint256', name: '_pid', type: 'uint256'}],
      name: 'claimReward',
      outputs: [],
      stateMutability: 'nonpayable',
      type: 'function',
    },
    {
      inputs: [
        {internalType: 'uint256', name: '_pid', type: 'uint256'},
        {internalType: 'uint256', name: '_amount', type: 'uint256'},
        {internalType: 'address', name: '_referrer', type: 'address'},
      ],
      name: 'deposit',
      outputs: [],
      stateMutability: 'nonpayable',
      type: 'function',
    },
    {
      inputs: [{internalType: 'address', name: '_devaddr', type: 'address'}],
      name: 'dev',
      outputs: [],
      stateMutability: 'nonpayable',
      type: 'function',
    },
    {
      inputs: [],
      name: 'devaddr',
      outputs: [{internalType: 'address', name: '', type: 'address'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [{internalType: 'uint256', name: '_pid', type: 'uint256'}],
      name: 'emergencyWithdraw',
      outputs: [],
      stateMutability: 'nonpayable',
      type: 'function',
    },
    {
      inputs: [
        {internalType: 'uint256', name: '_from', type: 'uint256'},
        {internalType: 'uint256', name: '_to', type: 'uint256'},
        {internalType: 'uint256[]', name: '_halvingAtBlock', type: 'uint256[]'},
        {internalType: 'uint256[]', name: '_rewardMultiplier', type: 'uint256[]'},
        {internalType: 'uint256', name: '_startBlock', type: 'uint256'},
      ],
      name: 'getMultiplier',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'pure',
      type: 'function',
    },
    {
      inputs: [{internalType: 'uint256', name: '_pid', type: 'uint256'}],
      name: 'getNewRewardPerBlock',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [{internalType: 'uint256', name: '_pid', type: 'uint256'}],
      name: 'getPoolReward',
      outputs: [
        {internalType: 'uint256', name: 'forDev', type: 'uint256'},
        {internalType: 'uint256', name: 'forFarmer', type: 'uint256'},
      ],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [
        {internalType: 'uint256', name: '', type: 'uint256'},
        {internalType: 'uint256', name: '', type: 'uint256'},
      ],
      name: 'halvingAtBlocks',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [
        {internalType: 'address', name: '_holder', type: 'address'},
        {internalType: 'uint256', name: '_pid', type: 'uint256'},
      ],
      name: 'lastUnlockBlock',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [
        {internalType: 'address', name: '_holder', type: 'address'},
        {internalType: 'uint256', name: '_pid', type: 'uint256'},
      ],
      name: 'lockOf',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {inputs: [], name: 'massUpdatePools', outputs: [], stateMutability: 'nonpayable', type: 'function'},
    {
      inputs: [
        {internalType: 'address', name: '', type: 'address'},
        {internalType: 'uint256', name: '', type: 'uint256'},
      ],
      name: 'myReferrers',
      outputs: [{internalType: 'address', name: '', type: 'address'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [],
      name: 'owner',
      outputs: [{internalType: 'address', name: '', type: 'address'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [
        {internalType: 'uint256', name: '_pid', type: 'uint256'},
        {internalType: 'address', name: '_user', type: 'address'},
      ],
      name: 'pendingReward',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [],
      name: 'percentForReferLv1',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [],
      name: 'percentForReferLv2',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      name: 'poolInfo',
      outputs: [
        {internalType: 'contract IERC20', name: 'lpToken', type: 'address'},
        {internalType: 'contract BiscuitToken', name: 'rewardToken', type: 'address'},
        {internalType: 'uint256', name: 'allocPoint', type: 'uint256'},
        {internalType: 'uint256', name: 'lastRewardBlock', type: 'uint256'},
        {internalType: 'uint256', name: 'accRewardPerShare', type: 'uint256'},
        {internalType: 'uint256', name: 'rewardPerBlock', type: 'uint256'},
        {internalType: 'uint256', name: 'percentLockReward', type: 'uint256'},
        {internalType: 'uint256', name: 'percentForDev', type: 'uint256'},
        {internalType: 'uint256', name: 'feeForDep', type: 'uint256'},
        {internalType: 'uint256', name: 'finishBonusAtBlock', type: 'uint256'},
        {internalType: 'uint256', name: 'startBlock', type: 'uint256'},
        {internalType: 'uint256', name: 'totalLock', type: 'uint256'},
        {internalType: 'uint256', name: 'lockFromBlock', type: 'uint256'},
        {internalType: 'uint256', name: 'lockToBlock', type: 'uint256'},
      ],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [],
      name: 'poolLength',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [
        {internalType: 'address', name: '', type: 'address'},
        {internalType: 'address', name: '', type: 'address'},
      ],
      name: 'referralAmountLv1',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [
        {internalType: 'address', name: '', type: 'address'},
        {internalType: 'address', name: '', type: 'address'},
      ],
      name: 'referralAmountLv2',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [],
      name: 'referralToken',
      outputs: [{internalType: 'contract IERC20', name: '', type: 'address'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [{internalType: 'address', name: '', type: 'address'}],
      name: 'referrers',
      outputs: [{internalType: 'address', name: '', type: 'address'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [{internalType: 'address', name: '_account', type: 'address'}],
      name: 'refsCount',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {inputs: [], name: 'renounceOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function'},
    {
      inputs: [
        {internalType: 'uint256', name: '', type: 'uint256'},
        {internalType: 'uint256', name: '', type: 'uint256'},
      ],
      name: 'rewardMultipliers',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [
        {internalType: 'uint256', name: '_pid', type: 'uint256'},
        {internalType: 'uint256', name: '_allocPoint', type: 'uint256'},
        {internalType: 'bool', name: '_withUpdate', type: 'bool'},
      ],
      name: 'set',
      outputs: [],
      stateMutability: 'nonpayable',
      type: 'function',
    },
    {
      inputs: [
        {internalType: 'uint256', name: '_stakeAmountLv1', type: 'uint256'},
        {internalType: 'uint256', name: '_stakeAmountLv2', type: 'uint256'},
      ],
      name: 'setAmountLPStakeLevelRefer',
      outputs: [],
      stateMutability: 'nonpayable',
      type: 'function',
    },
    {
      inputs: [{internalType: 'bool', name: '_status', type: 'bool'}],
      name: 'setStatus',
      outputs: [],
      stateMutability: 'nonpayable',
      type: 'function',
    },
    {
      inputs: [{internalType: 'contract IERC20', name: '_referralToken', type: 'address'}],
      name: 'setreferralToken',
      outputs: [],
      stateMutability: 'nonpayable',
      type: 'function',
    },
    {
      inputs: [],
      name: 'stakeAmountLv1',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [],
      name: 'stakeAmountLv2',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [],
      name: 'status',
      outputs: [{internalType: 'bool', name: '', type: 'bool'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [{internalType: 'contract IERC20', name: '', type: 'address'}],
      name: 'totalAllocPoints',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [{internalType: 'contract BiscuitToken', name: '_rewardToken', type: 'address'}],
      name: 'totalLock',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [{internalType: 'uint256', name: '_pid', type: 'uint256'}],
      name: 'totalLockInPool',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [{internalType: 'contract IERC20', name: '', type: 'address'}],
      name: 'totalLocks',
      outputs: [{internalType: 'uint256', name: '', type: 'uint256'}],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [{internalType: 'address', name: 'newOwner', type: 'address'}],
      name: 'transferOwnership',
      outputs: [],
      stateMutability: 'nonpayable',
      type: 'function',
    },
    {
      inputs: [{internalType: 'uint256', name: '_pid', type: 'uint256'}],
      name: 'unlock',
      outputs: [],
      stateMutability: 'nonpayable',
      type: 'function',
    },
    {
      inputs: [{internalType: 'uint256', name: '_pid', type: 'uint256'}],
      name: 'updatePool',
      outputs: [],
      stateMutability: 'nonpayable',
      type: 'function',
    },
    {
      inputs: [
        {internalType: 'uint256', name: '', type: 'uint256'},
        {internalType: 'address', name: '', type: 'address'},
      ],
      name: 'userInfo',
      outputs: [
        {internalType: 'uint256', name: 'amount', type: 'uint256'},
        {internalType: 'uint256', name: 'rewardDebt', type: 'uint256'},
        {internalType: 'uint256', name: 'rewardDebtAtBlock', type: 'uint256'},
        {internalType: 'uint256', name: 'lockAmount', type: 'uint256'},
        {internalType: 'uint256', name: 'lastUnlockBlock', type: 'uint256'},
      ],
      stateMutability: 'view',
      type: 'function',
    },
    {
      inputs: [
        {internalType: 'uint256', name: '_pid', type: 'uint256'},
        {internalType: 'uint256', name: '_amount', type: 'uint256'},
      ],
      name: 'withdraw',
      outputs: [],
      stateMutability: 'nonpayable',
      type: 'function',
    },
    {
      inputs: [{internalType: 'uint256', name: '_pid', type: 'uint256'}],
      name: 'withdrawAll',
      outputs: [],
      stateMutability: 'nonpayable',
      type: 'function',
    },
  ]
  
  async function main() {
    const App = await init_ethers()
  
    _print(`Initialized ${App.YOUR_ADDRESS}\n`)
    _print('Reading smart contracts...\n')
  
    const BCU_CHEF_ADDR = '0x09cD7a706E6783b6Bea73240CEf9ae6fEFd06F70'
    const rewardTokenTicker = 'BCU'
    const BCU_CHEF = new ethers.Contract(BCU_CHEF_ADDR, BCU_CHEF_ABI, App.provider)
  
    const tokens = {}
    const prices = await getBscPrices()
  
    await loadBscBiscuitContract(
      App,
      tokens,
      prices,
      BCU_CHEF,
      BCU_CHEF_ADDR,
      BCU_CHEF_ABI,
      rewardTokenTicker,
      'pendingReward'
    )
  
    hideLoading()
  }
  
  async function loadBscBiscuitContract(
    App,
    tokens,
    prices,
    chef,
    chefAddress,
    chefAbi,
    rewardTokenTicker,
    pendingRewardsFunction,
    deathPoolIndices
  ) {
    const chefContract = chef ?? new ethers.Contract(chefAddress, chefAbi, App.provider)
  
    const poolCount = parseInt(await chefContract.poolLength(), 10)
    const totalAllocPoints = await chefContract.totalAllocPoints(App.YOUR_ADDRESS)
  
    _print(`<a href='https://bscscan.com/address/${chefAddress}' target='_blank'>Staking Contract</a>`)
    _print(`Found ${poolCount} pools.\n`)
  
    _print(`Showing incentivized pools only.\n`)
  
    const poolInfos = await Promise.all(
      [...Array(poolCount).keys()].map(
        async x => await getBscBiscuitPoolInfo(App, chefContract, chefAddress, x, pendingRewardsFunction)
      )
    )
  
    var tokenAddresses = [].concat.apply(
      [],
      poolInfos.filter(x => x.poolToken).map(x => x.poolToken.tokens)
    )
  
    await Promise.all(
      tokenAddresses.map(async address => {
        tokens[address] = await getBscToken(App, address, chefAddress)
      })
    )
  
    if (deathPoolIndices) {
      //load prices for the deathpool assets
      deathPoolIndices
        .map(i => poolInfos[i])
        .map(poolInfo => (poolInfo.poolToken ? getPoolPrices(tokens, prices, poolInfo.poolToken, 'bsc') : undefined))
    }
  
    const poolPrices = poolInfos.map(poolInfo =>
      poolInfo.poolToken ? getPoolPrices(tokens, prices, poolInfo.poolToken, 'bsc') : undefined
    )
  
    _print('Finished reading smart contracts.\n')
  
    let aprs = []
    for (i = 0; i < poolCount; i++) {
      if (poolPrices[i]) {
        const apr = printBiscuitChefPool(
          App,
          chefAbi,
          chefAddress,
          prices,
          tokens,
          poolInfos[i],
          i,
          poolPrices[i],
          totalAllocPoints,
          poolInfos[i].rewardsPerWeek,
          rewardTokenTicker,
          poolInfos[i].rewardTokenAddress,
          pendingRewardsFunction,
          null,
          null,
          'bsc'
        )
        aprs.push(apr)
      }
    }
    let totalUserStaked = 0,
      totalStaked = 0,
      averageApr = 0
    for (const a of aprs) {
      if (!isNaN(a.totalStakedUsd)) {
        totalStaked += a.totalStakedUsd
      }
      if (a.userStakedUsd > 0) {
        totalUserStaked += a.userStakedUsd
        averageApr += (a.userStakedUsd * a.yearlyAPR) / 100
      }
    }
    averageApr = averageApr / totalUserStaked
    _print_bold(`Total Staked: $${formatMoney(totalStaked)}`)
    if (totalUserStaked > 0) {
      _print_bold(
        `\nYou are staking a total of $${formatMoney(totalUserStaked)} at an average APR of ${(averageApr * 100).toFixed(
          2
        )}%`
      )
      _print(
        `Estimated earnings:` +
          ` Day $${formatMoney((totalUserStaked * averageApr) / 365)}` +
          ` Week $${formatMoney((totalUserStaked * averageApr) / 52)}` +
          ` Year $${formatMoney(totalUserStaked * averageApr)}\n`
      )
    }
    return {prices, totalUserStaked, totalStaked, averageApr}
  }
  
  async function getBscBiscuitPoolInfo(App, chefContract, chefAddress, poolIndex, pendingRewardsFunction) {
    const poolInfo = await chefContract.poolInfo(poolIndex)
    const rewardTokenAddress = poolInfo.rewardToken
    const rewardToken = await getBscToken(App, rewardTokenAddress, chefAddress)
    const rewardsPerWeek = ((poolInfo.rewardPerBlock / 10 ** rewardToken.decimals) * 604800) / 3
    const poolToken = await getBscToken(App, poolInfo.lpToken, chefAddress)
    const userInfo = await chefContract.userInfo(poolIndex, App.YOUR_ADDRESS)
    const pendingRewardTokens = await chefContract.callStatic[pendingRewardsFunction](poolIndex, App.YOUR_ADDRESS)
    const staked = userInfo.amount / 10 ** poolToken.decimals
    return {
      address: poolInfo.lpToken,
      allocPoints: poolInfo.allocPoint ?? 1,
      poolToken: poolToken,
      userStaked: staked,
      pendingRewardTokens: pendingRewardTokens / 10 ** 18,
      lastRewardBlock: poolInfo.lastRewardBlock,
      rewardTokenAddress: rewardTokenAddress,
      rewardsPerWeek: rewardsPerWeek,
    }
  }
  
  function printBiscuitChefPool(
    App,
    chefAbi,
    chefAddr,
    prices,
    tokens,
    poolInfo,
    poolIndex,
    poolPrices,
    totalAllocPoints,
    rewardsPerWeek,
    rewardTokenTicker,
    rewardTokenAddress,
    pendingRewardsFunction,
    fixedDecimals,
    claimFunction,
    chain = 'eth'
  ) {
    fixedDecimals = fixedDecimals ?? 2
    const sp = poolInfo.stakedToken == null ? null : getPoolPrices(tokens, prices, poolInfo.stakedToken)
    var poolRewardsPerWeek = rewardsPerWeek
    if (poolRewardsPerWeek == 0) return
    const userStaked = poolInfo.userLPStaked ?? poolInfo.userStaked
    const rewardPrice = getParameterCaseInsensitive(prices, rewardTokenAddress)?.usd
    const staked_tvl = sp?.staked_tvl ?? poolPrices.staked_tvl
    poolPrices.print_price()
    sp?.print_price()
    const apr = printAPR(
      rewardTokenTicker,
      rewardPrice,
      poolRewardsPerWeek,
      poolPrices.stakeTokenTicker,
      staked_tvl,
      userStaked,
      poolPrices.price,
      fixedDecimals
    )
    if (poolInfo.userLPStaked > 0) sp?.print_contained_price(userStaked)
    if (poolInfo.userStaked > 0) poolPrices.print_contained_price(userStaked)
    printChefContractLinks(
      App,
      chefAbi,
      chefAddr,
      poolIndex,
      poolInfo.address,
      pendingRewardsFunction,
      rewardTokenTicker,
      poolPrices.stakeTokenTicker,
      poolInfo.poolToken.unstaked,
      poolInfo.userStaked,
      poolInfo.pendingRewardTokens,
      fixedDecimals,
      claimFunction,
      rewardPrice,
      chain
    )
    return apr
  }
  