Skip to content

Commit a56280f

Browse files
authored
Merge pull request #40 from lidofinance/fix/frt-cap
Force FRT < RR
2 parents 4c459d0 + da8e210 commit a56280f

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

script/HarnessCore.s.sol

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,11 @@ contract HarnessCore is Script {
168168
return (true, abi.decode(ret, (address)));
169169
}
170170

171-
function _arr6(
172-
string memory a,
173-
string memory b,
174-
string memory c,
175-
string memory d,
176-
string memory e,
177-
string memory f
178-
) private pure returns (string[] memory r) {
171+
function _arr6(string memory a, string memory b, string memory c, string memory d, string memory e, string memory f)
172+
private
173+
pure
174+
returns (string[] memory r)
175+
{
179176
r = new string[](6);
180177
r[0] = a;
181178
r[1] = b;

src/StvStETHPool.sol

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -488,25 +488,29 @@ contract StvStETHPool is StvPool {
488488
IVaultHub.VaultConnection memory connection = DASHBOARD.vaultConnection();
489489

490490
uint256 maxReserveRatioBP = TOTAL_BASIS_POINTS - 1;
491+
uint256 maxForcedRebalanceThresholdBP = maxReserveRatioBP - 1;
491492

492493
/// Invariants from the OperatorGrid
493494
assert(connection.reserveRatioBP > 0);
494495
assert(connection.reserveRatioBP <= maxReserveRatioBP);
495496
assert(connection.forcedRebalanceThresholdBP > 0);
496-
assert(connection.forcedRebalanceThresholdBP <= connection.reserveRatioBP);
497+
assert(connection.forcedRebalanceThresholdBP < connection.reserveRatioBP);
497498

498499
uint16 newReserveRatioBP = uint16(Math.min(connection.reserveRatioBP + RESERVE_RATIO_GAP_BP, maxReserveRatioBP));
499-
uint16 newThresholdBP =
500-
uint16(Math.min(connection.forcedRebalanceThresholdBP + RESERVE_RATIO_GAP_BP, maxReserveRatioBP));
500+
uint16 newForcedRebalanceThresholdBP = uint16(
501+
Math.min(connection.forcedRebalanceThresholdBP + RESERVE_RATIO_GAP_BP, maxForcedRebalanceThresholdBP)
502+
);
501503

502504
StvStETHPoolStorage storage $ = _getStvStETHPoolStorage();
503505

504-
if (newReserveRatioBP == $.reserveRatioBP && newThresholdBP == $.forcedRebalanceThresholdBP) return;
506+
if (newReserveRatioBP == $.reserveRatioBP && newForcedRebalanceThresholdBP == $.forcedRebalanceThresholdBP) {
507+
return;
508+
}
505509

506510
$.reserveRatioBP = newReserveRatioBP;
507-
$.forcedRebalanceThresholdBP = newThresholdBP;
511+
$.forcedRebalanceThresholdBP = newForcedRebalanceThresholdBP;
508512

509-
emit VaultParametersUpdated(newReserveRatioBP, newThresholdBP);
513+
emit VaultParametersUpdated(newReserveRatioBP, newForcedRebalanceThresholdBP);
510514
}
511515

512516
// =================================================================================

src/interfaces/ggv/IBoringOnChainQueue.sol

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,9 @@ interface IBoringOnChainQueue {
5757
uint96 minimumShares
5858
) external;
5959

60-
function requestOnChainWithdraw(
61-
address assetOut,
62-
uint128 amountOfShares,
63-
uint16 discount,
64-
uint24 secondsToDeadline
65-
) external returns (bytes32 requestId);
60+
function requestOnChainWithdraw(address assetOut, uint128 amountOfShares, uint16 discount, uint24 secondsToDeadline)
61+
external
62+
returns (bytes32 requestId);
6663
function cancelOnChainWithdraw(OnChainWithdraw memory request) external returns (bytes32 requestId);
6764
function replaceOnChainWithdraw(OnChainWithdraw memory oldRequest, uint16 discount, uint24 secondsToDeadline)
6865
external

0 commit comments

Comments
 (0)