@Override
  public OperationResult execute(final MessageFrame frame, final EVM evm) {
    Code code = frame.getCode();
    if (code.getEofVersion() == 0) {
      return InvalidOperation.INVALID_RESULT;
    }

    final int offset = clampedToInt(frame.popStackItem());
    Bytes returnData = frame.getReturnData();
    int returnDataSize = returnData.size();

    Bytes value;
    if (offset > returnDataSize) {
      value = Bytes.EMPTY;
    } else if (offset + 32 >= returnData.size()) {
      value = Bytes32.rightPad(returnData.slice(offset));
    } else {
      value = returnData.slice(offset, 32);
    }

    frame.pushStackItem(value);
    return new OperationResult(3L, null);
  }
Instantiates a new Return data load operation.

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