Skip to content

Commit

Permalink
fix: var naming and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
bulbozaur committed Nov 11, 2024
1 parent 4a37dae commit 21f51b8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions contracts/Escrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,12 @@ contract Escrow is IEscrow {
uint256 maxStETHWithdrawalRequestAmount = WITHDRAWAL_QUEUE.MAX_STETH_WITHDRAWAL_AMOUNT();

/// @dev The remaining stETH amount must be greater than the minimum threshold to create a withdrawal request.
uint256 remainingStETHThreshold = Math.max(_MIN_TRANSFERRABLE_ST_ETH_AMOUNT, minStETHWithdrawalRequestAmount);
/// Using only `minStETHWithdrawalRequestAmount` is insufficient because it is an external variable
/// that could be decreased independently. Introducing `minWithdrawableStETHAmount` provides
/// an internal safeguard, enforcing a minimum threshold within the contract.
uint256 minWithdrawableStETHAmount = Math.max(_MIN_TRANSFERRABLE_ST_ETH_AMOUNT, minStETHWithdrawalRequestAmount);

if (stETHRemaining < remainingStETHThreshold) {
if (stETHRemaining < minWithdrawableStETHAmount) {
return _batchesQueue.close();
}

Expand All @@ -364,7 +367,7 @@ contract Escrow is IEscrow {

stETHRemaining = ST_ETH.balanceOf(address(this));

if (stETHRemaining < remainingStETHThreshold) {
if (stETHRemaining < minWithdrawableStETHAmount) {
_batchesQueue.close();
}
}
Expand Down

0 comments on commit 21f51b8

Please sign in to comment.