1a6a4ebfbb
Signed-off-by: AlienTornadosaurusHex <>
128 lines
7.5 KiB
HTML
128 lines
7.5 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title>LCOV - lcov.info - v2/libraries/ENSResolver.sol</title>
|
|
<link rel="stylesheet" type="text/css" href="../../gcov.css">
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<table width="100%" border=0 cellspacing=0 cellpadding=0>
|
|
<tr><td class="title">LCOV - code coverage report</td></tr>
|
|
<tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
|
|
|
|
<tr>
|
|
<td width="100%">
|
|
<table cellpadding=1 border=0 width="100%">
|
|
<tr>
|
|
<td width="10%" class="headerItem">Current view:</td>
|
|
<td width="35%" class="headerValue"><a href="../../index.html">top level</a> - <a href="index.html">v2/libraries</a> - ENSResolver.sol<span style="font-size: 80%;"> (source / <a href="ENSResolver.sol.func-sort-c.html">functions</a>)</span></td>
|
|
<td width="5%"></td>
|
|
<td width="15%"></td>
|
|
<td width="10%" class="headerCovTableHead">Hit</td>
|
|
<td width="10%" class="headerCovTableHead">Total</td>
|
|
<td width="15%" class="headerCovTableHead">Coverage</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="headerItem">Test:</td>
|
|
<td class="headerValue">lcov.info</td>
|
|
<td></td>
|
|
<td class="headerItem">Lines:</td>
|
|
<td class="headerCovTableEntry">7</td>
|
|
<td class="headerCovTableEntry">7</td>
|
|
<td class="headerCovTableEntryHi">100.0 %</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="headerItem">Date:</td>
|
|
<td class="headerValue">2023-06-20 21:04:08</td>
|
|
<td></td>
|
|
<td class="headerItem">Functions:</td>
|
|
<td class="headerCovTableEntry">1</td>
|
|
<td class="headerCovTableEntry">4</td>
|
|
<td class="headerCovTableEntryLo">25.0 %</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="headerItem">Legend:</td>
|
|
<td class="headerValueLeg"> Lines:
|
|
<span class="coverLegendCov">hit</span>
|
|
<span class="coverLegendNoCov">not hit</span>
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
<tr><td><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
|
|
</table>
|
|
|
|
<table cellpadding=0 cellspacing=0 border=0>
|
|
<tr>
|
|
<td><br></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<pre class="sourceHeading"> Line data Source code</pre>
|
|
<pre class="source">
|
|
<a name="1"><span class="lineNum"> 1 </span> : // SPDX-License-Identifier: MIT</a>
|
|
<a name="2"><span class="lineNum"> 2 </span> : </a>
|
|
<a name="3"><span class="lineNum"> 3 </span> : pragma solidity ^0.6.12;</a>
|
|
<a name="4"><span class="lineNum"> 4 </span> : </a>
|
|
<a name="5"><span class="lineNum"> 5 </span> : // Local imports</a>
|
|
<a name="6"><span class="lineNum"> 6 </span> : </a>
|
|
<a name="7"><span class="lineNum"> 7 </span> : import { ENSNamehash } from "./ENSNamehash.sol";</a>
|
|
<a name="8"><span class="lineNum"> 8 </span> : </a>
|
|
<a name="9"><span class="lineNum"> 9 </span> : interface ENS {</a>
|
|
<a name="10"><span class="lineNum"> 10 </span> : function resolver(bytes32 node) external view returns (Resolver);</a>
|
|
<a name="11"><span class="lineNum"> 11 </span> : function owner(bytes32 node) external view returns (address);</a>
|
|
<a name="12"><span class="lineNum"> 12 </span> : }</a>
|
|
<a name="13"><span class="lineNum"> 13 </span> : </a>
|
|
<a name="14"><span class="lineNum"> 14 </span> : interface Resolver {</a>
|
|
<a name="15"><span class="lineNum"> 15 </span> : function addr(bytes32 node) external view returns (address);</a>
|
|
<a name="16"><span class="lineNum"> 16 </span> : }</a>
|
|
<a name="17"><span class="lineNum"> 17 </span> : </a>
|
|
<a name="18"><span class="lineNum"> 18 </span> : /**</a>
|
|
<a name="19"><span class="lineNum"> 19 </span> : * @dev The addresses below only work on Mainnet.</a>
|
|
<a name="20"><span class="lineNum"> 20 </span> : */</a>
|
|
<a name="21"><span class="lineNum"> 21 </span> : contract ENSResolver {</a>
|
|
<a name="22"><span class="lineNum"> 22 </span> : address internal constant _ENS_ADDRESS = 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e;</a>
|
|
<a name="23"><span class="lineNum"> 23 </span> : address internal constant _ENS_NAMEWRAPPER_ADDRESS = 0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401;</a>
|
|
<a name="24"><span class="lineNum"> 24 </span> : </a>
|
|
<a name="25"><span class="lineNum"> 25 </span> : function ownerByName(string memory _name) public view virtual returns (address) {</a>
|
|
<a name="26"><span class="lineNum"> 26 </span><span class="lineCov"> 3 : return ownerByNode(ENSNamehash.namehash(bytes(_name)));</span></a>
|
|
<a name="27"><span class="lineNum"> 27 </span> : }</a>
|
|
<a name="28"><span class="lineNum"> 28 </span> : </a>
|
|
<a name="29"><span class="lineNum"> 29 </span> : function resolveByName(string memory _name) public view virtual returns (address) {</a>
|
|
<a name="30"><span class="lineNum"> 30 </span><span class="lineCov"> 1 : return resolveByNode(ENSNamehash.namehash(bytes(_name)));</span></a>
|
|
<a name="31"><span class="lineNum"> 31 </span> : }</a>
|
|
<a name="32"><span class="lineNum"> 32 </span> : </a>
|
|
<a name="33"><span class="lineNum"> 33 </span> : function ownerByNode(bytes32 _node) public view virtual returns (address) {</a>
|
|
<a name="34"><span class="lineNum"> 34 </span><span class="lineCov"> 4 : ENS ens = ENS(0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e);</span></a>
|
|
<a name="35"><span class="lineNum"> 35 </span><span class="lineCov"> 4 : address _owner = ens.owner(_node);</span></a>
|
|
<a name="36"><span class="lineNum"> 36 </span><span class="lineCov"> 4 : return _owner == _ENS_NAMEWRAPPER_ADDRESS ? ens.resolver(_node).addr(_node) : _owner;</span></a>
|
|
<a name="37"><span class="lineNum"> 37 </span> : }</a>
|
|
<a name="38"><span class="lineNum"> 38 </span> : </a>
|
|
<a name="39"><span class="lineNum"> 39 </span> : function resolveByNode(bytes32 _node) public view virtual returns (address) {</a>
|
|
<a name="40"><span class="lineNum"> 40 </span><span class="lineCov"> 1 : ENS ens = ENS(0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e);</span></a>
|
|
<a name="41"><span class="lineNum"> 41 </span><span class="lineCov"> 1 : return ens.resolver(_node).addr(_node);</span></a>
|
|
<a name="42"><span class="lineNum"> 42 </span> : }</a>
|
|
<a name="43"><span class="lineNum"> 43 </span> : }</a>
|
|
</pre>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
|
|
<table width="100%" border=0 cellspacing=0 cellpadding=0>
|
|
<tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
|
|
<tr><td class="versionInfo">Generated by: <a href="https://github.com/linux-test-project/lcov" target="_parent">LCOV version 1.16</a></td></tr>
|
|
</table>
|
|
<br>
|
|
|
|
</body>
|
|
</html>
|