ETH Price: $3,342.97 (-2.22%)

Contract

0xa46cc5D597e55f311C978E22db3EB3714E1098B8
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Advanced mode:
Parent Transaction Hash Block
From
To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ENSNameHasher

Compiler Version
v0.8.27+commit.40a35a09

Optimization Enabled:
No with 200 runs

Other Settings:
paris EvmVersion, MIT license
/**
 *Submitted for verification at Etherscan.io on 2024-11-04
*/

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

contract ENSNameHasher {
    /**
     * @dev Computes the namehash of an ENS domain string.
     * @notice The domain string must be provided in Punycode (ASCII-compatible encoding)
     * to correctly handle Unicode characters. Convert Unicode domains to Punycode before calling.
     * @param domain The ENS domain string in Punycode format to hash.
     * @return The node hash of the domain.
     */
    function namehash(string memory domain) public pure returns (bytes32) {
        bytes memory domainBytes = bytes(domain);
        require(domainBytes.length > 0, "ENSNameHasher: empty domain");

        // Validate that all characters are ASCII
        for (uint256 i = 0; i < domainBytes.length; i++) {
            require(
                uint8(domainBytes[i]) < 0x80,
                "ENSNameHasher: domain must be in Punycode format (ASCII only)"
            );
        }

        // Split the domain into labels
        bytes32 node = 0x0;
        uint256 length = domainBytes.length;
        uint256 start = 0;

        while (start < length) {
            uint256 end = start;
            while (end < length && domainBytes[end] != ".") {
                end++;
            }

            // Create a bytes array to hold the label
            bytes memory labelBytes = new bytes(end - start);
            for (uint256 i = start; i < end; i++) {
                labelBytes[i - start] = domainBytes[i];
            }

            bytes32 label = keccak256(labelBytes);
            node = keccak256(abi.encodePacked(node, label));

            start = end + 1;
        }

        return node;
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"domain","type":"string"}],"name":"namehash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"}]

