{"size": 2331, "ext": "js", "max_stars_repo_path": "contracts/test/addressHelper.js", "max_stars_repo_name": "InterestUSD/interest_dollar", "max_stars_repo_stars_event_min_datetime": "2021-12-22T19:29:24.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-22T19:29:24.000Z", "max_issues_repo_path": "contracts/test/addressHelper.js", "max_issues_repo_name": "InterestUSD/interest_dollar", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "contracts/test/addressHelper.js", "max_forks_repo_name": "InterestUSD/interest_dollar", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 35.8615384615, "max_line_length": 80, "alphanum_fraction": 0.6615186615}
const addresses = require("../utils/addresses");

const getAssetAddresses = async (hre, deployments) => {
  const isFork = process.env.FORK === "true";
  const isMainnet = hre.network.name === "mainnet";
  const isMainnetOrFork = isMainnet || isFork;
  const isAlfajores = hre.network.name === "alfajores";

  if (isMainnetOrFork) {
    return {
      CELO: addresses.mainnet.CELO,
      CUSD: addresses.mainnet.CUSD,
      CEUR: addresses.mainnet.CEUR,
      mCUSD: addresses.mainnet.mCUSD,
      mCEUR: addresses.mainnet.mCEUR,
      AAVE: addresses.mainnet.Aave,
      AAVE_ADDRESS_PROVIDER: addresses.mainnet.AAVE_ADDRESS_PROVIDER,
      UBE: addresses.mainnet.UBE,
      uniswapRouter: addresses.mainnet.uniswapRouter,
      MOO: addresses.mainnet.MOO,
      UBEStaking: addresses.zero,
    };
  } else {
    return {
      CELO: isAlfajores
        ? addresses.alfajores.CELO
        : (await deployments.get("MockCELO")).address,
      CUSD: isAlfajores
        ? addresses.alfajores.CUSD
        : (await deployments.get("MockCUSD")).address,
      CEUR: isAlfajores
        ? addresses.alfajores.CEUR
        : (await deployments.get("MockCEUR")).address,
      NonStandardToken: (await deployments.get("MockNonStandardToken")).address,
      mCUSD: isAlfajores
        ? addresses.alfajores.mCUSD
        : (await deployments.get("MockMCUSD")).address,
      mCEUR: isAlfajores
        ? addresses.alfajores.mCEUR
        : (await deployments.get("MockMCEUR")).address,
      AAVE: isAlfajores
        ? addresses.alfajores.AAVE
        : (await deployments.get("MockAave")).address,
      AAVE_ADDRESS_PROVIDER: isAlfajores
        ? addresses.alfajores.AAVE_ADDRESS_PROVIDER
        : (await deployments.get("MockAave")).address,
      // OGN: isAlfajores
      //   ? addresses.alfajores.OGN
      //   : (await deployments.get("MockOGN")).address,
      UBE: (await deployments.get("MockUBE")).address,
      MOO: (await deployments.get("MockMOO")).address,
      uniswapRouter: isAlfajores
        ? addresses.alfajores.uniswapRouter
        : (await deployments.get("MockUniswapRouter")).address,
      UBEmCUSDmCEURPair: (await deployments.get("MockMCUSDMEURLPToken"))
        .address,
      UBEStaking: (await deployments.get("MockUbeStaking")).address,
    };
  }
};

module.exports = {
  getAssetAddresses,
};
