contract ZBCToken is StandardToken {

	//FIELDS
	string public name = "ZBCoin";
    string public symbol = "ZBC";
    uint public decimals = 3;

	//ZBC Token total supply - included decimals below
	uint public constant MAX_SUPPLY = 300000000000;
	
	//ASSIGNED IN INITIALIZATION
	address public ownerAddress;  // Address of the contract owner. 
	bool public halted;           // halts the controller if true.
	mapping(address => uint256) public issuedTokens;

	modifier only_owner() {
		if (msg.sender != ownerAddress) throw;
		_;
	}

	//May only be called if the crowdfund has not been halted
	modifier is_not_halted() {
		if (halted) throw;
		_;
	}

	// EVENTS
	event Issue(address indexed _recipient, uint _amount);

	// Initialization contract assigns address of crowdfund contract and end time.
	function ZBCToken () {
		ownerAddress = msg.sender;
		balances[this] += MAX_SUPPLY; // create a pool of token
		totalSupply += MAX_SUPPLY;    // and set a fix max supply
	}

	// used by owner of contract to halt crowdsale and no longer except ether.
	function toggleHalt(bool _halted) only_owner {
		halted = _halted;
	}

	function issueToken(address _recipent, uint _amount) 
		only_owner 
		is_not_halted
		returns (bool o_success)
	{
		this.transfer(_recipent, _amount);
		Issue(_recipent, _amount);
		issuedTokens[_recipent] += _amount;
		return true;
	}

	// Transfer amount of tokens from sender account to recipient.
	// Only callable after the crowd fund end date.
	function transfer(address _recipient, uint _amount)
		is_not_halted
		returns (bool o_success)
	{
		return super.transfer(_recipient, _amount);
	}

	// Transfer amount of tokens from a specified address to a recipient.
	// Only callable after the crowd fund end date.
	function transferFrom(address _from, address _recipient, uint _amount)
		is_not_halted
		returns (bool o_success)
	{
		return super.transferFrom(_from, _recipient, _amount);
	}
}
function toggleHalt(bool _halted) only_owner {
	halted = _halted;
}

// used by owner of contract to halt crowdsale and no longer except ether.