6080604052348015600f57600080fd5b5061078d8061001f6000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80630987996214610030575b600080fd5b61004a60048036038101906100459190610466565b610060565b60405161005791906104c8565b60405180910390f35b60008082905060008151116100aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100a190610540565b60405180910390fd5b60005b81518110156101295760808282815181106100cb576100ca610560565b5b602001015160f81c60f81b60f81c60ff161061011c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161011390610601565b60405180910390fd5b80806001019150506100ad565b5060008060001b905060008251905060005b818110156103005760008190505b82811080156101b757507f2e0000000000000000000000000000000000000000000000000000000000000085828151811061018757610186610560565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614155b156101cf5780806101c79061065a565b915050610149565b600082826101dd91906106a2565b67ffffffffffffffff8111156101f6576101f561033b565b5b6040519080825280601f01601f1916602001820160405280156102285781602001600182028036833780820191505090505b50905060008390505b828110156102b15786818151811061024c5761024b610560565b5b602001015160f81c60f81b82858361026491906106a2565b8151811061027557610274610560565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050610231565b5060008180519060200120905085816040516020016102d19291906106f7565b6040516020818303038152906040528051906020012095506001836102f69190610723565b935050505061013b565b82945050505050919050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6103738261032a565b810181811067ffffffffffffffff821117156103925761039161033b565b5b80604052505050565b60006103a561030c565b90506103b1828261036a565b919050565b600067ffffffffffffffff8211156103d1576103d061033b565b5b6103da8261032a565b9050602081019050919050565b82818337600083830152505050565b6000610409610404846103b6565b61039b565b90508281526020810184848401111561042557610424610325565b5b6104308482856103e7565b509392505050565b600082601f83011261044d5761044c610320565b5b813561045d8482602086016103f6565b91505092915050565b60006020828403121561047c5761047b610316565b5b600082013567ffffffffffffffff81111561049a5761049961031b565b5b6104a684828501610438565b91505092915050565b6000819050919050565b6104c2816104af565b82525050565b60006020820190506104dd60008301846104b9565b92915050565b600082825260208201905092915050565b7f454e534e616d654861736865723a20656d70747920646f6d61696e0000000000600082015250565b600061052a601b836104e3565b9150610535826104f4565b602082019050919050565b600060208201905081810360008301526105598161051d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f454e534e616d654861736865723a20646f6d61696e206d75737420626520696e60008201527f2050756e79636f646520666f726d617420284153434949206f6e6c7929000000602082015250565b60006105eb603d836104e3565b91506105f68261058f565b604082019050919050565b6000602082019050818103600083015261061a816105de565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000819050919050565b600061066582610650565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361069757610696610621565b5b600182019050919050565b60006106ad82610650565b91506106b883610650565b92508282039050818111156106d0576106cf610621565b5b92915050565b6000819050919050565b6106f16106ec826104af565b6106d6565b82525050565b600061070382856106e0565b60208201915061071382846106e0565b6020820191508190509392505050565b600061072e82610650565b915061073983610650565b925082820190508082111561075157610750610621565b5b9291505056fea2646970667358221220253faa7aed928598c612ba11793f8a727282df7b77d935a11e186b695cc207ca64736f6c634300081b0033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80630987996214610030575b600080fd5b61004a60048036038101906100459190610466565b610060565b60405161005791906104c8565b60405180910390f35b60008082905060008151116100aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100a190610540565b60405180910390fd5b60005b81518110156101295760808282815181106100cb576100ca610560565b5b602001015160f81c60f81b60f81c60ff161061011c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161011390610601565b60405180910390fd5b80806001019150506100ad565b5060008060001b905060008251905060005b818110156103005760008190505b82811080156101b757507f2e0000000000000000000000000000000000000000000000000000000000000085828151811061018757610186610560565b5b602001015160f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614155b156101cf5780806101c79061065a565b915050610149565b600082826101dd91906106a2565b67ffffffffffffffff8111156101f6576101f561033b565b5b6040519080825280601f01601f1916602001820160405280156102285781602001600182028036833780820191505090505b50905060008390505b828110156102b15786818151811061024c5761024b610560565b5b602001015160f81c60f81b82858361026491906106a2565b8151811061027557610274610560565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050610231565b5060008180519060200120905085816040516020016102d19291906106f7565b6040516020818303038152906040528051906020012095506001836102f69190610723565b935050505061013b565b82945050505050919050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6103738261032a565b810181811067ffffffffffffffff821117156103925761039161033b565b5b80604052505050565b60006103a561030c565b90506103b1828261036a565b919050565b600067ffffffffffffffff8211156103d1576103d061033b565b5b6103da8261032a565b9050602081019050919050565b82818337600083830152505050565b6000610409610404846103b6565b61039b565b90508281526020810184848401111561042557610424610325565b5b6104308482856103e7565b509392505050565b600082601f83011261044d5761044c610320565b5b813561045d8482602086016103f6565b91505092915050565b60006020828403121561047c5761047b610316565b5b600082013567ffffffffffffffff81111561049a5761049961031b565b5b6104a684828501610438565b91505092915050565b6000819050919050565b6104c2816104af565b82525050565b60006020820190506104dd60008301846104b9565b92915050565b600082825260208201905092915050565b7f454e534e616d654861736865723a20656d70747920646f6d61696e0000000000600082015250565b600061052a601b836104e3565b9150610535826104f4565b602082019050919050565b600060208201905081810360008301526105598161051d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f454e534e616d654861736865723a20646f6d61696e206d75737420626520696e60008201527f2050756e79636f646520666f726d617420284153434949206f6e6c7929000000602082015250565b60006105eb603d836104e3565b91506105f68261058f565b604082019050919050565b6000602082019050818103600083015261061a816105de565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000819050919050565b600061066582610650565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361069757610696610621565b5b600182019050919050565b60006106ad82610650565b91506106b883610650565b92508282039050818111156106d0576106cf610621565b5b92915050565b6000819050919050565b6106f16106ec826104af565b6106d6565b82525050565b600061070382856106e0565b60208201915061071382846106e0565b6020820191508190509392505050565b600061072e82610650565b915061073983610650565b925082820190508082111561075157610750610621565b5b9291505056fea2646970667358221220253faa7aed928598c612ba11793f8a727282df7b77d935a11e186b695cc207ca64736f6c634300081b0033

Deployed Bytecode Sourcemap

