contract BonumToken is StandardToken, Ownable {

	string public constant name = "BonumToken";
	string public constant symbol = "BONUM";
	uint8 public constant decimals = 18;

	uint public constant INITIAL_SUPPLY = 65000000 * (10 ** uint256(decimals));

	address public bounty;
	address public advisors;

	bool public burnt = false;

	TokenTimelock public reserveTimelock;
	TokenTimelock public teamTimelock;

	event Burn(address indexed burner, uint256 value);

	constructor(address _bounty, 
		address _reserve, 
		address _team, 
		address _advisors, 
		uint releaseTime) public {
		require(_bounty != address(0));
		require(_reserve != address(0));
		require(_advisors != address(0));
		totalSupply_ = INITIAL_SUPPLY;
		bounty = _bounty;
		advisors = _advisors;
		reserveTimelock = new TokenTimelock(this, _reserve, releaseTime); 
		teamTimelock = new TokenTimelock(this, _team, releaseTime);

		uint factor = (10 ** uint256(decimals));

    uint bountyBalance = 1300000 * factor;
		balances[_bounty] = bountyBalance;
    emit Transfer(address(0), _bounty, bountyBalance);

    uint advisorsBalance = 6500000 * factor;
    balances[_advisors] = advisorsBalance;
    emit Transfer(address(0), _advisors, advisorsBalance);

    uint reserveBalance = 13000000 * factor;
		balances[reserveTimelock] = reserveBalance;
    emit Transfer(address(0), reserveTimelock, reserveBalance);

    uint teamBalance = 9750000 * factor;
		balances[teamTimelock] = teamBalance;
    emit Transfer(address(0), teamTimelock, teamBalance);

    uint ownerBalance = 34450000 * factor;
		balances[msg.sender] = ownerBalance;
    emit Transfer(address(0), msg.sender, ownerBalance);

	}
	
	/**
	* @dev Burns a specific amount of tokens, could be called only once
	* @param _value The amount of token to be burned.
	*/
	function burn(uint256 _value) public onlyOwner {
		require(!burnt);
		require(_value > 0);
		require(_value <= balances[msg.sender]);
		require(block.timestamp < 1690848000); //tokens are available to be burnt only for 5 years

		balances[msg.sender] = balances[msg.sender].sub(_value);
		totalSupply_ = totalSupply_.sub(_value);
		burnt = true;
		emit Burn(msg.sender, _value);
		emit Transfer(msg.sender, address(0), _value);
	}

	/**
	* @dev Moves locked tokens to reserve account. Could be called only after release time, 
	* otherwise would throw an exeption.
	*/
	function releaseReserveTokens() public {
		reserveTimelock.release();
	}

	/**
	* @dev Moves locked tokens to team account. Could be called only after release time, 
	* otherwise would throw an exeption.
	*/
	function releaseTeamTokens() public {
		teamTimelock.release();
	}

}
function releaseTeamTokens() public {
	teamTimelock.release();
}

/**
 	* @dev Moves locked tokens to team account. Could be called only after release time, 
 	* otherwise would throw an exeption.
 	*/