Skip to content

Commit

Permalink
⌘ Deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
z0r0z committed Jun 4, 2024
1 parent 6ef68a2 commit 035a318
Show file tree
Hide file tree
Showing 12 changed files with 105 additions and 28 deletions.
12 changes: 6 additions & 6 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
IETest:testCommandSendETH() (gas: 77576)
IETest:testCommandSendETHRawAddr() (gas: 75355)
IETest:testCommandStakeETH() (gas: 147244)
IETest:testCommandSwapDAI() (gas: 130115)
IETest:testCommandSwapETH() (gas: 155507)
IETest:testCommandSwapForETH() (gas: 137252)
IETest:testCommandSwapUSDC() (gas: 171791)
IETest:testCommandSwapUSDCForWBTC() (gas: 196722)
IETest:testCommandStakeETH() (gas: 148128)
IETest:testCommandSwapDAI() (gas: 138821)
IETest:testCommandSwapETH() (gas: 185700)
IETest:testCommandSwapForETH() (gas: 145736)
IETest:testCommandSwapUSDC() (gas: 171759)
IETest:testCommandSwapUSDCForWBTC() (gas: 196702)
IETest:testDeploy() (gas: 4059106)
IETest:testENSNameOwnership() (gas: 50762)
IETest:testPreviewBalanceChangeDAI() (gas: 130029)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The **Intents Engine** (`IE`): A Basic *Text-to-tx* Simulator Contract.

### Arbitrum

