private long cost(
      final Address to,
      final boolean hasValue,
      final Account recipient,
      final boolean accountIsWarm) {
    long cost = 0;
    if (hasValue) {
      cost = gasCalculator().callValueTransferGasCost();
    }
    if (accountIsWarm || gasCalculator().isPrecompile(to)) {
      return clampedAdd(cost, gasCalculator().getWarmStorageReadCost());
    }

    cost = clampedAdd(cost, gasCalculator().getColdAccountAccessCost());

    if (recipient == null && hasValue) {
      cost = clampedAdd(cost, gasCalculator().newAccountGasCost());
    }

    return cost;
  }
Instantiates a new Abstract operation.

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