text: const { deployContract, contractAt, sendTxn } = require("../shared/helpers")
  const { expandDecimals } = require("../../test/shared/utilities")
  
  async function main() {
    const weth = await contractAt("Token", "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1")
    const tokenDecimals = 18
  
    const rewardTrackerArr = [
      {
        name: "feeGmxTracker",
        address: "0xd2D1162512F927a7e282Ef43a362659E4F2a728F",
        transferAmount: "49"
      },
      {
        name: "feeGlpTracker",
        address: "0x4e971a87900b931fF39d1Aad67697F49835400b6",
        transferAmount: "82"
      }
    ]
  
    for (let i = 0; i < rewardTrackerArr.length; i++) {
      const rewardTrackerItem = rewardTrackerArr[i]
      const { transferAmount } = rewardTrackerItem
      const rewardTracker = await contractAt("RewardTracker", rewardTrackerItem.address)
      const rewardDistributorAddress = await rewardTracker.distributor()
      const rewardDistributor = await contractAt("RewardDistributor", rewardDistributorAddress)
      const convertedTransferAmount = ethers.utils.parseUnits(transferAmount, tokenDecimals)
      const rewardsPerInterval = convertedTransferAmount.div(7 * 24 * 60 * 60)
      console.log("rewardDistributorAddress", rewardDistributorAddress)
      console.log("convertedTransferAmount", convertedTransferAmount.toString())
      console.log("rewardsPerInterval", rewardsPerInterval.toString())
  
      await sendTxn(weth.transfer(rewardDistributorAddress, convertedTransferAmount), `weth.transfer ${i}`)
      await sendTxn(rewardDistributor.setTokensPerInterval(rewardsPerInterval), "rewardDistributor.setTokensPerInterval")
    }
  }
  
  main()
    .then(() => process.exit(0))
    .catch(error => {
      console.error(error)
      process.exit(1)
    })
  