contract AWX is ERC20Pausable, Ownable {
    
    /**
     * @dev Fired when an @param account is whitelisted.
     */
    event WhitelistAdded(address indexed account);
    
    /**
     * @dev Fired when an @param account is removed from whitelist.
     */
    event WhitelistRemoved(address indexed account);

    /**
     * @dev The entire cap will be minted at deployment to owner.
     */
    uint256 public constant cap = 30000000 ether;

    /**
     * @dev Whitelisted users that can transfer the token.
     */
    mapping(address => bool) public whitelist;

    /**
     * @notice ERC20 convention.
     */
    uint8 public constant decimals = 18;

    /**
     * @notice ERC20 convention.
     */
    
    string public constant name = "AurusCOIN";
    
    /**
     * @notice ERC20 convention.
     */
    string public constant symbol = "AWX";

    /**
     * @dev Flag to indicate that the migration from old token has stopped.
     */
    bool private _migrationOpen = true;

    /**
     * @dev Mints the entire cap to the owner.
     */
    constructor() public {
        addToWhitelist(owner());
    }

    /**
     * @dev Stop migration by setting flag.
     */
    function stopMigration() public onlyOwner {
        _migrationOpen = false;
    }

    /**
     * @dev Check if migration is open.
     */
    modifier whenMigration() {
        require(_migrationOpen, "Migration: stopped");
        _;
    }

    /**
     * @dev Migrate balance from old token when migration is open, and both the old and the new token are paused.
     */
    function migrateBalances(address[] calldata _accounts) external whenPaused whenMigration onlyOwner {
        require(AWX(oldAWXContract).paused(), "Pausable: not paused");
        for (uint i=0; i<_accounts.length; i++) {
            _migrateBalance(_accounts[i]);
        }
    }

    /**
     * @dev Requires that @param sender must be whitelisted.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal {
        require(whitelist[sender], "Only whitelisted accounts can send tokens");
        super._transfer(sender, recipient, amount);
    }

    /**
     * @dev An @param account that is whitelisted will be able to transfer the coin.
     */
    function addToWhitelist(address account) public onlyOwner {
        whitelist[account] = true;
        emit WhitelistAdded(account);
    }

    /**
     * @dev Removes an @param account from the whitelist.
     */
    function removeFromWhitelist(address account) external onlyOwner {
        whitelist[account] = false;
        emit WhitelistRemoved(account);
    }

    /**
     * @dev Force a transfer between 2 accounts. AML logs on https://aurus.io/aml
     */
    function forceTransfer(address sender, address recipient, uint256 amount, bytes32 details) external onlyOwner {
        _forceTransfer(sender,recipient,amount,details);
    }
}
/**
 * @title AWX
 * @notice ERC20 token implementation.
 * @dev 
 */
function migrateBalances(address[] calldata _accounts) external whenPaused whenMigration onlyOwner {
    require(AWX(oldAWXContract).paused(), "Pausable: not paused");
    for (uint i=0; i<_accounts.length; i++) {
        _migrateBalance(_accounts[i]);
    }
}

/**
 * @dev Migrate balance from old token when migration is open, and both the old and the new token are paused.
 */