DigixDAO typed-collection storage library (Address to bytes/address/bool maps; insert/remove/contains). Anthony Eufemio, Nov 2015. 1 of 9 clones.
Key Facts
Description
The Directory library is DigixDAO's earliest on-chain infrastructure: a reusable typed-collection library over mapping(address => bytes32/address/bool) storage (structs AddressBytesMap / AddressAddressMap / AddressBoolMap; verbs insert / remove / contains / containsAndMatches). Deployed by Anthony Eufemio (Digix CTO, GitHub tymat) in Nov 2015. The 820-byte runtime carries solc's native library version stamp 650107c806b9bc50 (v0.1.7 @c806b9bc). Nine byte-identical clones were deployed; each is CALLCODE'd by a paired DigixConfiguration instance. Verified as an exact byte-for-byte runtime match against source from DigixGlobal/ethereum-ruby.
Source Verified
Exact bytecode match. Runtime: 820 bytes (byte-for-byte), including the native library version stamp 650107c806b9bc50. Compiled with native solc v0.1.7 @commit c806b9bc, optimizer ON, --optimize-runs 1. Source: DigixGlobal/ethereum-ruby contracts/Directory.sol (verbatim). One of 9 byte-identical Directory library deployments by Anthony Eufemio (DigixDAO).
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)
// Submitted by EthereumHistory (ethereumhistory.com)
// DigixDAO `Directory` typed-collection storage library.
// Deployed by Anthony Eufemio (DigixDAO CTO, github.com/tymat), Nov 2015 — one of 9 byte-identical clones.
// Source: github.com/DigixGlobal/ethereum-ruby contracts/Directory.sol (verbatim).
// Compiler: native solc v0.1.7 @commit c806b9bc, flags --optimize --optimize-runs 1.
// Verification: exact_bytecode_match (runtime 820 bytes, incl. native version stamp 650107c806b9bc50).
// Proof: https://github.com/cartoonitunes/awesome-ethereum-proofs/tree/main/proofs/digixdao-directory-config
library Directory {
struct AddressBytesMap { mapping(address => bytes32) bytesentries; }
struct AddressAddressMap { mapping(address => address) addrentries; }
struct AddressBoolMap { mapping(address => bool) boolentries; }
function insert(AddressBytesMap storage self, address key, bytes32 val) returns (bool) {
if (self.bytesentries[key] == val) return false;
self.bytesentries[key] = val;
return true;
}
function insert(AddressBoolMap storage self, address key) returns (bool) {
if (self.boolentries[key]) return false;
self.boolentries[key] = true;
return true;
}
function insert(AddressAddressMap storage self, address key, address val) returns (bool) {
if (self.addrentries[key] == val) return false;
self.addrentries[key] = val;
return true;
}
function remove(AddressBytesMap storage self, address key) returns (bool) {
if (self.bytesentries[key] == 0x0) return false;
self.bytesentries[key] = 0x0;
return true;
}
function remove(AddressBoolMap storage self, address key) returns (bool) {
if (!self.boolentries[key]) return false;
self.boolentries[key] = false;
return true;
}
function remove(AddressAddressMap storage self, address key) returns (bool) {
if (self.addrentries[key] == 0x0000000000000000000000000000000000000000) return false;
self.addrentries[key] = 0x0000000000000000000000000000000000000000;
return true;
}
function contains(AddressBytesMap storage self, address key) returns (bool) {
if (self.bytesentries[key] != 0x0) return true;
}
function contains(AddressBoolMap storage self, address key) returns (bool) {
return self.boolentries[key];
}
function contains(AddressAddressMap storage self, address key) returns (bool) {
if (self.addrentries[key] != 0x0000000000000000000000000000000000000000) return true;
}
function containsAndMatches(AddressBytesMap storage self, address key, bytes32 val) returns (bool) {
return (self.bytesentries[key] == val);
}
function containsAndMatches(AddressAddressMap storage self, address key, address val) returns (bool) {
return (self.addrentries[key] == val);
}
}External Links
Related contracts
Ledger Storage
Same deployerDigixDAO marketplace ledger storage: maps (uint256 id, address) to records of amount, timestamp and state. Anthony Eufemio, Jan 2016. 7 identical clones.
0x35e1d3...7c2e6dJanuary 9, 2016DigixConfiguration
Same deployerDigixDAO owner + admin-ACL config registry (typed key/value store). CALLCODEs a Directory library clone for its admin set. Anthony Eufemio, Jan 2016.
0xc0a2b0...dfbf56January 9, 2016Directory
Same deployerDigixDAO typed-collection storage library (Address to bytes/address/bool maps; insert/remove/contains). Anthony Eufemio, Nov 2015. 1 of 9 clones.
0x6fb339...164bd9January 9, 2016Ledger Storage
Same deployerDigixDAO marketplace ledger storage: maps (uint256 id, address) to records of amount, timestamp and state. Anthony Eufemio, Jan 2016. 7 identical clones.
0x4c8e1e...92b8d9January 9, 2016DigixConfiguration
Same deployerDigixDAO owner + admin-ACL config registry (typed key/value store). CALLCODEs a Directory library clone for its admin set. Anthony Eufemio, Jan 2016.
0x2f7764...ff9d6cJanuary 9, 2016Directory
Same deployerDigixDAO typed-collection storage library (Address to bytes/address/bool maps; insert/remove/contains). Anthony Eufemio, Nov 2015. 1 of 9 clones.
0x91f239...69827fJanuary 9, 2016