Created
September 5, 2019 15:51
-
-
Save eternauta1337/f1ac44ea6b038d5a44e41f6cc5f5bf39 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.11+commit.c082d0b4.js&optimize=false&gist=
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * SPDX-License-Identitifer: MIT | |
| */ | |
| pragma solidity ^0.4.24; | |
| contract APMNamehash { | |
| /* Hardcoded constants to save gas | |
| bytes32 internal constant APM_NODE = keccak256(abi.encodePacked(ETH_TLD_NODE, keccak256(abi.encodePacked("aragonpm")))); | |
| */ | |
| bytes32 internal constant APM_NODE = 0x9065c3e7f7b7ef1ef4e53d2d0b8e0cef02874ab020c1ece79d5f0d3d0111c0ba; | |
| function apmNamehash(string name) public pure returns (bytes32) { | |
| return keccak256(abi.encodePacked(APM_NODE, keccak256(bytes(name)))); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment