text: 
  $(function() {
  consoleInit(main)
  });
  
  const DRAX_STAKING_ABI = [{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Recovered","inputs":[{"type":"address","name":"token","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RewardAdded","inputs":[{"type":"uint256","name":"reward1","internalType":"uint256","indexed":false},{"type":"uint256","name":"reward2","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RewardPaid","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"reward1","internalType":"uint256","indexed":false},{"type":"uint256","name":"reward2","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RewardsDurationUpdated","inputs":[{"type":"uint256","name":"newDuration","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Staked","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"StakedMultiplier","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Withdrawn","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"WithdrawnMultiplier","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOfMultiplier","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"devFundAdd","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"devFundFeeMultiplier","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"devFundFeeStaking","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"earnedtokenDRAX","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"earnedtokenDmagic","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"exit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getDmagicAPY","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getDmagicWPY","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getDraxAPY","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getDraxWPY","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMultiplierForAmount","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMultiplyingFactor","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMultiplyingFactorWei","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"getReward","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getReward1ForDuration","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getReward2ForDuration","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_rewardsDistribution","internalType":"address"},{"type":"address","name":"_rewardsToken1","internalType":"address"},{"type":"address","name":"_rewardsToken2","internalType":"address"},{"type":"address","name":"_stakingToken","internalType":"address"},{"type":"address","name":"_stakingTokenMultiplier","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastTimeRewardApplicable","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastUpdateTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lockTimeMultiplierToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lockTimeStakingToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lockingPeriodMultiplier","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lockingPeriodStaking","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"multiplierFactor","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"notifyRewardAmount","inputs":[{"type":"uint256","name":"rewardDmagic","internalType":"uint256"},{"type":"uint256","name":"rewardDRAX","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"periodFinish","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"recoverERC20","inputs":[{"type":"address","name":"tokenAddress","internalType":"address"},{"type":"uint256","name":"tokenAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardPerToken1","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardPerToken1Stored","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardPerToken2","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardPerToken2Stored","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardRate1","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardRate2","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewards1","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewards2","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"rewardsDistribution","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardsDuration","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20Upgradeable"}],"name":"rewardsToken1","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20Upgradeable"}],"name":"rewardsToken2","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOnMultiplierAmount","inputs":[{"type":"uint256[5]","name":"_values","internalType":"uint256[5]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRewardsDistribution","inputs":[{"type":"address","name":"_rewardsDistribution","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRewardsDuration","inputs":[{"type":"uint256","name":"_rewardsDuration","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTimelockMultiplierToken","inputs":[{"type":"uint256","name":"lockTime","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTimelockStakingToken","inputs":[{"type":"uint256","name":"lockTime","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTransferParams","inputs":[{"type":"address","name":"_stakingPoolFeeAdd","internalType":"address"},{"type":"address","name":"_devFundAdd","internalType":"address"},{"type":"uint256","name":"_stakingPoolFeeStaking","internalType":"uint256"},{"type":"uint256","name":"_devFundFeeStaking","internalType":"uint256"},{"type":"uint256","name":"_stakingPoolFeeMultiplier","internalType":"uint256"},{"type":"uint256","name":"_devFundFeeMultiplier","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"stake","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"stakeMultiplier","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"stakingPoolFeeAdd","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"stakingPoolFeeMultiplier","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"stakingPoolFeeStaking","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20Upgradeable"}],"name":"stakingToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20Upgradeable"}],"name":"stakingTokenMultiplier","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalEarnedDRAX","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalEarnedDmagic","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupplyMultiplier","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalToken1ForReward","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalToken2ForReward","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userRewardPerToken1Paid","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"userRewardPerToken2Paid","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawMultiplier","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawNotified","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawNotifiedEmergency","inputs":[{"type":"uint256","name":"reward1Amount","internalType":"uint256"},{"type":"uint256","name":"reward2Amount","internalType":"uint256"}]}]
  
  async function main() {
    const App = await init_ethers();
  
    _print(`Initialized ${App.YOUR_ADDRESS}\n`);
    _print("Reading smart contracts...\n");
  
    const tokens = {};
    const prices = await getMaticPrices();
  
    const rewardTokenAddresses = [
      "0x61daecab65ee2a1d5b6032df030f3faa3d116aa7",
      "0x1ba3510a9ceeb72e5cdba8bcdde9647e1f20fb4b"
    ]
  
    const pool = {
      address : "0x8EeDBb427Dc81e6fF8884C4c31Fc0cf3875d202a",
      abi: DRAX_STAKING_ABI,
      stakeTokenFunction: "stakingToken",
      rewardTokenAddresses: rewardTokenAddresses
    }
  
    let p = await loadDraxSynthetixPool(App, tokens, prices, pool.abi, pool.address, pool.rewardTokenAddresses, pool.stakeTokenFunction)
    
    _print_bold(`Total staked: $${formatMoney(p.staked_tvl)}`);
    if (p.totalUserStaked > 0) {
      _print(`You are staking a total of $${formatMoney(p.totalUserStaked)} at an APR of ${(p.totalAPR * 100).toFixed(2)}%\n`);
    }
  
    hideLoading();
  }
  
  async function loadDraxSynthetixPool(App, tokens, prices, abi, address, rewardTokenAddresses, stakeTokenFunction) {
    const info = await loadDraxSynthetixPoolInfo(App, tokens, prices, abi, address, rewardTokenAddresses, stakeTokenFunction);
    if (!info) return null;
    return await printDraxSynthetixPool(App, info);
  }
  
  async function loadDraxSynthetixPoolInfo(App, tokens, prices, stakingAbi, stakingAddress,
    rewardTokenAddresses, stakeTokenFunction) {
        const STAKING_POOL = new ethers.Contract(stakingAddress, stakingAbi, App.provider);
    
        if (!STAKING_POOL.callStatic[stakeTokenFunction]) {
          console.log("Couldn't find stake function ", stakeTokenFunction);
        }
        const stakeTokenAddress = await STAKING_POOL.callStatic[stakeTokenFunction]();
    
        var stakeToken = await getMaticToken(App, stakeTokenAddress, stakingAddress);
    
        if (stakeTokenAddress.toLowerCase() === rewardTokenAddresses[0].toLowerCase() ||
            stakeTokenAddress.toLowerCase() === rewardTokenAddresses[1].toLowerCase()) {
          stakeToken.staked = await STAKING_POOL.totalSupply() / 10 ** stakeToken.decimals;
        }
    
        /*var newTokenAddresses = stakeToken.tokens.filter(x =>
          !getParameterCaseInsensitive(tokens,x));
        for (const address of newTokenAddresses) {
            tokens[address] = await getMaticToken(App, address, stakingAddress);
        }*/
        //await getNewPricesAndTokens(App, tokens, prices, [stakeTokenAddress], stakingAddress)
  
        for(rewardTokenAddress of rewardTokenAddresses){
            if (!getParameterCaseInsensitive(tokens, rewardTokenAddress)) {
              tokens[rewardTokenAddress] = await getMaticToken(App, rewardTokenAddress, stakingAddress);
          }
        }
  
        let rewardTokens = [];
        for(rewardTokenAddress of rewardTokenAddresses){
          const rewardToken = getParameterCaseInsensitive(tokens, rewardTokenAddress);
          rewardTokens.push(rewardToken);
        }
    
        let rewardTokenTickers = [];
        for(rewardToken of rewardTokens){
          const rewardTokenTicker = rewardToken.symbol;
          rewardTokenTickers.push(rewardTokenTicker);
        }
    
        const poolPrices = getPoolPrices(tokens, prices, stakeToken, "matic");
  
        if (!poolPrices) 
        {
          console.log(`Couldn't calculate prices for pool ${stakeTokenAddress}`);
          return null;
        }
    
        const stakeTokenTicker = poolPrices.stakeTokenTicker;
    
        const stakeTokenPrice =
            prices[stakeTokenAddress]?.usd ?? getParameterCaseInsensitive(prices, stakeTokenAddress)?.usd;
  
        let rewardTokenPrices = [];
        for(rewardTokenAddress of rewardTokenAddresses){
          const rewardTokenPrice = getParameterCaseInsensitive(prices, rewardTokenAddress)?.usd;
          rewardTokenPrices.push(rewardTokenPrice);
        }
    
        const periodFinish = await STAKING_POOL.periodFinish();
  
        let rewardsRate = [];
        const rewardRate1 = await STAKING_POOL.rewardRate1();
        const rewardRate2 = await STAKING_POOL.rewardRate2();
        rewardsRate.push(rewardRate1);
        rewardsRate.push(rewardRate2);
  
        let weeklyRewards = [];
        for(rewardRate of rewardsRate){
          const weeklyReward = (Date.now() / 1000 > periodFinish) ? 0 : rewardRate / 1e18 * 604800;
          weeklyRewards.push(weeklyReward);
        }
    
        let usdCoinsPerWeek = [];
        for(let i = 0; i < weeklyRewards.length; i++){
          const usdPerWeek = weeklyRewards[i] * rewardTokenPrices[i]
          usdCoinsPerWeek.push(usdPerWeek);
        }
    
        const staked_tvl = poolPrices.staked_tvl;
    
        const userStaked = await STAKING_POOL.balanceOf(App.YOUR_ADDRESS) / 10 ** stakeToken.decimals;
    
        const userUnstaked = stakeToken.unstaked;
    
        let earnings = [];
        //const earned1 = await STAKING_POOL.earnedtokenDRAX(App.YOUR_ADDRESS) / 10 ** rewardToken.decimals;
        //const earned2 = await STAKING_POOL.earnedtokenDmagic(App.YOUR_ADDRESS) / 10 ** rewardToken.decimals;
        const earned1 = await STAKING_POOL.totalEarnedDRAX(App.YOUR_ADDRESS) / 1e18;
        const earned2 = await STAKING_POOL.totalEarnedDmagic(App.YOUR_ADDRESS) / 1e18;
        earnings.push(earned1);
        earnings.push(earned2);
    
        return  {
          stakingAddress,
          poolPrices,
          stakeTokenAddress,
          rewardTokenAddresses,
          stakeTokenTicker,
          rewardTokenTickers,
          stakeTokenPrice,
          rewardTokenPrices,
          weeklyRewards,
          usdCoinsPerWeek,
          staked_tvl,
          userStaked,
          userUnstaked,
          earnings
        }
  }
  
  async function printDraxSynthetixPool(App, info, chain="matic", customURLs) {
      info.poolPrices.print_price(chain, 4, customURLs);
      for(let i = 0; i < info.rewardTokenTickers; i++){
        _print(`${info.rewardTokenTickers[i]} Per Week: ${info.weeklyRewards[i].toFixed(2)} ($${formatMoney(info.usdCoinsPerWeek[i])})`);
      }
      let totalYearlyAPR = 0;
      let totalWeeklyAPR = 0;
      let totalDailyAPR = 0;
      let totalusdCoinsPerDay = 0;
      let totalusdCoinsPerWeek = 0;
      let totalusdCoinsPerYear = 0;
      let totalUSDPerWeek = 0;
      for(let i = 0; i < info.rewardTokenTickers.length; i++){
        let weeklyAPR = info.usdCoinsPerWeek[i] / info.staked_tvl * 100;
        let dailyAPR = weeklyAPR / 7;
        yearlyAPR = weeklyAPR * 52;
        totalYearlyAPR += yearlyAPR;
        totalWeeklyAPR += weeklyAPR;
        totalDailyAPR += dailyAPR;
        totalUSDPerWeek += info.usdCoinsPerWeek[i];
        _print(`${info.rewardTokenTickers[i]} Per Week: ${info.weeklyRewards[i].toFixed(2)} ($${formatMoney(info.usdCoinsPerWeek[i])}) APR: Year ${yearlyAPR.toFixed(2)}%`);
      }
      _print(`Total Per Week: $${formatMoney(totalUSDPerWeek)}`);
      _print(`Total APR: Day ${totalDailyAPR.toFixed(4)}% Week ${totalWeeklyAPR.toFixed(2)}% Year ${totalYearlyAPR.toFixed(2)}%`);
      const userStakedUsd = info.userStaked * info.stakeTokenPrice;
      const userStakedPct = userStakedUsd / info.staked_tvl * 100;
      _print(`You are staking ${info.userStaked.toFixed(6)} ${info.stakeTokenTicker} ` +
             `$${formatMoney(userStakedUsd)} (${userStakedPct.toFixed(2)}% of the pool).`);
      if (info.userStaked > 0) {
        info.poolPrices.print_contained_price(info.userStaked);
        for(let i = 0; i < info.rewardTokenTickers.length; i++){
          let userWeeklyRewards = userStakedPct * info.weeklyRewards[i] / 100;
          let userDailyRewards = userWeeklyRewards / 7;
          let userYearlyRewards = userWeeklyRewards * 52;
    
          totalusdCoinsPerDay += userDailyRewards;
          totalusdCoinsPerWeek += userWeeklyRewards;
          totalusdCoinsPerYear += userYearlyRewards;
        }
        _print(`Total Earnings: Day ${totalusdCoinsPerDay.toFixed(4)}% Week ${totalusdCoinsPerWeek.toFixed(2)}% Year ${totalusdCoinsPerYear.toFixed(2)}%`);
      }
      const approveTENDAndStake = async function() {
        return rewardsContract_stake(info.stakeTokenAddress, info.stakingAddress, App)
      }
      const unstake = async function() {
        return rewardsContract_unstake(info.stakingAddress, App)
      }
      const claim = async function() {
        return rewardsContract_claim(info.stakingAddress, App)
      }
      const exit = async function() {
        return rewardsContract_exit(info.stakingAddress, App)
      }
      const revoke = async function() {
        return rewardsContract_resetApprove(info.stakeTokenAddress, info.stakingAddress, App)
      }
      _print(`<a target="_blank" href="https://explorer-mainnet.maticvigil.com/address/${info.stakingAddress}#code">Polygon Explorer</a>`);
      if (info.stakeTokenTicker != "ETH") {
        _print_link(`Stake ${info.userUnstaked.toFixed(6)} ${info.stakeTokenTicker}`, approveTENDAndStake)
      }
      else {
        _print("Please use the official website to stake ETH.");
      }
      _print_link(`Unstake ${info.userStaked.toFixed(6)} ${info.stakeTokenTicker}`, unstake)
      for(let i = 0; i < info.earnings.length; i++){
        _print_link(`Claim ${info.earnings[i].toFixed(6)} ${info.rewardTokenTickers[i]} ($${formatMoney(info.earnings[i]*info.rewardTokenPrices[i])})`, claim)
      }
      if (info.stakeTokenTicker != "ETH") {
        _print_link(`Revoke (set approval to 0)`, revoke)
      }
      _print_link(`Exit`, exit)
      _print("");
  
      return {
          staked_tvl: info.poolPrices.staked_tvl,
          userStaked : userStakedUsd,
          apr : yearlyAPR
      }
  }