@Override
  public OperationResult execute(final MessageFrame frame, final EVM evm) {

    final UInt256 key = UInt256.fromBytes(frame.popStackItem());
    final UInt256 newValue = UInt256.fromBytes(frame.popStackItem());

    final MutableAccount account = frame.getWorldUpdater().getAccount(frame.getRecipientAddress());
    if (account == null) {
      return ILLEGAL_STATE_CHANGE;
    }

    final long remainingGas = frame.getRemainingGas();

    if (frame.isStatic()) {
      return new OperationResult(remainingGas, ExceptionalHaltReason.ILLEGAL_STATE_CHANGE);
    }

    if (remainingGas <= minimumGasRemaining) {
      return new OperationResult(minimumGasRemaining, ExceptionalHaltReason.INSUFFICIENT_GAS);
    }

    final Address address = account.getAddress();
    final boolean slotIsWarm = frame.warmUpStorage(address, key);
    final Supplier<UInt256> currentValueSupplier =
        Suppliers.memoize(() -> account.getStorageValue(key));
    final Supplier<UInt256> originalValueSupplier =
        Suppliers.memoize(() -> account.getOriginalStorageValue(key));

    final long cost =
        gasCalculator().calculateStorageCost(newValue, currentValueSupplier, originalValueSupplier)
            + (slotIsWarm ? 0L : gasCalculator().getColdSloadCost());
    if (remainingGas < cost) {
      return new OperationResult(cost, ExceptionalHaltReason.INSUFFICIENT_GAS);
    }

    // Increment the refund counter.
    frame.incrementGasRefund(
        gasCalculator()
            .calculateStorageRefundAmount(newValue, currentValueSupplier, originalValueSupplier));

    account.setStorageValue(key, newValue);
    frame.storageWasUpdated(key, newValue);
    return new OperationResult(cost, null);
  }
Gets minimum gas remaining.

@return the minimum gas remaining
evm/src/main/java/org/hyperledger/besu/evm/operation/SStoreOperation.java