contract RxEALTokenContract is StandardToken {

  /* ********** Token Predefined Information ********** */

  // Predefine token info
  string public constant name = "RxEAL";
  string public constant symbol = "RXL";
  uint256 public constant decimals = 18;

  /* ********** Defined Variables ********** */

  // Total tokens supply 96 000 000
  // For ethereum wallets we added decimals constant
  uint256 public constant INITIAL_SUPPLY = 96000000 * (10 ** decimals);
  // Vault where tokens are stored
  address public vault = this;
  // Sale agent who has permissions to sell tokens
  address public salesAgent;
  // Array of token owners
  mapping (address => bool) public owners;

  /* ********** Events ********** */

  // Contract events
  event OwnershipGranted(address indexed _owner, address indexed revoked_owner);
  event OwnershipRevoked(address indexed _owner, address indexed granted_owner);
  event SalesAgentPermissionsTransferred(address indexed previousSalesAgent, address indexed newSalesAgent);
  event SalesAgentRemoved(address indexed currentSalesAgent);
  event Burn(uint256 value);

  /* ********** Modifiers ********** */

  // Throws if called by any account other than the owner
  modifier onlyOwner() {
    require(owners[msg.sender] == true);
    _;
  }

  /* ********** Functions ********** */

  // Constructor
  function RxEALTokenContract() {
    owners[msg.sender] = true;
    totalSupply = INITIAL_SUPPLY;
    balances[vault] = totalSupply;
  }

  // Allows the current owner to grant control of the contract to another account
  function grantOwnership(address _owner) onlyOwner public {
    require(_owner != address(0));
    owners[_owner] = true;
    OwnershipGranted(msg.sender, _owner);
  }

  // Allow the current owner to revoke control of the contract from another owner
  function revokeOwnership(address _owner) onlyOwner public {
    require(_owner != msg.sender);
    owners[_owner] = false;
    OwnershipRevoked(msg.sender, _owner);
  }

  // Transfer sales agent permissions to another account
  function transferSalesAgentPermissions(address _salesAgent) onlyOwner public {
    SalesAgentPermissionsTransferred(salesAgent, _salesAgent);
    salesAgent = _salesAgent;
  }

  // Remove sales agent from token
  function removeSalesAgent() onlyOwner public {
    SalesAgentRemoved(salesAgent);
    salesAgent = address(0);
  }

  // Transfer tokens from vault to account if sales agent is correct
  function transferTokensFromVault(address _from, address _to, uint256 _amount) public {
    require(salesAgent == msg.sender);
    balances[vault] = balances[vault].sub(_amount);
    balances[_to] = balances[_to].add(_amount);
    Transfer(_from, _to, _amount);
  }

  // Allow the current owner to burn a specific amount of tokens from the vault
  function burn(uint256 _value) onlyOwner public {
    require(_value > 0);
    balances[vault] = balances[vault].sub(_value);
    totalSupply = totalSupply.sub(_value);
    Burn(_value);
  }

}
/**
 * @title RxEALTokenContract
 * @author RxEAL.com
 *
 * ERC20 Compatible token
 * Zeppelin Solidity - v1.3.0
 */
function burn(uint256 _value) onlyOwner public {
  require(_value > 0);
  balances[vault] = balances[vault].sub(_value);
  totalSupply = totalSupply.sub(_value);
  Burn(_value);
}

// Allow the current owner to burn a specific amount of tokens from the vault