@Override
  public OperationResult execute(final MessageFrame frame, final EVM evm) {
    final Address address = Words.toAddress(frame.popStackItem());
    final long memOffset = clampedToLong(frame.popStackItem());
    final long sourceOffset = clampedToLong(frame.popStackItem());
    final long numBytes = clampedToLong(frame.popStackItem());

    final boolean accountIsWarm =
        frame.warmUpAddress(address) || gasCalculator().isPrecompile(address);
    final long cost = cost(frame, memOffset, numBytes, accountIsWarm);

    if (frame.getRemainingGas() < cost) {
      return new OperationResult(cost, ExceptionalHaltReason.INSUFFICIENT_GAS);
    }

    final Account account = frame.getWorldUpdater().get(address);
    final Bytes code = account != null ? account.getCode() : Bytes.EMPTY;

    if (enableEIP3540
        && code.size() >= 2
        && code.get(0) == EOFLayout.EOF_PREFIX_BYTE
        && code.get(1) == 0) {
      frame.writeMemory(memOffset, sourceOffset, numBytes, EOF_REPLACEMENT_CODE);
    } else {
      frame.writeMemory(memOffset, sourceOffset, numBytes, code);
    }

    return new OperationResult(cost, null);
  }
Cost of Ext Code Copy operation.

@param frame the frame
@param memOffset the mem offset
@param length the length
@param accountIsWarm the account is warm
@return the long
evm/src/main/java/org/hyperledger/besu/evm/operation/ExtCodeCopyOperation.java