Skip to content

Commit

Permalink
🧹 Tidy deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
z0r0z committed Feb 16, 2024
1 parent 0e07baa commit 214593b
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ IETest:testCommandSwapETH() (gas: 113487)
IETest:testCommandSwapForETH() (gas: 130366)
IETest:testCommandSwapUSDC() (gas: 157128)
IETest:testCommandSwapUSDCForWBTC() (gas: 165068)
IETest:testDeploy() (gas: 2643012)
IETest:testDeploy() (gas: 2657924)
IETest:testENSNameOwnership() (gas: 83907)
IETest:testIENameSetting() (gas: 8142)
IETest:testPreviewCommandSendDecimals() (gas: 91866)
Expand Down
16 changes: 13 additions & 3 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/55a636250a2f0bfbb6be0be4bcc7c046924d719c/src/IE.sol)
[Git Source](https://github.com/NaniDAO/ie/blob/0e07baacb225bae6af6d37dff531a21dd06e0665/src/IE.sol)

**Author:**
nani.eth (https://github.com/NaniDAO/ie)
Expand Down Expand Up @@ -141,6 +141,16 @@ uint160 internal constant MAX_SQRT_RATIO_MINUS_ONE =
```


### ASCII_MAP
*String mapping for ENSAsciiNormalizer logic.*


```solidity
bytes internal constant ASCII_MAP =
hex"2d00020101000a010700016101620163016401650166016701680169016a016b016c016d016e016f0170017101720173017401750176017701780179017a06001a010500";
```


### tokens
========================== STORAGE ========================== ///

Expand Down Expand Up @@ -170,11 +180,11 @@ bytes1[] internal _idnamap;

======================== CONSTRUCTOR ======================== ///

*Constructs this IE with `asciimap`.*
*Constructs this IE with `ASCII_MAP`.*


```solidity
constructor(bytes memory asciimap) payable;
constructor() payable;
```

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

*ENS name resolution helper contracts interface.*

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/55a636250a2f0bfbb6be0be4bcc7c046924d719c/src/IE.sol)
[Git Source](https://github.com/NaniDAO/ie/blob/0e07baacb225bae6af6d37dff531a21dd06e0665/src/IE.sol)

Simple calldata executor interface.

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/55a636250a2f0bfbb6be0be4bcc7c046924d719c/src/IE.sol)
[Git Source](https://github.com/NaniDAO/ie/blob/0e07baacb225bae6af6d37dff531a21dd06e0665/src/IE.sol)

*Simple Uniswap V3 swapping interface.*

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/IE.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/55a636250a2f0bfbb6be0be4bcc7c046924d719c/src/IE.sol)
[Git Source](https://github.com/NaniDAO/ie/blob/0e07baacb225bae6af6d37dff531a21dd06e0665/src/IE.sol)

*Simple token transfer interface.*

Expand Down
14 changes: 9 additions & 5 deletions src/IE.sol
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ contract IE {
uint160 internal constant MAX_SQRT_RATIO_MINUS_ONE =
1461446703485210103287273052203988822378723970341;

/// @dev String mapping for ENSAsciiNormalizer logic.
bytes internal constant ASCII_MAP =
hex"2d00020101000a010700016101620163016401650166016701680169016a016b016c016d016e016f0170017101720173017401750176017701780179017a06001a010500";

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

/// @dev DAO-governed token address naming.
Expand All @@ -142,12 +146,12 @@ contract IE {

/// ======================== CONSTRUCTOR ======================== ///

/// @dev Constructs this IE with `asciimap`.
constructor(bytes memory asciimap) payable {
/// @dev Constructs this IE with `ASCII_MAP`.
constructor() payable {
unchecked {
for (uint256 i; i != asciimap.length; i += 2) {
bytes1 r = asciimap[i + 1];
for (uint8 j; j != uint8(asciimap[i]); ++j) {
for (uint256 i; i != ASCII_MAP.length; i += 2) {
bytes1 r = ASCII_MAP[i + 1];
for (uint8 j; j != uint8(ASCII_MAP[i]); ++j) {
_idnamap.push(r);
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/IE.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ contract IETest is Test {

function setUp() public payable {
vm.createSelectFork(vm.rpcUrl("main")); // Ethereum mainnet fork.
ie = new IE(ASCII_MAP);
ie = new IE();
vm.prank(DAO);
ie.setName(ETH, "ETH");
vm.prank(DAO);
Expand Down Expand Up @@ -61,7 +61,7 @@ contract IETest is Test {
}

function testDeploy() public payable {
new IE(ASCII_MAP);
new IE();
}

function testENSNameOwnership() public payable {
Expand Down

0 comments on commit 214593b

Please sign in to comment.