Created
January 28, 2017 12:43
-
-
Save Arachnid/6f8f598cc31d4d3a5780458f3d431b17 to your computer and use it in GitHub Desktop.
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
pragma solidity ^0.4.0; | |
contract ENS { | |
function resolver(bytes32 node) constant returns(Resolver); | |
} | |
contract Resolver { | |
function addr(bytes32 node) constant returns(address); | |
} | |
contract SomeOtherContract { | |
function stuff(); | |
} | |
contract ENSTest { | |
bytes32 constant otherName = 0xde9b09fd7c5f901e23a3f19fecc54828e9c848539801e86591bd9801b019f84f; | |
address ens; | |
function ENSTest(address _ens) { | |
ens = _ens; | |
} | |
function getAddr(bytes32 node) internal returns(address) { | |
return ENS(ens).resolver(node).addr(node); | |
} | |
function doSomething() { | |
var otherContract = SomeOtherContract(getAddr(otherName)); | |
otherContract.stuff(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment