Created
June 8, 2016 16:33
-
-
Save iurimatias/e02cb2fdb97190e8aeb6d12a8c0915f6 to your computer and use it in GitHub Desktop.
Simple Namecoin contract
This file contains 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
contract Namecoin { | |
uint registrationCost; | |
mapping (string => string) public domains; | |
function Namecoin(uint _cost) { | |
registrationCost = _cost; | |
} | |
function register(string _domainName, string _ip) { | |
if (msg.value < registrationCost) throw; | |
if (domains[_domainName]) throw; | |
domains[_domainName] = _ip; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment