The storage contract of the ConsenSys dapp store prototype: a list of records, each a mapping from integer keys to lists of integer values, writable only by its admin.
Key Facts
Description
EternalDB keeps the data for the ConsenSys dapp store prototype separate from the model contracts that use it, so that a model can be replaced without losing records. Entries are 1-indexed so that a zero id can mean 'not found'.
Source Verified
Exact runtime and creation bytecode match with soljson v0.1.6+commit.d41f8b7c, optimizer on. Source: github.com/ConsenSysMesh/dapp-store-contracts @ 0850f857 (contracts/EternalDB.sol, author original, verbatim). Verified on Etherscan. Not submitted to Sourcify: its oldest supported compiler is v0.1.7.
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)
contract EternalDB {
address public admin;
mapping (uint => uint[])[] data;
modifier restricted { if (msg.sender == admin) _ }
function EternalDB() {
admin = msg.sender;
data.length = 1; // 1-indexed, so things like mappings to ids will work
}
function transfer_ownership(address _admin) restricted {
admin = _admin;
}
function count() constant returns(uint) {
return data.length - 1;
}
function has(uint id) constant returns(bool) {
return id <= count();
}
function new_entry() restricted returns(uint) {
return data.length++;
}
function add(uint id, uint key, uint value) restricted {
uint[] attribute = data[id][key];
attribute[attribute.length++] = value;
}
function get_length(uint id, uint key) constant returns(uint) {
return data[id][key].length;
}
function get_entry(uint id, uint key, uint index) constant returns(uint) {
return data[id][key][index];
}
function get_all(uint id, uint key) constant returns(uint[]) {
return data[id][key];
}
function clear(uint id, uint key) restricted {
data[id][key].length = 0;
}
function delete_entry(uint id, uint key, uint index) restricted {
uint[] attribute = data[id][key];
for (uint i = index; i + 1 < attribute.length; i++) {
attribute[i] = attribute[i + 1];
}
attribute.length--;
}
}External Links
Related contracts
ModelCoordinator
Same deployerThe registry of the ConsenSys dapp store prototype that grants model contracts write access to the shared EternalDB.
0x288dcd...a8523eNovember 7, 2015LicenseModel
Same deployerThe licence model of the ConsenSys dapp store prototype: records which user holds a licence for which dapp.
0x09e79b...496375November 7, 2015DualIndex
Same deployerA two-key uint lookup table writable only by its admin, used by the ConsenSys dapp store prototype for licences.
0xb549cd...ac249eNovember 7, 2015AttributeModel
Same deployerThe attribute model of the ConsenSys dapp store prototype: stores typed attributes attached to dapps and developers.
0x7e75db...0ba8c7November 7, 2015ReviewModel
Same deployerThe review model of the ConsenSys dapp store prototype: stores ratings and reviews of dapp versions.
0x6f07e5...21b66bNovember 7, 2015DappModel
Same deployerThe dapp model of the ConsenSys dapp store prototype: creates, validates and updates dapp listings kept in an EternalDB.
0xab4192...c9f9eeNovember 7, 2015