{"size": 1413, "ext": "js", "max_stars_repo_path": "migrations/9_deploy-universal-us-dollar-requests.js", "max_stars_repo_name": "universalprotocol/contracts", "max_stars_repo_stars_event_min_datetime": "2020-03-31T15:14:33.000Z", "max_stars_repo_stars_event_max_datetime": "2020-06-12T09:38:01.000Z", "max_issues_repo_path": "migrations/9_deploy-universal-us-dollar-requests.js", "max_issues_repo_name": "universalprotocol/contracts", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "migrations/9_deploy-universal-us-dollar-requests.js", "max_forks_repo_name": "universalprotocol/contracts", "max_forks_repo_forks_event_min_datetime": "2020-12-02T05:30:22.000Z", "max_forks_repo_forks_event_max_datetime": "2020-12-02T05:30:22.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 36.2307692308, "max_line_length": 123, "alphanum_fraction": 0.7275300778}
'use strict';

/**
 * Module dependencies.
 */

const { decodeAccounts } = require('./helper');
const UniversalProtocolToken = artifacts.require('./UniversalProtocolToken');
const UniversalUSDollar = artifacts.require('./UniversalUSDollar');
const UniversalUSDollarRequestsV0 = artifacts.require('./UniversalUSDollarRequestsV0');
const UniversalUSDollarRequestsStorageV0 = artifacts.require('./UniversalUSDollarRequestsStorageV0');
const config = require('config');

/**
 * Exports.
 */

module.exports = async (deployer, network, accounts) => {
  const { deployAddress, upusdFeeBeneficiary, upusdRequestsOwner } = decodeAccounts(accounts);

  await deployer.deploy(UniversalUSDollarRequestsV0,
    // Owner.
    ['mainnet', 'ropsten'].includes(network) ? config.get(`operators.upusd.requestsOwner.${network}`) : upusdRequestsOwner,
    // UPT contract address.
    (await UniversalProtocolToken.deployed()).address,
    // Fee beneficiary.
    ['mainnet', 'ropsten'].includes(network) ? config.get(`wallets.upusd.feeBeneficiary.${network}`) : upusdFeeBeneficiary,
    // Burn fee.
    Number(config.get('upusd.burnFee')),
    // Mint fee.
    Number(config.get('upusd.mintFee')),
    // UPUSD contract address.
    (await UniversalUSDollar.deployed()).address,
    // UPUSD Requests Storage contract address.
    (await UniversalUSDollarRequestsStorageV0.deployed()).address,
    { from: deployAddress }
  );
};
