Skip to content

Commit

Permalink
⚡ ~~
Browse files Browse the repository at this point in the history
  • Loading branch information
z0r0z committed Feb 15, 2024
1 parent 445430c commit adf75de
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
24 changes: 12 additions & 12 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
IETest:testBalanceInERC20() (gas: 49207)
IETest:testBalanceInETH() (gas: 40333)
IETest:testCommandSendERC0() (gas: 102975)
IETest:testCommandSendETH() (gas: 69457)
IETest:testCommandSendUSDC() (gas: 135705)
IETest:testBalanceInERC20() (gas: 49154)
IETest:testBalanceInETH() (gas: 40280)
IETest:testCommandSendERC0() (gas: 102922)
IETest:testCommandSendETH() (gas: 69404)
IETest:testCommandSendUSDC() (gas: 135652)
IETest:testCommandSwapDAI() (gas: 102106)
IETest:testCommandSwapETH() (gas: 113473)
IETest:testCommandSwapForETH() (gas: 123421)
IETest:testCommandSwapUSDC() (gas: 156848)
IETest:testCommandSwapUSDCForWBTC() (gas: 165030)
IETest:testDeploy() (gas: 2647221)
IETest:testENSNameOwnership() (gas: 84066)
IETest:testDeploy() (gas: 2643012)
IETest:testENSNameOwnership() (gas: 83907)
IETest:testIENameSetting() (gas: 8142)
IETest:testPreviewCommandSendDecimals() (gas: 91972)
IETest:testPreviewCommandSendUSDC() (gas: 66096)
IETest:testPreviewSend() (gas: 42673)
IETest:testPreviewSendCommand() (gas: 54554)
IETest:testSendETH() (gas: 59695)
IETest:testPreviewCommandSendDecimals() (gas: 91866)
IETest:testPreviewCommandSendUSDC() (gas: 66043)
IETest:testPreviewSend() (gas: 42620)
IETest:testPreviewSendCommand() (gas: 54501)
IETest:testSendETH() (gas: 59642)
IETest:testTotalSupply() (gas: 14808)
14 changes: 2 additions & 12 deletions src/IE.sol
Original file line number Diff line number Diff line change
Expand Up @@ -464,22 +464,12 @@ contract IE {
virtual
returns (address owner, address receiver, bytes32 node)
{
(owner, node) = _owner(string(abi.encodePacked(name, ".eth")));
node = _namehash(string(abi.encodePacked(name, ".eth")));
owner = ENS_REGISTRY.owner(node);
if (IENSHelper(owner) == ENS_WRAPPER) owner = ENS_WRAPPER.ownerOf(uint256(node));
receiver = IENSHelper(ENS_REGISTRY.resolver(node)).addr(node); // Fails on misname.
}

/// @dev Resolves an ENS domain owner.
function _owner(string memory domain)
internal
view
virtual
returns (address domainOwner, bytes32 node)
{
node = _namehash(domain);
return (ENS_REGISTRY.owner(node), node);
}

/// @dev Computes an ENS domain namehash.
function _namehash(string memory domain) internal view virtual returns (bytes32 node) {
// Process labels (in reverse order for namehash).
Expand Down

0 comments on commit adf75de

Please sign in to comment.