class ContractService extends AbstractService implements DeployComponent, ExecuteComponent, QueryComponent {

  public DeploymentResult getLatestContractInformation() {
    if (deployHistory.isEmpty()) {
      throw new ResourceNotFoundException("No deployment!! Deploy your contract first.");
    }
    final DeploymentResult latest = deployHistory.get(deployHistory.size() - 1);
    logger.debug("Latest deployment: {}", latest);
    if (null == latest.getContractInterface()) {
      final String encodedContractTxHash = latest.getEncodedContractTransactionHash();
      logger.trace("Encoded tx hash: {}", encodedContractTxHash);
      final ContractTxHash contractTxHash = new ContractTxHash(encodedContractTxHash);
      final ContractInterface contractInterface = getInterface(contractTxHash);
      latest.setContractInterface(contractInterface);
    }
    return latest;
  }

}