Skip to content

Commit

Permalink
🥢 ~~
Browse files Browse the repository at this point in the history
  • Loading branch information
z0r0z committed Feb 13, 2024
1 parent c74f4bb commit bff556d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ IETest:testBalanceInETH() (gas: 53716)
IETest:testCommandSendERC0() (gas: 114314)
IETest:testCommandSendETH() (gas: 80786)
IETest:testCommandSendUSDC() (gas: 147022)
IETest:testCommandSwapDAI() (gas: 101173)
IETest:testCommandSwapUSDC() (gas: 157166)
IETest:testDeploy() (gas: 2154372)
IETest:testCommandSwapDAI() (gas: 101117)
IETest:testCommandSwapUSDC() (gas: 157110)
IETest:testDeploy() (gas: 2148156)
IETest:testENSNameFromENSHelper() (gas: 29103)
IETest:testENSNameOwnership() (gas: 109286)
IETest:testIENameSetting() (gas: 8187)
Expand Down
12 changes: 4 additions & 8 deletions src/IE.sol
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ contract IE {
/// @dev Fallback `uniswapV3SwapCallback`.
/// If ETH is swapped, WETH is forwarded.
fallback() external {
int256 amount0Delta;
int256 amount1Delta;
uint256 amount0Delta;
uint256 amount1Delta;
bool isETH;
address payer;
address tokenIn;
Expand All @@ -314,12 +314,8 @@ contract IE {
(address pool, bool zeroForOne) = _computePoolAddress(tokenIn, tokenOut, 3000);
if (msg.sender != pool) revert Unauthorized();
isETH
? WETH.safeTransfer(
msg.sender, SafeCastLib.toUint256(zeroForOne ? amount0Delta : amount1Delta)
)
: tokenIn.safeTransferFrom(
payer, msg.sender, SafeCastLib.toUint256(zeroForOne ? amount0Delta : amount1Delta)
);
? WETH.safeTransfer(msg.sender, zeroForOne ? amount0Delta : amount1Delta)
: tokenIn.safeTransferFrom(payer, msg.sender, zeroForOne ? amount0Delta : amount1Delta);
}

/// @dev Computes the create2 address for given token pair. Starts mid fee.
Expand Down

0 comments on commit bff556d

Please sign in to comment.