public Optional<AccountAdapter> getCreatedContract(final DataFetchingEnvironment environment) {
    final boolean contractCreated = transactionWithMetadata.getTransaction().isContractCreation();
    if (contractCreated) {
      final Optional<Address> addr = transactionWithMetadata.getTransaction().contractAddress();

      if (addr.isPresent()) {
        final BlockchainQueries query = getBlockchainQueries(environment);
        final Optional<Long> txBlockNumber = transactionWithMetadata.getBlockNumber();
        final Optional<Long> bn = Optional.ofNullable(environment.getArgument("block"));
        if (txBlockNumber.isEmpty() && bn.isEmpty()) {
          return Optional.empty();
        }
        final long blockNumber = bn.orElseGet(txBlockNumber::get);
        return query
            .getAndMapWorldState(
                blockNumber, ws -> Optional.of(new AccountAdapter(ws.get(addr.get()))))
            .or(() -> Optional.of(new EmptyAccountAdapter(addr.get())));
      }
    }
    return Optional.empty();
  }
Retrieves the contract created by the transaction.

<p>This method checks if the transaction is a contract creation transaction. If it is, it
retrieves the address of the created contract. It then uses the BlockchainQueries to get the
block number and then retrieves the state of the created contract's account at the given block
number.

@param environment the data fetching environment.
@return an Optional containing an AccountAdapter object representing the created contract's
    account state at the given block number, or an empty Optional if the transaction is not a
    contract creation transaction or if the block number is not specified.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/TransactionAdapter.java