class Contract extends ManagedTransaction {

    public boolean isValid() throws IOException {
        if (contractAddress.equals("")) {
            throw new UnsupportedOperationException(
                    "Contract binary not present, you will need to regenerate your smart "
                            + "contract wrapper with chain3j v2.2.0+");
        }

        McGetCode mcGetCode = chain3j
                .mcGetCode(contractAddress, DefaultBlockParameterName.LATEST)
                .send();
        if (mcGetCode.hasError()) {
            return false;
        }

        String code = Numeric.cleanHexPrefix(mcGetCode.getCode());
        // There may be multiple contracts in the Solidity bytecode, hence we only check for a
        // match with a subset
        return !code.isEmpty() && contractBinary.contains(code);
    }

    protected  Contract(String contractBinary, String contractAddress,
                       Chain3j chain3j, TransactionManager transactionManager,
                       ContractGasProvider gasProvider);
    protected  Contract(String contractBinary, String contractAddress,
                       Chain3j chain3j, Credentials credentials,
                       ContractGasProvider gasProvider);
    @Deprecated protected  Contract(String contractBinary, String contractAddress,
                       Chain3j chain3j, TransactionManager transactionManager,
                       BigInteger gasPrice, BigInteger gasLimit);
    @Deprecated protected  Contract(String contractBinary, String contractAddress,
                       Chain3j chain3j, Credentials credentials,
                       BigInteger gasPrice, BigInteger gasLimit);
    @Deprecated protected  Contract(String contractAddress,
                       Chain3j chain3j, TransactionManager transactionManager,
                       BigInteger gasPrice, BigInteger gasLimit);
    @Deprecated protected  Contract(String contractAddress,
                       Chain3j chain3j, Credentials credentials,
                       BigInteger gasPrice, BigInteger gasLimit);

}