`V1.2:` [`0x1e00003a669bb466d6B49800000099E1abDD6600`](https://arbiscan.io/address/0x1e00003a669bb466d6b49800000099e1abdd6600#code)
`V1.3:` [`0x1e00002C59149d0057F12e031ecC0000d38A000C`](https://arbiscan.io/address/0x1e00002C59149d0057F12e031ecC0000d38A000C#code)

`Note:` L2 will be used to rapidly prototype a stable and sufficient `IE` for common crypto commands. Many dev resources here will cater to the current L2 prototype until the release of `V2` on L1.

Expand Down Expand Up @@ -72,7 +72,7 @@ aliases: *exchange*

aliases: *exchange*

`Note:` In `V1.2` on Arbitrum, a `minOutputAmount` can be specified for swaps. It ensures that you receive a minimum output amount of `object` at the end of the swap, otherwise the transaction will revert. The default value is set to `0`.
`Note:` In `V1.3` on Arbitrum, a `minOutputAmount` can be specified for swaps. It ensures that you receive a minimum output amount of `object` at the end of the swap, otherwise the transaction will revert. The default value is set to `0`.

------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions docs/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The **Intents Engine** (`IE`): A Basic *Text-to-tx* Simulator Contract.

### Arbitrum

`V1.2:` [`0x1e00003a669bb466d6B49800000099E1abDD6600`](https://arbiscan.io/address/0x1e00003a669bb466d6b49800000099e1abdd6600#code)
`V1.3:` [`0x1e00002C59149d0057F12e031ecC0000d38A000C`](https://arbiscan.io/address/0x1e00002C59149d0057F12e031ecC0000d38A000C#code)

`Note:` L2 will be used to rapidly prototype a stable and sufficient `IE` for common crypto commands. Many dev resources here will cater to the current L2 prototype until the release of `V2` on L1.

Expand Down Expand Up @@ -72,7 +72,7 @@ aliases: *exchange*

aliases: *exchange*

`Note:` In `V1.2` on Arbitrum, a `minOutputAmount` can be specified for swaps. It ensures that you receive a minimum output amount of `object` at the end of the swap, otherwise the transaction will revert. The default value is set to `0`.
`Note:` In `V1.3` on Arbitrum, a `minOutputAmount` can be specified for swaps. It ensures that you receive a minimum output amount of `object` at the end of the swap, otherwise the transaction will revert. The default value is set to `0`.

------------------------------------

Expand Down
88 changes: 79 additions & 9 deletions docs/src/src/IE.sol/contract.IE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IE
[Git Source](https://github.com/NaniDAO/ie/blob/f14d7018eb9d8e0d134c41b44e0923f915c5a573/src/IE.sol)
[Git Source](https://github.com/NaniDAO/ie/blob/6ef68a2b1b107d6bd41812722498a697873f8c87/src/IE.sol)

**Author:**
nani.eth (https://github.com/NaniDAO/ie)
Expand All @@ -22,6 +22,15 @@ address internal constant DAO = 0xDa000000000000d2885F108500803dfBAaB2f2aA;
```


### AKA
*The onchain akashic library.*


```solidity
address internal constant AKA = 0x000000000000394793B2Fe854281CeE09a98bdBC;
```


### NANI
*The NANI token address.*

Expand Down Expand Up @@ -271,7 +280,7 @@ function checkUserOp(string calldata intent, UserOperation calldata userOp)
public
view
virtual
returns (bool);
returns (bool intentMatched);
```

### checkPackedUserOp
Expand All @@ -284,7 +293,7 @@ function checkPackedUserOp(string calldata intent, PackedUserOperation calldata
public
view
virtual
returns (bool);
returns (bool intentMatched);
```

### _returnTokenConstants
Expand Down Expand Up @@ -438,16 +447,42 @@ Only canonical WETH can call.*
receive() external payable virtual;
```

### translate
### read

==================== COMMAND TRANSLATION ==================== ///

*Translates the `intent` for send action from the solution `callData` of a standard `execute()`.
*Returns the akashic library summary digest `about` a given `topic`.*


```solidity
function read(string calldata topic) public view virtual returns (string memory about);
```

### translateCommand

*Translates an `intent` from raw `command()` calldata.*


```solidity
function translateCommand(bytes calldata callData)
public
pure
virtual
returns (string memory intent);
```

### translateExecute

*Translates an `intent` for send action from the solution `callData` of standard `execute()`.
note: The function selector technically doesn't need to be `execute()` but params should match.*


```solidity
function translate(bytes calldata callData) public view virtual returns (string memory intent);
function translateExecute(bytes calldata callData)
public
view
virtual
returns (string memory intent);
```

### translateTokenTransfer
Expand All @@ -466,7 +501,7 @@ function translateTokenTransfer(address token, bytes calldata tokenCalldata)

### translateUserOp

*Translate ERC4337 userOp `callData` into readable send `intent`.*
*Translate ERC4337 userOp `callData` into readable `intent`.*


```solidity
Expand All @@ -479,7 +514,7 @@ function translateUserOp(UserOperation calldata userOp)

### translatePackedUserOp

*Translate packed ERC4337 userOp `callData` into readable send `intent`.*
*Translate packed ERC4337 userOp `callData` into readable `intent`.*


```solidity
Expand All @@ -490,10 +525,23 @@ function translatePackedUserOp(PackedUserOperation calldata userOp)
returns (string memory intent);
```

### whatIsTheBalanceOf
### previewBalanceChange

================== BALANCE & SUPPLY HELPERS ================== ///

*Returns resulting percentage change of ETH or token balance.*


```solidity
function previewBalanceChange(address user, string calldata intent)
public
view
virtual
returns (uint256 percentage);
```

### whatIsTheBalanceOf

*Returns the balance of a named account in a named token.*


Expand Down Expand Up @@ -699,6 +747,28 @@ function _toAsciiString(address x) internal pure virtual returns (string memory)
function _char(bytes1 b) internal pure virtual returns (bytes1 c);
```

### _convertWeiToString

*Convert number to string and insert decimal point.*


```solidity
function _convertWeiToString(uint256 weiAmount, uint256 decimals)
internal
pure
virtual
returns (string memory);
```

### _removeTrailingZeros

*Remove any trailing zeroes from string.*


```solidity
function _removeTrailingZeros(string memory str) internal pure virtual returns (string memory);
```

### _toString

*Returns the base 10 decimal representation of `value`.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/IE.sol/interface.IExecutor.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IExecutor
[Git Source](https://github.com/NaniDAO/ie/blob/f14d7018eb9d8e0d134c41b44e0923f915c5a573/src/IE.sol)
[Git Source](https://github.com/NaniDAO/ie/blob/6ef68a2b1b107d6bd41812722498a697873f8c87/src/IE.sol)

Simple calldata executor interface.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/IE.sol/interface.INAMI.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# INAMI
[Git Source](https://github.com/NaniDAO/ie/blob/f14d7018eb9d8e0d134c41b44e0923f915c5a573/src/IE.sol)
[Git Source](https://github.com/NaniDAO/ie/blob/6ef68a2b1b107d6bd41812722498a697873f8c87/src/IE.sol)

*Simple NAMI names interface for resolving L2 ENS ownership.*

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/IE.sol/interface.ISwapRouter.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ISwapRouter
[Git Source](https://github.com/NaniDAO/ie/blob/f14d7018eb9d8e0d134c41b44e0923f915c5a573/src/IE.sol)
[Git Source](https://github.com/NaniDAO/ie/blob/6ef68a2b1b107d6bd41812722498a697873f8c87/src/IE.sol)

*Simple Uniswap V3 swapping interface.*

Expand Down
11 changes: 9 additions & 2 deletions docs/src/src/IE.sol/interface.IToken.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# IToken
[Git Source](https://github.com/NaniDAO/ie/blob/f14d7018eb9d8e0d134c41b44e0923f915c5a573/src/IE.sol)
[Git Source](https://github.com/NaniDAO/ie/blob/6ef68a2b1b107d6bd41812722498a697873f8c87/src/IE.sol)

*Simple token transfer interface.*
*Simple token handler interface.*


## Functions
### approve


```solidity
function approve(address, uint256) external returns (bool);
```

### transfer


Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/NAMI.sol/contract.NAMI.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NAMI
[Git Source](https://github.com/NaniDAO/ie/blob/f14d7018eb9d8e0d134c41b44e0923f915c5a573/src/NAMI.sol)
[Git Source](https://github.com/NaniDAO/ie/blob/6ef68a2b1b107d6bd41812722498a697873f8c87/src/NAMI.sol)

**Author:**
nani.eth (https://github.com/NaniDAO/ie)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/NAMI.sol/interface.IToken.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IToken
[Git Source](https://github.com/NaniDAO/ie/blob/f14d7018eb9d8e0d134c41b44e0923f915c5a573/src/NAMI.sol)
[Git Source](https://github.com/NaniDAO/ie/blob/6ef68a2b1b107d6bd41812722498a697873f8c87/src/NAMI.sol)

*Simple token balance & supply interface.*

Expand Down
2 changes: 1 addition & 1 deletion etherscan.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/solady

0 comments on commit 035a318

Please sign in to comment.