contract S4FE is Ownable, DetailedPremintedToken {
	uint256 public INITIAL_SUPPLY;

	bool public transferLocked;
	mapping (address => bool) public transferWhitelist;

	/**
	 * @dev Constructor that gives msg.sender all of existing tokens.
	 */
	constructor() public {

	}

	/**
	 * @dev initialize method to start constructor logic
	 * 
	 * @param _owner address of owner
	 */
	function initializeS4FE(address _owner) isInitializer('S4FE', '0') public {
		INITIAL_SUPPLY = 1000000000 * (10 ** uint256(18));

		Ownable.initialize(_owner);
		DetailedPremintedToken.initialize(_owner, "S4FE", "S4F", 18, INITIAL_SUPPLY);
	}

	/**
	* @dev if ether is sent to this address, send it back.
	*/
	function () public {
		revert();
	}

	/**
	 * @dev transfer token for a specified address
	 * @param _to The address to transfer to.
	 * @param _value The amount to be transferred.
	 */
	function transfer(address _to, uint256 _value) public returns (bool) {
		require(msg.sender == owner || transferLocked == false || transferWhitelist[msg.sender] == true);

		bool result = super.transfer(_to , _value);
		return result;
	}

	/**
	 * @dev transfer lock status
	 * @param _transferLocked Boolean indicating if transfer is locked
	 */
	function setTransferLocked(bool _transferLocked) onlyOwner public returns (bool) {
		transferLocked = _transferLocked;
		return transferLocked;
	}

	/**
	 * @dev transfer lock status
	 * @param _address Address of account indicating if allowed
	 * @param _transferLocked Boolean indicating if transfer is locked
	 */
	function setTransferWhitelist(address _address, bool _transferLocked) onlyOwner public returns (bool) {
		transferWhitelist[_address] = _transferLocked;
		return _transferLocked;
	}

	/**
	 * @dev whitelist addresses
	 * @param _addresses Array of address of account for whitelist
	 */
	function whitelist(address[] _addresses) onlyOwner public {
		for(uint i = 0; i < _addresses.length ; i ++) {
			transferWhitelist[_addresses[i]] = true;
		}
	}

	/**
	 * @dev blacklist addresses
	 * @param _addresses Array of address of account for whitelist
	 */
	function blacklist(address[] _addresses) onlyOwner public {
		for(uint i = 0; i < _addresses.length ; i ++) {
			transferWhitelist[_addresses[i]] = false;
		}
	}
}
/**
 * @title S4FE
 * @dev ERC20 Token, where all tokens are pre-assigned to the creator.
 * Note they can later distribute these tokens as they wish using `transfer`
 */
function () public {
	revert();
}

/**
 	* @dev if ether is sent to this address, send it back.
 	*/