Owner-controlled member registry using sequential id + mapping storage.
Key Facts
Description
Owner-controlled member registry using sequential id + mapping storage. Functions include Members(), addMember(address), removeMember(address), isMember(address), kill(). Verified with soljson-v0.1.1+commit.6ff4cd6 and optimizer OFF.
Source Verified
Backfilled from awesome-ethereum-proofs PR #40.
Historian Categories
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
Frontier Era
The initial release of Ethereum. A bare-bones implementation for technical users.
Bytecode Overview
Verified Source Available
Source verified through compiler archaeology and exact bytecode matching.
View Verification ProofShow source code (Solidity)
contract owned {
address owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner { if (msg.sender == owner) _ }
}
contract Members is owned {
uint nextId = 0;
uint count = 0;
mapping(uint => address) members;
mapping(address => bool) isMember;
mapping(address => uint) memberId;
modifier onlyMembers() {
if (isMember[msg.sender] == true) _
}
function Members() {
isMember[msg.sender] = true;
members[nextId] = msg.sender;
memberId[msg.sender] = nextId;
count++;
nextId++;
}
function kill() {
if (msg.sender == owner) {
suicide(owner);
}
}
function addMember(address account) onlyMembers returns (bool) {
if (isMember[account]) {
return false;
}
isMember[account] = true;
members[nextId] = account;
memberId[account] = nextId;
count++;
nextId++;
return true;
}
function removeMember(address account) onlyMembers returns (bool) {
if (!isMember[account]) {
return false;
}
isMember[account] = false;
members[memberId[account]] = 0;
count--;
return true;
}
function checkMembership(address account) returns (bool) {
return isMember[account];
}
}External Links
Related contracts
MemberRegistry
Same deployerOwner-controlled dynamic-array member registry.
0x1f3b19...7c161aAugust 13, 2015Members
Same deployerOwner-controlled member registry with array + mapping tracking.
0xaeb2ac...a5fd37August 14, 2015MembershipRoster
Same deployerAn Ethereum Public Trust roster contract for adding, removing, and checking members.
0xf1d327...aa0455August 14, 2015KillMul
Same deployerTest/utility contract with `suicide(address)` kill switch and a `multiply2` helper.
0x3e5e1f...7c78cdAugust 14, 2015EthereumAlarmClock
Same deployerThe first deployment of Piper Merriam's Ethereum Alarm Clock, a smart contract protocol for scheduling transactions at future block numbers, launched on Septemb
0xb0059e...cc0cc1September 22, 2015CallerPool
Same deployerThe bonded caller pool of the Ethereum Alarm Clock: callers post a bond, take turns being the designated executor, and forfeit it if they miss.
0x329219...fc3e8bSeptember 22, 2015