@@ -25,22 +25,22 @@ import { SafeCast } from "@openzeppelin/contracts/utils/SafeCast.sol";
2525import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol " ;
2626import { SignedSafeMath } from "@openzeppelin/contracts/math/SignedSafeMath.sol " ;
2727
28- import { IController } from "../../interfaces/IController.sol " ;
29- import { IIntegrationRegistry } from "../../interfaces/IIntegrationRegistry.sol " ;
30- import { Invoke } from "../lib/Invoke.sol " ;
31- import { ISetToken } from "../../interfaces/ISetToken.sol " ;
32- import { IAmmAdapter } from "../../interfaces/IAmmAdapter.sol " ;
33- import { ModuleBase } from "../lib/ModuleBase.sol " ;
34- import { Position } from "../lib/Position.sol " ;
35- import { PreciseUnitMath } from "../../lib/PreciseUnitMath.sol " ;
28+ import { IController } from "../../../ interfaces/IController.sol " ;
29+ import { IIntegrationRegistry } from "../../../ interfaces/IIntegrationRegistry.sol " ;
30+ import { Invoke } from "../../ lib/Invoke.sol " ;
31+ import { ISetToken } from "../../../ interfaces/ISetToken.sol " ;
32+ import { IAmmAdapter } from "../../../ interfaces/IAmmAdapter.sol " ;
33+ import { ModuleBase } from "../../ lib/ModuleBase.sol " ;
34+ import { Position } from "../../ lib/Position.sol " ;
35+ import { PreciseUnitMath } from "../../../ lib/PreciseUnitMath.sol " ;
3636
3737
3838/**
3939 * @title AmmModule
4040 * @author Set Protocol
4141 *
4242 * A smart contract module that enables joining and exiting of AMM Pools using multiple or a single ERC20s.
43- * Examples of intended protocols include Curve, Uniswap, and Balancer.
43+ * Examples of intended protocols include Curve, Uniswap, and Balancer.
4444 */
4545contract AmmModule is ModuleBase , ReentrancyGuard {
4646 using SafeCast for int256 ;
@@ -61,7 +61,7 @@ contract AmmModule is ModuleBase, ReentrancyGuard {
6161 address [] _components ,
6262 int256 [] _componentBalancesDelta // Change in SetToken component token balances
6363 );
64-
64+
6565 event LiquidityRemoved (
6666 ISetToken indexed _setToken ,
6767 address indexed _ammPool ,
@@ -80,11 +80,11 @@ contract AmmModule is ModuleBase, ReentrancyGuard {
8080 address liquidityToken; // Address of the AMM pool token
8181 uint256 preActionLiquidityTokenBalance; // Balance of liquidity token before add/remove liquidity action
8282 uint256 [] preActionComponentBalances; // Balance of components before add/remove liquidity action
83- uint256 liquidityQuantity; // When adding liquidity, minimum quantity of liquidity required.
83+ uint256 liquidityQuantity; // When adding liquidity, minimum quantity of liquidity required.
8484 // When removing liquidity, quantity to dispose of
8585 uint256 [] totalNotionalComponents; // When adding liquidity, maximum components provided
8686 // When removing liquidity, minimum components to receive
87- uint256 [] componentUnits; // List of inputted component real units
87+ uint256 [] componentUnits; // List of inputted component real units
8888 address [] components; // List of component addresses for providing/removing liquidity
8989 }
9090
@@ -138,11 +138,11 @@ contract AmmModule is ModuleBase, ReentrancyGuard {
138138
139139 emit LiquidityAdded (_setToken, _ammPool, liquidityTokenDelta, _components, componentsDelta);
140140 }
141-
141+
142142 /**
143- * SET MANAGER ONLY. Adds liquidity to an AMM pool for a specified AMM using a single asset if supported.
143+ * SET MANAGER ONLY. Adds liquidity to an AMM pool for a specified AMM using a single asset if supported.
144144 * Differs from addLiquidity as it will opt to use the AMMs single asset liquidity function if it exists
145- * User specifies what component and component quantity to contribute and the minimum number of
145+ * User specifies what component and component quantity to contribute and the minimum number of
146146 * liquidity pool tokens to receive.
147147 *
148148 * @param _setToken Address of SetToken
@@ -193,7 +193,7 @@ contract AmmModule is ModuleBase, ReentrancyGuard {
193193 }
194194
195195 /**
196- * SET MANAGER ONLY. Removes liquidity from an AMM pool for a specified AMM. User specifies the exact number of
196+ * SET MANAGER ONLY. Removes liquidity from an AMM pool for a specified AMM. User specifies the exact number of
197197 * liquidity pool tokens to provide and the components and minimum quantity of component units to receive
198198 *
199199 * @param _setToken Address of SetToken
@@ -240,7 +240,7 @@ contract AmmModule is ModuleBase, ReentrancyGuard {
240240 liquidityTokenDelta,
241241 _components,
242242 componentsDelta
243- );
243+ );
244244 }
245245
246246 /**
@@ -262,7 +262,7 @@ contract AmmModule is ModuleBase, ReentrancyGuard {
262262 uint256 _poolTokenPositionUnits ,
263263 address _component ,
264264 uint256 _minComponentUnitsReceived
265- )
265+ )
266266 external
267267 nonReentrant
268268 onlyManagerAndValidSet (_setToken)
@@ -339,14 +339,14 @@ contract AmmModule is ModuleBase, ReentrancyGuard {
339339 actionInfo.preActionComponentBalances = _getTokenBalances (address (_setToken), _components);
340340
341341 actionInfo.liquidityQuantity = actionInfo.totalSupply.getDefaultTotalNotional (_poolTokenInPositionUnit);
342-
342+
343343 actionInfo.totalNotionalComponents = _getTotalNotionalComponents (_setToken, _componentUnits);
344344
345345 actionInfo.componentUnits = _componentUnits;
346-
347- actionInfo.components = _components;
348346
349- return actionInfo;
347+ actionInfo.components = _components;
348+
349+ return actionInfo;
350350 }
351351
352352 function _getActionInfoSingleAsset (
@@ -426,7 +426,7 @@ contract AmmModule is ModuleBase, ReentrancyGuard {
426426 );
427427 }
428428 }
429-
429+
430430 function _executeAddLiquidity (ActionInfo memory _actionInfo ) internal {
431431 (
432432 address targetAmm , uint256 callValue , bytes memory methodData
@@ -456,9 +456,9 @@ contract AmmModule is ModuleBase, ReentrancyGuard {
456456
457457 _executeComponentApprovals (_actionInfo);
458458
459- _actionInfo.setToken.invoke (targetAmm, callValue, methodData);
459+ _actionInfo.setToken.invoke (targetAmm, callValue, methodData);
460460 }
461-
461+
462462 function _executeRemoveLiquidity (ActionInfo memory _actionInfo ) internal {
463463 (
464464 address targetAmm , uint256 callValue , bytes memory methodData
@@ -476,7 +476,7 @@ contract AmmModule is ModuleBase, ReentrancyGuard {
476476 _actionInfo.liquidityQuantity
477477 );
478478
479- _actionInfo.setToken.invoke (targetAmm, callValue, methodData);
479+ _actionInfo.setToken.invoke (targetAmm, callValue, methodData);
480480 }
481481
482482 function _executeRemoveLiquiditySingleAsset (ActionInfo memory _actionInfo ) internal {
@@ -496,9 +496,9 @@ contract AmmModule is ModuleBase, ReentrancyGuard {
496496 _actionInfo.liquidityQuantity
497497 );
498498
499- _actionInfo.setToken.invoke (targetAmm, callValue, methodData);
499+ _actionInfo.setToken.invoke (targetAmm, callValue, methodData);
500500 }
501-
501+
502502 function _validateMinimumLiquidityReceived (ActionInfo memory _actionInfo ) internal view {
503503 uint256 liquidityTokenBalance = IERC20 (_actionInfo.liquidityToken).balanceOf (address (_actionInfo.setToken));
504504
0 commit comments