async function performMigration(deployer, network, accounts) {
  // if (network !== 'development') {
  const DeployedTokenSale = await TokenSale.deployed()
  const DTXBatches = []
  let DTXHoldersWei = {}
  let counter = 1
  Object.keys(LastCallHolders).forEach(address => {
    if (counter % 50 === 0) {
      DTXBatches.push(DTXHoldersWei)
      DTXHoldersWei = {}
    }
    if (Array.isArray(LastCallHolders[address])) {
      DTXHoldersWei[address] = 0
      let sum = 0
      LastCallHolders[address].forEach(amount => {
        sum += amount
      })
      DTXHoldersWei[address] = web3.toWei(sum * 4000)
    } else {
      DTXHoldersWei[address] = web3.toWei(LastCallHolders[address] * 4000)
    }
    DTXHoldersWei[address] = DTXHoldersWei[address]
    counter++
    if (Object.keys(LastCallHolders).length === counter) {
      DTXBatches.push(DTXHoldersWei)
    }
  })
  const lockup = moment('2018-06-23 16:00:00+01:00').unix()
  await forEachSeries(DTXBatches, async batch => {
    const bonus = []
    Object.values(batch).forEach(amount =>
      bonus.push(web3.toWei(web3.fromWei(amount) * 2400))
    )
    await DeployedTokenSale.handleExternalBuyers(
      Object.keys(batch),
      Object.values(batch),
      bonus,
      new Array(Object.values(batch).length).fill(lockup)
    )
  })
}
async function performMigration(deployer, network, accounts) {
  // if (network !== 'development') {
  const DeployedTokenSale = await TokenSale.deployed()
  const DTXBatches = []
  let DTXHoldersWei = {}
  let counter = 1
  Object.keys(DTX85NoLockupHolders).forEach(address => {
    if (counter % 50 === 0) {
      DTXBatches.push(DTXHoldersWei)
      DTXHoldersWei = {}
    }
    if (Array.isArray(DTX85NoLockupHolders[address])) {
      DTXHoldersWei[address] = 0
      let sum = 0
      DTX85NoLockupHolders[address].forEach(amount => {
        sum += amount
      })
      DTXHoldersWei[address] = web3.toWei(sum * 7400)
    } else {
      DTXHoldersWei[address] = web3.toWei(DTX85NoLockupHolders[address] * 7400)
    }
    DTXHoldersWei[address] = DTXHoldersWei[address]
    counter++
    if (Object.keys(DTX85NoLockupHolders).length === counter) {
      DTXBatches.push(DTXHoldersWei)
    }
  })
  await forEachSeries(DTXBatches, async batch => {
    await DeployedTokenSale.handleExternalBuyers(
      Object.keys(batch),
      Object.values(batch),
      new Array(Object.values(batch).length).fill(0),
      new Array(Object.values(batch).length).fill(0)
    )
  })
}