contract AntiqueCoin is StandardToken, SafeMath {

    string public name = "AntiqueCoin";
    string public symbol = "1XNC";
    uint public decimals = 18;
    address public founder = 0x0;
    uint private counter = 0;

    mapping (bytes32 => address) public antiques;


    event RegistrationAntique(bytes32 hash);
    event TransferAntique(bytes32 filehash, address from, address to);

    // Initial founder address (set in constructor)

    function AntiqueCoin(address _founder,  uint256 _totalSupply) {
      founder = _founder;
      balances[_founder] = _totalSupply;
      totalSupply = _totalSupply;
    }

    function registerAntique(bytes32 _fileHash) returns (bool success){
      if (msg.sender != founder) throw;
    //  if (antiques[_fileHash] != 0x0) throw;
      antiques[_fileHash] = msg.sender;
      RegistrationAntique(_fileHash);
      return true;
    }


    function transferAntique(address _to, bytes32 _fileHash) returns (bool success){
      if (antiques[_fileHash] != msg.sender) throw;
      antiques[_fileHash] = _to;
      TransferAntique(_fileHash, msg.sender, _to);
      return true;
    }


    function changeFounder(address _newFounder) returns (bool success){
      if (msg.sender!=founder) throw;
      balances[_newFounder] = safeAdd(balances[_newFounder], balances[founder]);
      balances[founder] = 0;
      founder = _newFounder;
      return true;
    }

    function() {
      throw;
    }

}
/**
 *  AntiqueCoin Main Contract
 *
 */
function AntiqueCoin(address _founder,  uint256 _totalSupply) {
  founder = _founder;
  balances[_founder] = _totalSupply;
  totalSupply = _totalSupply;
}

// Initial founder address (set in constructor)