Skip to content

Commit

Permalink
📛 Public Onchain Labeling
Browse files Browse the repository at this point in the history
  • Loading branch information
z0r0z committed Feb 14, 2024
1 parent 20aa273 commit 06505b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
IETest:testBalanceInERC20() (gas: 49298)
IETest:testBalanceInETH() (gas: 40379)
IETest:testBalanceInERC20() (gas: 49253)
IETest:testBalanceInETH() (gas: 40334)
IETest:testCommandSendERC0() (gas: 103038)
IETest:testCommandSendETH() (gas: 69510)
IETest:testCommandSendUSDC() (gas: 135746)
IETest:testCommandSwapDAI() (gas: 101753)
IETest:testCommandSwapUSDC() (gas: 157044)
IETest:testDeploy() (gas: 2455676)
IETest:testCommandSwapDAI() (gas: 102032)
IETest:testCommandSwapUSDC() (gas: 157046)
IETest:testDeploy() (gas: 2589624)
IETest:testENSNameOwnership() (gas: 84123)
IETest:testIENameSetting() (gas: 8187)
IETest:testPreviewCommandSendDecimals() (gas: 92044)
IETest:testPreviewCommandSendUSDC() (gas: 66137)
IETest:testPreviewSend() (gas: 42675)
IETest:testPreviewSend() (gas: 42697)
IETest:testPreviewSendCommand() (gas: 54595)
IETest:testSendETH() (gas: 59708)
IETest:testSendETH() (gas: 59730)
IETest:testTotalSupply() (gas: 14871)
8 changes: 8 additions & 0 deletions src/IE.sol
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,14 @@ contract IE {
emit NameSet(tokens[normalized] = token, normalized);
}

/// @dev Sets a public name and ticker for a given `token` address.
function setNameAndTicker(address token) public payable virtual {
string memory normalizedName = _lowercase(token.readName());
string memory normalizedSymbol = _lowercase(token.readSymbol());
emit NameSet(tokens[normalizedName] = token, normalizedName);
emit NameSet(tokens[normalizedSymbol] = token, normalizedSymbol);
}

/// ====================== SAFECAST UTILITY ====================== ///

function _toInt256(uint256 x) internal pure virtual returns (int256) {
Expand Down

0 comments on commit 06505b9

Please sign in to comment.