From dfec846547cb9576ea5b4fe2282d6431fc5f654d Mon Sep 17 00:00:00 2001 From: JaredBorders Date: Fri, 12 Jan 2024 18:03:17 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Prettify?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Engine.sol | 24 ++++++++++++------------ src/interfaces/IEngine.sol | 15 +++------------ test/Credit.t.sol | 5 +---- 3 files changed, 16 insertions(+), 28 deletions(-) diff --git a/src/Engine.sol b/src/Engine.sol index 60bef4c8..26155f61 100644 --- a/src/Engine.sol +++ b/src/Engine.sol @@ -337,10 +337,10 @@ contract Engine is } /// @inheritdoc IEngine - function modifyCollateralZap( - uint128 _accountId, - int256 _amount - ) external override { + function modifyCollateralZap(uint128 _accountId, int256 _amount) + external + override + { if (_amount > 0) { // zap $USDC -> $sUSD /// @dev given the amount is positive, @@ -489,10 +489,10 @@ contract Engine is } /// @inheritdoc IEngine - function creditAccountZap( - uint128 _accountId, - uint256 _amount - ) external override { + function creditAccountZap(uint128 _accountId, uint256 _amount) + external + override + { // zap $USDC -> $sUSD uint256 usdcAmount = _zapIn(_amount); @@ -514,10 +514,10 @@ contract Engine is } /// @inheritdoc IEngine - function debitAccountZap( - uint128 _accountId, - uint256 _amount - ) external override { + function debitAccountZap(uint128 _accountId, uint256 _amount) + external + override + { if (!isAccountOwner(_accountId, msg.sender)) revert Unauthorized(); // decrement account credit prior to transfer diff --git a/src/interfaces/IEngine.sol b/src/interfaces/IEngine.sol index 0e8e9894..bb204eab 100644 --- a/src/interfaces/IEngine.sol +++ b/src/interfaces/IEngine.sol @@ -231,10 +231,7 @@ interface IEngine { /// @param _accountId the account to modify /// @param _amount the amount of collateral /// to add or remove (negative to remove) - function modifyCollateralZap( - uint128 _accountId, - int256 _amount - ) external; + function modifyCollateralZap(uint128 _accountId, int256 _amount) external; /*////////////////////////////////////////////////////////////// ASYNC ORDER MANAGEMENT @@ -286,10 +283,7 @@ interface IEngine { /// (i.e. ERC-20 decimal discrepancies) /// @param _accountId the id of the account to credit /// @param _amount the amount of $USDC to transfer and zap - function creditAccountZap( - uint128 _accountId, - uint256 _amount - ) external; + function creditAccountZap(uint128 _accountId, uint256 _amount) external; /// @notice withdraw $sUSD from the engine and /// debit the account identified by the accountId @@ -306,10 +300,7 @@ interface IEngine { /// (i.e. ERC-20 decimal discrepancies) /// @param _accountId the id of the account to debit /// @param _amount the amount of $sUSD to debit - function debitAccountZap( - uint128 _accountId, - uint256 _amount - ) external; + function debitAccountZap(uint128 _accountId, uint256 _amount) external; /*////////////////////////////////////////////////////////////// CONDITIONAL ORDER MANAGEMENT diff --git a/test/Credit.t.sol b/test/Credit.t.sol index b84e63e7..83d8af10 100644 --- a/test/Credit.t.sol +++ b/test/Credit.t.sol @@ -190,10 +190,7 @@ contract Debit is CreditTest { vm.prank(BAD_ACTOR); - engine.debitAccountZap({ - _accountId: accountId, - _amount: AMOUNT - }); + engine.debitAccountZap({_accountId: accountId, _amount: AMOUNT}); } function test_debit_Unauthorized() public {