Skip to content

Commit

Permalink
chore: forge fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
bingen committed Oct 14, 2024
1 parent 0de0196 commit e69a8d9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
6 changes: 5 additions & 1 deletion contracts/src/TroveManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,11 @@ contract TroveManager is LiquityBase, ITroveManager, ITroveEvents {
// at a average annual debt increase (compounded interest + fees) of 10%, it would take more than 217 years (log(1e9)/log(1.1))
// at a average annual debt increase (compounded interest + fees) of 50%, it would take more than 51 years (log(1e9)/log(1.5))
// When that happens, no more debt can be manually added to the batch, so batch should be migrated to a new one
function _requireBelowMaxSharesRatio(uint256 _currentBatchDebtShares, uint256 _batchDebt, bool _checkBatchSharesRatio) internal pure {
function _requireBelowMaxSharesRatio(
uint256 _currentBatchDebtShares,
uint256 _batchDebt,
bool _checkBatchSharesRatio
) internal pure {
// debt / shares should be below MAX_BATCH_SHARES_RATIO
if (_currentBatchDebtShares * MAX_BATCH_SHARES_RATIO < _batchDebt && _checkBatchSharesRatio) {
revert BatchSharesRatioTooHigh();
Expand Down
10 changes: 6 additions & 4 deletions contracts/src/Zappers/LeftoversSweep.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ contract LeftoversSweep {
_setInitialBalancesAndReceiver(_collToken, _boldToken, _initialBalances, msg.sender);
}

function _setInitialBalancesAndReceiver(IERC20 _collToken, IBoldToken _boldToken, InitialBalances memory _initialBalances, address _receiver)
internal
view
{
function _setInitialBalancesAndReceiver(
IERC20 _collToken,
IBoldToken _boldToken,
InitialBalances memory _initialBalances,
address _receiver
) internal view {
_initialBalances.boldBalance = _boldToken.balanceOf(address(this));
_initialBalances.collBalance = _collToken.balanceOf(address(this));
_initialBalances.receiver = _receiver;
Expand Down
18 changes: 7 additions & 11 deletions contracts/src/test/zapperLeverage.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1144,8 +1144,7 @@ contract ZapperLeverageMainnet is DevTestSetup {
internal
{
// This should be done in the frontend
uint256 flashLoanAmount =
_getCloseFlashLoanAmount(_troveId, _troveManager, _priceFeed);
uint256 flashLoanAmount = _getCloseFlashLoanAmount(_troveId, _troveManager, _priceFeed);

IZapper.CloseTroveParams memory closeParams = IZapper.CloseTroveParams({
troveId: _troveId,
Expand Down Expand Up @@ -1286,9 +1285,8 @@ contract ZapperLeverageMainnet is DevTestSetup {
uint256 troveId = openTrove(_zapper, A, collAmount, boldAmount, lst);

// B tries to close A’s trove
uint256 flashLoanAmount = _getCloseFlashLoanAmount(
troveId, contractsArray[_branch].troveManager, contractsArray[_branch].priceFeed
);
uint256 flashLoanAmount =
_getCloseFlashLoanAmount(troveId, contractsArray[_branch].troveManager, contractsArray[_branch].priceFeed);

IZapper.CloseTroveParams memory closeParams = IZapper.CloseTroveParams({
troveId: troveId,
Expand Down Expand Up @@ -1331,9 +1329,8 @@ contract ZapperLeverageMainnet is DevTestSetup {
uint256 troveId = openTrove(_zapper, A, collAmount, boldAmount, lst);

// B tries to close A’s trove calling our flash loan provider module
uint256 flashLoanAmount = _getCloseFlashLoanAmount(
troveId, contractsArray[_branch].troveManager, contractsArray[_branch].priceFeed
);
uint256 flashLoanAmount =
_getCloseFlashLoanAmount(troveId, contractsArray[_branch].troveManager, contractsArray[_branch].priceFeed);

IZapper.CloseTroveParams memory closeParams = IZapper.CloseTroveParams({
troveId: troveId,
Expand Down Expand Up @@ -1382,9 +1379,8 @@ contract ZapperLeverageMainnet is DevTestSetup {
uint256 troveId = openTrove(_zapper, A, collAmount, boldAmount, lst);

// B tries to close A’s trove calling Balancer Vault directly
uint256 flashLoanAmount = _getCloseFlashLoanAmount(
troveId, contractsArray[_branch].troveManager, contractsArray[_branch].priceFeed
);
uint256 flashLoanAmount =
_getCloseFlashLoanAmount(troveId, contractsArray[_branch].troveManager, contractsArray[_branch].priceFeed);

IZapper.CloseTroveParams memory closeParams = IZapper.CloseTroveParams({
troveId: troveId,
Expand Down

0 comments on commit e69a8d9

Please sign in to comment.