From 1dfa49066e0d5985620745ce2160115d14156be9 Mon Sep 17 00:00:00 2001 From: Raphael Nembhard Date: Fri, 23 Aug 2024 12:54:57 -0400 Subject: [PATCH] formatted --- src/TWAMM.sol | 9 ++++++--- src/mocks/MockERC20.sol | 6 +----- test/TWAMM.t.sol | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/TWAMM.sol b/src/TWAMM.sol index 5dfc7dc..97fd73d 100644 --- a/src/TWAMM.sol +++ b/src/TWAMM.sol @@ -146,11 +146,14 @@ contract TWAMM is BaseHook, ITWAMM { (uint160 sqrtPriceX96,,,) = poolManager.getSlot0(poolId); State storage twamm = twammStates[poolId]; - (bool zeroForOne, uint160 sqrtPriceLimitX96) = - _executeTWAMMOrders(twamm, poolManager, key, PoolParamsOnExecute(sqrtPriceX96, poolManager.getLiquidity(poolId))); + (bool zeroForOne, uint160 sqrtPriceLimitX96) = _executeTWAMMOrders( + twamm, poolManager, key, PoolParamsOnExecute(sqrtPriceX96, poolManager.getLiquidity(poolId)) + ); if (sqrtPriceLimitX96 != 0 && sqrtPriceLimitX96 != sqrtPriceX96) { - poolManager.unlock(abi.encode(key, IPoolManager.SwapParams(zeroForOne, type(int256).max, sqrtPriceLimitX96))); + poolManager.unlock( + abi.encode(key, IPoolManager.SwapParams(zeroForOne, type(int256).max, sqrtPriceLimitX96)) + ); } } diff --git a/src/mocks/MockERC20.sol b/src/mocks/MockERC20.sol index 4dab3db..54661e1 100644 --- a/src/mocks/MockERC20.sol +++ b/src/mocks/MockERC20.sol @@ -4,11 +4,7 @@ pragma solidity >=0.8.0; import {ERC20} from "solmate/src/tokens/ERC20.sol"; contract MockERC20 is ERC20 { - constructor( - string memory _name, - string memory _symbol, - uint8 _decimals - ) ERC20(_name, _symbol, _decimals) {} + constructor(string memory _name, string memory _symbol, uint8 _decimals) ERC20(_name, _symbol, _decimals) {} function mint(address to, uint256 value) public virtual { _mint(to, value); diff --git a/test/TWAMM.t.sol b/test/TWAMM.t.sol index fa1abd4..e7ce67a 100644 --- a/test/TWAMM.t.sol +++ b/test/TWAMM.t.sol @@ -43,7 +43,7 @@ contract TWAMMTest is Test, Deployers, GasSnapshot { uint256 earningsFactorLast ); - // + // TWAMM twamm = TWAMM(address(uint160(Hooks.BEFORE_INITIALIZE_FLAG | Hooks.BEFORE_SWAP_FLAG | Hooks.BEFORE_ADD_LIQUIDITY_FLAG))); address hookAddress; @@ -99,7 +99,7 @@ contract TWAMMTest is Test, Deployers, GasSnapshot { assertEq(twamm.lastVirtualOrderTimestamp(initId), 10000); } - // @note need to figure out what snapStart is. + // @note need to figure out what snapStart is. // When it is comment out it is panicing for an arithmetic underflow or overflow. // function testTWAMM_submitOrder_StoresOrderWithCorrectPoolAndOrderPoolInfo() public { // uint160 expiration = 30000;