Skip to content

Commit

Permalink
~~
Browse files Browse the repository at this point in the history
  • Loading branch information
z0r0z committed Feb 21, 2024
1 parent a8069ab commit 3b321d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ IETest:testCommandStakeETH() (gas: 494075)
IETest:testCommandSwapDAI() (gas: 161004)
IETest:testCommandSwapETH() (gas: 196406)
IETest:testCommandSwapForETH() (gas: 164341)
IETest:testCommandSwapUSDC() (gas: 204379)
IETest:testCommandSwapUSDCForWBTC() (gas: 205938)
IETest:testCommandSwapUSDC() (gas: 204376)
IETest:testCommandSwapUSDCForWBTC() (gas: 205946)
IETest:testCommandUnstakeETH() (gas: 322665)
IETest:testCommandWithdrawETH() (gas: 325175)
IETest:testDeploy() (gas: 2882906)
IETest:testDeploy() (gas: 2892134)
IETest:testENSNameOwnership() (gas: 45255)
IETest:testIENameSetting() (gas: 8208)
IETest:testPreviewCommandSendDecimals() (gas: 102437)
Expand Down
5 changes: 2 additions & 3 deletions src/IE.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ contract IE {

/// ====================== COMMAND PREVIEW ====================== ///

/// @notice Preview natural language smart contract command.
/// @dev Preview natural language smart contract command.
/// The `send` syntax uses ENS naming: 'send vitalik 20 DAI'.
/// `swap` syntax uses common format: 'swap 100 DAI for WETH'.
function previewCommand(string calldata intent)
Expand Down Expand Up @@ -366,7 +366,6 @@ contract IE {
if (amount0Delta <= 0 && amount1Delta <= 0) revert InvalidSwap();
(address pool, bool zeroForOne) = _computePoolAddress(tokenIn, tokenOut);
assembly ("memory-safe") {
// Only pair pool can call.
if iszero(eq(caller(), pool)) { revert(codesize(), 0x00) }
}
if (ETHIn) {
Expand Down Expand Up @@ -708,7 +707,7 @@ contract IE {
function _hexStringToAddress(string memory s) internal pure virtual returns (bytes memory r) {
unchecked {
bytes memory ss = bytes(s);
require(ss.length % 2 == 0); // Length must be even.
if (ss.length % 2 != 0) revert InvalidSyntax(); // Length must be even.
r = new bytes(ss.length / 2);
for (uint256 i; i != ss.length / 2; ++i) {
r[i] =
Expand Down

0 comments on commit 3b321d2

Please sign in to comment.