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

    final long cost = gasCalculator().dataCopyOperationGasCost(frame, memOffset, numBytes);
    if (frame.getRemainingGas() < cost) {
      return new OperationResult(cost, ExceptionalHaltReason.INSUFFICIENT_GAS);
    }

    final Code code = frame.getCode();

    frame.writeMemory(memOffset, sourceOffset, numBytes, code.getBytes(), true);

    return new OperationResult(cost, null);
  }
Instantiates a new Code copy operation.

@param gasCalculator the gas calculator
evm/src/main/java/org/hyperledger/besu/evm/operation/CodeCopyOperation.java