Skip to content

Instantly share code, notes, and snippets.

@bobkilla
Created February 4, 2017 14:46
Show Gist options
  • Save bobkilla/b9d8b9cf16258da786b017f3f48fb702 to your computer and use it in GitHub Desktop.
Save bobkilla/b9d8b9cf16258da786b017f3f48fb702 to your computer and use it in GitHub Desktop.
Simple solidity membership contract
pragma solidity ^0.4.9;
contract Organization {
struct Member { // Struct
string nickname;
string city;
bool active;
}
mapping(address=>Member) public members;
uint256 public fee;
function Organization(uint256 _fee) {
fee = _fee;
}
function register(string _nickname, string _city) payable {
if(msg.value == fee){
members[msg.sender] = Member( {
nickname: _nickname,
city: _city,
active: true
});
} else {
throw;
}
}
}
@yaxx
Copy link

yaxx commented Feb 4, 2017

interesting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment