private @NotNull Code createV1Code(final Bytes bytes, final boolean createTransaction) {
    int codeSize = bytes.size();
    if (codeSize > 0 && bytes.get(0) == EOF_LEAD_BYTE) {
      if (codeSize < 3) {
        return new CodeInvalid(bytes, "EOF Container too short");
      }
      if (bytes.get(1) != 0) {
        if (createTransaction) {
          // because some 0xef code made it to mainnet, this is only an error at contract creation
          // time
          return new CodeInvalid(bytes, "Incorrect second byte");
        } else {
          return new CodeV0(bytes);
        }
      }
      int version = bytes.get(2);
      if (version != 1) {
        return new CodeInvalid(bytes, "Unsupported EOF Version: " + version);
      }

      final EOFLayout layout = EOFLayout.parseEOF(bytes, !createTransaction);
      if (createTransaction) {
        layout.containerMode().set(EOFContainerMode.INITCODE);
      }
      return createCode(layout);
    } else {
      return new CodeV0(bytes);
    }
  }
Create Code.

@param bytes the bytes
@param createTransaction This is in a create transaction, allow dangling data
@return the code
evm/src/main/java/org/hyperledger/besu/evm/code/CodeFactory.java