diff --git a/.gas-snapshot b/.gas-snapshot index b897c34..2797737 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -11,21 +11,21 @@ IETest:testCommandSendUSDCRawAddr() (gas: 91711) IETest:testCommandSendUSDCRawAddr100Percent() (gas: 96641) IETest:testCommandSendUSDCRawAddr50Percent() (gas: 120480) IETest:testCommandStakeETH() (gas: 146542) -IETest:testCommandSwapDAI() (gas: 138432) -IETest:testCommandSwapDAI100Percent() (gas: 112072) -IETest:testCommandSwapDAI50Percent() (gas: 135673) -IETest:testCommandSwapDAIExactOut() (gas: 156959) -IETest:testCommandSwapDAIExactOutSendETH() (gas: 201660) -IETest:testCommandSwapDAIExactOutSendWETH() (gas: 200223) -IETest:testCommandSwapDAIMinOut() (gas: 159001) -IETest:testCommandSwapDAIMinOutAll() (gas: 8752473) -IETest:testCommandSwapDAIMinOutPercentage() (gas: 8754516) +IETest:testCommandSwapDAI() (gas: 138428) +IETest:testCommandSwapDAI100Percent() (gas: 111086) +IETest:testCommandSwapDAI50Percent() (gas: 134687) +IETest:testCommandSwapDAIExactOut() (gas: 186949) +IETest:testCommandSwapDAIExactOutSendETH() (gas: 231650) +IETest:testCommandSwapDAIExactOutSendWETH() (gas: 230213) +IETest:testCommandSwapDAIMinOut() (gas: 189245) +IETest:testCommandSwapDAIMinOutAll() (gas: 8776536) +IETest:testCommandSwapDAIMinOutPercentage() (gas: 8778579) IETest:testCommandSwapDAIPercentageExactOutSendUSDC() (gas: 205130) -IETest:testCommandSwapETH() (gas: 183436) -IETest:testCommandSwapForETH() (gas: 145397) -IETest:testCommandSwapUSDC() (gas: 168078) -IETest:testCommandSwapUSDC50Percent() (gas: 153270) -IETest:testCommandSwapUSDCForWBTC() (gas: 192279) +IETest:testCommandSwapETH() (gas: 153316) +IETest:testCommandSwapForETH() (gas: 145393) +IETest:testCommandSwapUSDC() (gas: 168100) +IETest:testCommandSwapUSDC50Percent() (gas: 153292) +IETest:testCommandSwapUSDCForWBTC() (gas: 192271) IETest:testDeploy() (gas: 3930291) IETest:testFailCommandSendETHRawAddr1000Percent() (gas: 66948) IETest:testPreviewCommandSendDecimals() (gas: 121016) diff --git a/src/IE.sol b/src/IE.sol index 1dc8cf2..52aa234 100644 --- a/src/IE.sol +++ b/src/IE.sol @@ -10,7 +10,7 @@ import {MetadataReaderLib} from "../lib/solady/src/utils/MetadataReaderLib.sol"; /// @dev V1 simulates typical commands (sending and swapping tokens) and includes execution. /// IE also has a workflow to verify the intent of ERC4337 account userOps against calldata. /// @author nani.eth (https://github.com/NaniDAO/ie) -/// @custom:version 2.0.0 +/// @custom:version 1.5.0 contract IE { /// ======================= LIBRARY USAGE ======================= /// @@ -1011,7 +1011,7 @@ contract IE { function _toAsciiString(address x) internal pure virtual returns (string memory) { unchecked { bytes memory s = new bytes(40); - for (uint256 i; i < 20; ++i) { + for (uint256 i; i != 20; ++i) { bytes1 b = bytes1(uint8(uint256(uint160(x)) / (2 ** (8 * (19 - i))))); bytes1 hi = bytes1(uint8(b) / 16); bytes1 lo = bytes1(uint8(b) - 16 * uint8(hi));