61:1657:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;477:1238;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;538:7;558:24;591:6;558:40;;638:1;617:11;:18;:22;609:62;;;;;;;;;;;;:::i;:::-;;;;;;;;;740:9;735:227;759:11;:18;755:1;:22;735:227;;;849:4;831:11;843:1;831:14;;;;;;;;:::i;:::-;;;;;;;;;;825:21;;:28;;;799:151;;;;;;;;;;;;:::i;:::-;;;;;;;;;779:3;;;;;;;735:227;;;;1015:12;1030:3;1015:18;;;;1044:14;1061:11;:18;1044:35;;1090:13;1120:564;1135:6;1127:5;:14;1120:564;;;1158:11;1172:5;1158:19;;1192:88;1205:6;1199:3;:12;:39;;;;;1215:23;:11;1227:3;1215:16;;;;;;;;:::i;:::-;;;;;;;;;;:23;;;;;1199:39;1192:88;;;1259:5;;;;;:::i;:::-;;;;1192:88;;;1351:23;1393:5;1387:3;:11;;;;:::i;:::-;1377:22;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1351:48;;1419:9;1431:5;1419:17;;1414:111;1442:3;1438:1;:7;1414:111;;;1495:11;1507:1;1495:14;;;;;;;;:::i;:::-;;;;;;;;;;1471:10;1486:5;1482:1;:9;;;;:::i;:::-;1471:21;;;;;;;;:::i;:::-;;;;;:38;;;;;;;;;;;1447:3;;;;;;;1414:111;;;;1541:13;1567:10;1557:21;;;;;;1541:37;;1627:4;1633:5;1610:29;;;;;;;;;:::i;:::-;;;;;;;;;;;;;1600:40;;;;;;1593:47;;1671:1;1665:3;:7;;;;:::i;:::-;1657:15;;1143:541;;;1120:564;;;1703:4;1696:11;;;;;;477:1238;;;:::o;7:75:1:-;40:6;73:2;67:9;57:19;;7:75;:::o;88:117::-;197:1;194;187:12;211:117;320:1;317;310:12;334:117;443:1;440;433:12;457:117;566:1;563;556:12;580:102;621:6;672:2;668:7;663:2;656:5;652:14;648:28;638:38;;580:102;;;:::o;688:180::-;736:77;733:1;726:88;833:4;830:1;823:15;857:4;854:1;847:15;874:281;957:27;979:4;957:27;:::i;:::-;949:6;945:40;1087:6;1075:10;1072:22;1051:18;1039:10;1036:34;1033:62;1030:88;;;1098:18;;:::i;:::-;1030:88;1138:10;1134:2;1127:22;917:238;874:281;;:::o;1161:129::-;1195:6;1222:20;;:::i;:::-;1212:30;;1251:33;1279:4;1271:6;1251:33;:::i;:::-;1161:129;;;:::o;1296:308::-;1358:4;1448:18;1440:6;1437:30;1434:56;;;1470:18;;:::i;:::-;1434:56;1508:29;1530:6;1508:29;:::i;:::-;1500:37;;1592:4;1586;1582:15;1574:23;;1296:308;;;:::o;1610:148::-;1708:6;1703:3;1698;1685:30;1749:1;1740:6;1735:3;1731:16;1724:27;1610:148;;;:::o;1764:425::-;1842:5;1867:66;1883:49;1925:6;1883:49;:::i;:::-;1867:66;:::i;:::-;1858:75;;1956:6;1949:5;1942:21;1994:4;1987:5;1983:16;2032:3;2023:6;2018:3;2014:16;2011:25;2008:112;;;2039:79;;:::i;:::-;2008:112;2129:54;2176:6;2171:3;2166;2129:54;:::i;:::-;1848:341;1764:425;;;;;:::o;2209:340::-;2265:5;2314:3;2307:4;2299:6;2295:17;2291:27;2281:122;;2322:79;;:::i;:::-;2281:122;2439:6;2426:20;2464:79;2539:3;2531:6;2524:4;2516:6;2512:17;2464:79;:::i;:::-;2455:88;;2271:278;2209:340;;;;:::o;2555:509::-;2624:6;2673:2;2661:9;2652:7;2648:23;2644:32;2641:119;;;2679:79;;:::i;:::-;2641:119;2827:1;2816:9;2812:17;2799:31;2857:18;2849:6;2846:30;2843:117;;;2879:79;;:::i;:::-;2843:117;2984:63;3039:7;3030:6;3019:9;3015:22;2984:63;:::i;:::-;2974:73;;2770:287;2555:509;;;;:::o;3070:77::-;3107:7;3136:5;3125:16;;3070:77;;;:::o;3153:118::-;3240:24;3258:5;3240:24;:::i;:::-;3235:3;3228:37;3153:118;;:::o;3277:222::-;3370:4;3408:2;3397:9;3393:18;3385:26;;3421:71;3489:1;3478:9;3474:17;3465:6;3421:71;:::i;:::-;3277:222;;;;:::o;3505:169::-;3589:11;3623:6;3618:3;3611:19;3663:4;3658:3;3654:14;3639:29;;3505:169;;;;:::o;3680:177::-;3820:29;3816:1;3808:6;3804:14;3797:53;3680:177;:::o;3863:366::-;4005:3;4026:67;4090:2;4085:3;4026:67;:::i;:::-;4019:74;;4102:93;4191:3;4102:93;:::i;:::-;4220:2;4215:3;4211:12;4204:19;;3863:366;;;:::o;4235:419::-;4401:4;4439:2;4428:9;4424:18;4416:26;;4488:9;4482:4;4478:20;4474:1;4463:9;4459:17;4452:47;4516:131;4642:4;4516:131;:::i;:::-;4508:139;;4235:419;;;:::o;4660:180::-;4708:77;4705:1;4698:88;4805:4;4802:1;4795:15;4829:4;4826:1;4819:15;4846:248;4986:34;4982:1;4974:6;4970:14;4963:58;5055:31;5050:2;5042:6;5038:15;5031:56;4846:248;:::o;5100:366::-;5242:3;5263:67;5327:2;5322:3;5263:67;:::i;:::-;5256:74;;5339:93;5428:3;5339:93;:::i;:::-;5457:2;5452:3;5448:12;5441:19;;5100:366;;;:::o;5472:419::-;5638:4;5676:2;5665:9;5661:18;5653:26;;5725:9;5719:4;5715:20;5711:1;5700:9;5696:17;5689:47;5753:131;5879:4;5753:131;:::i;:::-;5745:139;;5472:419;;;:::o;5897:180::-;5945:77;5942:1;5935:88;6042:4;6039:1;6032:15;6066:4;6063:1;6056:15;6083:77;6120:7;6149:5;6138:16;;6083:77;;;:::o;6166:233::-;6205:3;6228:24;6246:5;6228:24;:::i;:::-;6219:33;;6274:66;6267:5;6264:77;6261:103;;6344:18;;:::i;:::-;6261:103;6391:1;6384:5;6380:13;6373:20;;6166:233;;;:::o;6405:194::-;6445:4;6465:20;6483:1;6465:20;:::i;:::-;6460:25;;6499:20;6517:1;6499:20;:::i;:::-;6494:25;;6543:1;6540;6536:9;6528:17;;6567:1;6561:4;6558:11;6555:37;;;6572:18;;:::i;:::-;6555:37;6405:194;;;;:::o;6605:79::-;6644:7;6673:5;6662:16;;6605:79;;;:::o;6690:157::-;6795:45;6815:24;6833:5;6815:24;:::i;:::-;6795:45;:::i;:::-;6790:3;6783:58;6690:157;;:::o;6853:397::-;6993:3;7008:75;7079:3;7070:6;7008:75;:::i;:::-;7108:2;7103:3;7099:12;7092:19;;7121:75;7192:3;7183:6;7121:75;:::i;:::-;7221:2;7216:3;7212:12;7205:19;;7241:3;7234:10;;6853:397;;;;;:::o;7256:191::-;7296:3;7315:20;7333:1;7315:20;:::i;:::-;7310:25;;7349:20;7367:1;7349:20;:::i;:::-;7344:25;;7392:1;7389;7385:9;7378:16;;7413:3;7410:1;7407:10;7404:36;;;7420:18;;:::i;:::-;7404:36;7256:191;;;;:::o

Swarm Source

ipfs://253faa7aed928598c612ba11793f8a727282df7b77d935a11e186b695cc207ca

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.