@Override
  public void run() {
    LogConfigurator.setLevel("", "OFF");
    try {
      GenesisFileModule genesisFileModule;
      if (network != null) {
        genesisFileModule = GenesisFileModule.createGenesisModule(network);
      } else if (genesisFile != null) {
        genesisFileModule = GenesisFileModule.createGenesisModule(genesisFile);
      } else {
        genesisFileModule = GenesisFileModule.createGenesisModule();
      }
      final EvmToolComponent component =
          DaggerEvmToolComponent.builder()
              .dataStoreModule(new DataStoreModule())
              .genesisFileModule(genesisFileModule)
              .evmToolCommandOptionsModule(daggerOptions)
              .metricsSystemModule(new MetricsSystemModule())
              .build();

      int remainingIters = this.repeat;
      final ProtocolSpec protocolSpec = component.getProtocolSpec();
      final Transaction tx =
          new Transaction.Builder()
              .nonce(0)
              .gasPrice(Wei.ZERO)
              .gasLimit(Long.MAX_VALUE)
              .to(createTransaction ? null : receiver)
              .value(Wei.ZERO)
              .payload(callData)
              .sender(sender)
              .build();

      long txGas = gas;
      if (chargeIntrinsicGas) {
        final long accessListCost =
            tx.getAccessList()
                .map(list -> protocolSpec.getGasCalculator().accessListGasCost(list))
                .orElse(0L);

        final long delegateCodeCost =
            protocolSpec.getGasCalculator().delegateCodeGasCost(tx.codeDelegationListSize());

        final long intrinsicGasCost =
            protocolSpec
                .getGasCalculator()
                .transactionIntrinsicGasCost(tx, accessListCost + delegateCodeCost);
        txGas -= intrinsicGasCost;
      }

      final EVM evm = protocolSpec.getEvm();
      if (codeBytes.isEmpty() && !createTransaction) {
        codeBytes = component.getWorldState().get(receiver).getCode();
      }
      Code code =
          createTransaction ? evm.getCodeForCreation(codeBytes) : evm.getCodeUncached(codeBytes);
      if (!code.isValid()) {
        out.println(((CodeInvalid) code).getInvalidReason());
        return;
      } else if (code.getEofVersion() == 1
          && createTransaction
              != INITCODE.equals(((CodeV1) code).getEofLayout().containerMode().get())) {
        out.println(
            createTransaction
                ? "--create requires EOF in INITCODE mode"
                : "To evaluate INITCODE mode EOF code use the --create flag");
        return;
      }

      final Stopwatch stopwatch = Stopwatch.createUnstarted();
      long lastTime = 0;
      do {
        final boolean lastLoop = remainingIters == 0;

        final OperationTracer tracer = // You should have picked Mercy.
            lastLoop && showJsonResults
                ? new StandardJsonTracer(
                    out, showMemory, !hideStack, showReturnData, showStorage, eip3155strict)
                : OperationTracer.NO_TRACING;

        WorldUpdater updater = component.getWorldUpdater();
        updater.getOrCreate(sender);
        if (!createTransaction) {
          updater.getOrCreate(receiver);
        }
        var contractAccount = updater.getOrCreate(contract);
        contractAccount.setCode(codeBytes);

        final Set<Address> addressList = new BytesTrieSet<>(Address.SIZE);
        addressList.add(sender);
        addressList.add(contract);
        if (EvmSpecVersion.SHANGHAI.compareTo(evm.getEvmVersion()) <= 0) {
          addressList.add(coinbase);
        }
        final BlockHeader blockHeader =
            BlockHeaderBuilder.create()
                .parentHash(Hash.EMPTY)
                .coinbase(coinbase)
                .difficulty(
                    Difficulty.fromHexString(
                        genesisFileModule.providesGenesisConfig().getDifficulty()))
                .number(0)
                .gasLimit(genesisFileModule.providesGenesisConfig().getGasLimit())
                .timestamp(0)
                .ommersHash(Hash.EMPTY_LIST_HASH)
                .stateRoot(Hash.EMPTY_TRIE_HASH)
                .transactionsRoot(Hash.EMPTY)
                .receiptsRoot(Hash.EMPTY)
                .logsBloom(LogsBloomFilter.empty())
                .gasUsed(0)
                .extraData(Bytes.EMPTY)
                .mixHash(Hash.ZERO)
                .nonce(0)
                .blockHeaderFunctions(new MainnetBlockHeaderFunctions())
                .baseFee(
                    component
                        .getBlockchain()
                        .getChainHeadHeader()
                        .getBaseFee()
                        .or(() -> genesisFileModule.providesGenesisConfig().getBaseFeePerGas())
                        .orElse(
                            protocolSpec.getFeeMarket().implementsBaseFee() ? Wei.of(0xa) : null))
                .buildBlockHeader();

        Address contractAddress =
            createTransaction ? Address.contractAddress(receiver, 0) : receiver;
        MessageFrame initialMessageFrame =
            MessageFrame.builder()
                .type(
                    createTransaction
                        ? MessageFrame.Type.CONTRACT_CREATION
                        : MessageFrame.Type.MESSAGE_CALL)
                .worldUpdater(updater.updater())
                .initialGas(txGas)
                .contract(contractAddress)
                .address(contractAddress)
                .originator(sender)
                .sender(sender)
                .gasPrice(gasPriceGWei)
                .blobGasPrice(blobGasPrice)
                .inputData(createTransaction ? codeBytes.slice(code.getSize()) : callData)
                .value(ethValue)
                .apparentValue(ethValue)
                .code(code)
                .blockValues(blockHeader)
                .completer(c -> {})
                .miningBeneficiary(blockHeader.getCoinbase())
                .blockHashLookup(
                    protocolSpec
                        .getBlockHashProcessor()
                        .createBlockHashLookup(component.getBlockchain(), blockHeader))
                .accessListWarmAddresses(addressList)
                .build();
        Deque<MessageFrame> messageFrameStack = initialMessageFrame.getMessageFrameStack();

        stopwatch.start();
        while (!messageFrameStack.isEmpty()) {
          final MessageFrame messageFrame = messageFrameStack.peek();
          protocolSpec.getTransactionProcessor().process(messageFrame, tracer);
          if (messageFrameStack.isEmpty()) {
            stopwatch.stop();
            if (lastTime == 0) {
              lastTime = stopwatch.elapsed().toNanos();
            }
            if (lastLoop) {
              messageFrame
                  .getExceptionalHaltReason()
                  .ifPresent(haltReason -> out.println(haltReason));
              messageFrame.getRevertReason().ifPresent(bytes -> out.println(bytes.toHexString()));
            }
          }
        }
        lastTime = stopwatch.elapsed().toNanos();
        stopwatch.reset();
        if (lastLoop) {
          initialMessageFrame.getSelfDestructs().forEach(updater::deleteAccount);
          updater.clearAccountsThatAreEmpty();
          updater.commit();
          MutableWorldState worldState = component.getWorldState();
          final long evmGas = txGas - initialMessageFrame.getRemainingGas();
          final JsonObject resultLine = new JsonObject();
          resultLine
              .put("stateRoot", worldState.rootHash().toHexString())
              .put("output", initialMessageFrame.getOutputData().toHexString())
              .put("gasUsed", "0x" + Long.toHexString(evmGas))
              .put("pass", initialMessageFrame.getExceptionalHaltReason().isEmpty())
              .put("fork", protocolSpec.getName());
          if (!noTime) {
            resultLine.put("timens", lastTime).put("time", lastTime / 1000);
          }
          out.println(resultLine);

          if (showJsonAlloc) {
            dumpWorldState(worldState, out);
          }
        }
      } while (remainingIters-- > 0);

    } catch (final IOException e) {
      System.err.println("Unable to create Genesis module");
      e.printStackTrace(System.out);
    }
  }
Checks if a fork is provided in the Dagger options.

@return True if a fork is provided, false otherwise.
ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java