Created
March 29, 2016 17:48
-
-
Save euri10/068956d92e9c084fa04995110b48ab26 to your computer and use it in GitHub Desktop.
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 contract1 { | |
struct Person { | |
string name; | |
string description; | |
address primaryAddress; | |
string linkToWebsite; | |
string linkToPicture; | |
address secondaryAddress; | |
uint age; | |
} | |
mapping(string => Person) map; | |
function setName(string name, string value, address addr1, address addr2) { | |
map[name] = Person({name: value, description:'desc', linkToWebsite:'linkToWebsite', linkToPicture:'linkToPicture', age:12, primaryAddress:addr1, secondaryAddress:addr2}); | |
} | |
function getName(string key) constant returns (string) { | |
return map[key].name; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment