@Override
  public long calculateGasRefund(
      final Transaction transaction,
      final MessageFrame initialFrame,
      final long codeDelegationRefund) {

    final long refundAllowance =
        calculateRefundAllowance(transaction, initialFrame, codeDelegationRefund);

    final long executionGasUsed =
        transaction.getGasLimit() - initialFrame.getRemainingGas() - refundAllowance;
    final long transactionFloorCost =
        transactionFloorCost(transaction.getPayload(), transaction.getPayloadZeroBytes());
    final long totalGasUsed = Math.max(executionGasUsed, transactionFloorCost);
    return transaction.getGasLimit() - totalGasUsed;
  }
Instantiates a new Prague Gas Calculator

@param maxPrecompile the max precompile
evm/src/main/java/org/hyperledger/besu/evm/gascalculator/PragueGasCalculator.java