Skip to content

Commit

Permalink
⚡ Smolr optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
z0r0z committed Feb 12, 2024
1 parent 6c5ade4 commit 76ee7a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ IETest:testBalanceInETH() (gas: 53716)
IETest:testCommandSendERC0() (gas: 114380)
IETest:testCommandSendETH() (gas: 80852)
IETest:testCommandSendUSDC() (gas: 147088)
IETest:testCommandSwapDAI() (gas: 101576)
IETest:testCommandSwapUSDC() (gas: 156929)
IETest:testCommandSwapDAI() (gas: 101508)
IETest:testCommandSwapUSDC() (gas: 156905)
IETest:testDeploy() (gas: 2169813)
IETest:testENSNameFromENSHelper() (gas: 29103)
IETest:testENSNameOwnership() (gas: 109154)
Expand Down
11 changes: 6 additions & 5 deletions src/IE.sol
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@ contract IE {
bytes32 internal constant UNISWAP_V3_POOL_INIT_CODE_HASH =
0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54;

/// @dev The minimum value that can be returned from `getSqrtRatioAtTick`.
uint160 internal constant MIN_SQRT_RATIO = 4295128739;
/// @dev The minimum value that can be returned from `getSqrtRatioAtTick` plus one.
uint160 internal constant MIN_SQRT_RATIO_PLUS_ONE = 4295128740;

/// @dev The maximum value that can be returned from `getSqrtRatioAtTick`.
uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;
/// @dev The maximum value that can be returned from `getSqrtRatioAtTick` minus one.
uint160 internal constant MAX_SQRT_RATIO_MINUS_ONE =
1461446703485210103287273052203988822378723970341;

/// ========================== STORAGE ========================== ///

Expand Down Expand Up @@ -285,7 +286,7 @@ contract IE {
msg.sender,
zeroForOne,
int256(_amountIn),
zeroForOne ? MIN_SQRT_RATIO + 1 : MAX_SQRT_RATIO - 1,
zeroForOne ? MIN_SQRT_RATIO_PLUS_ONE : MAX_SQRT_RATIO_MINUS_ONE,
abi.encode(zeroForOne, _tokenIn, msg.sender)
);
}
Expand Down

0 comments on commit 76ee7a4

Please sign in to comment.