Skip to content

Instantly share code, notes, and snippets.

@iurimatias
Created June 8, 2016 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iurimatias/e02cb2fdb97190e8aeb6d12a8c0915f6 to your computer and use it in GitHub Desktop.
Save iurimatias/e02cb2fdb97190e8aeb6d12a8c0915f6 to your computer and use it in GitHub Desktop.
Simple Namecoin contract
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