A marketplace listing from an early decentralised marketplace dapp: an admin and a metadata string describing the market.
Key Facts
Description
Market holds the description of one market for the marketplace dapp. Orders placed in it are separate Order contracts.
Source Verified
Exact runtime and creation bytecode match with soljson v0.1.1+commit.6ff4cd6, optimizer off. Source: github.com/gitter-badger/dapp, revision blob 25ba190891 (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 Keystore{
mapping(address=>Key) keys;
struct Key{
string data;
uint timestamp;
}
function setKey(string data){
keys[tx.origin].data = data;
keys[tx.origin].timestamp = now;
}
function revokeKey(){
keys[tx.origin].data = '';
keys[tx.origin].timestamp = 0;
}
function getKeyData(address addr) constant returns(string){
return keys[addr].data;
}
function getKeyTimestamp(address addr) constant returns(uint){
return keys[addr].timestamp;
}
}
contract Market{
address admin;
string meta;
function Market(string _meta){
admin = tx.origin;
meta = _meta;
}
function getAdmin() constant returns(address){
return admin;
}
function setMeta(string _meta){
if(tx.origin!=admin) return;
meta = _meta;
}
function getMeta() constant returns(string){
return meta;
}
}
contract Order{
address buyer;
address merchant;
address admin;
uint fee;
uint disputeSeconds;
string meta;
uint status;
uint received;
uint timestamp;
uint shippedAt;
uint constant initialized = 0;
uint constant cancelled = 1;
uint constant shipped = 2;
uint constant finalized = 3;
uint constant disputed = 4;
uint constant resolved = 5;
Message[] messages;
struct Message{
address sender;
string ciphertext;
uint timestamp;
}
Update[] updates;
struct Update{
address sender;
uint status;
uint timestamp;
}
function Order(
string _meta
,address _merchant
,address _admin
,uint _fee
,uint _disputeSeconds
){
buyer = tx.origin;
meta = _meta;
merchant = _merchant;
admin = _admin;
fee = _fee;
disputeSeconds = _disputeSeconds;
timestamp = now;
}
function addMessage(string text){
if(tx.origin != buyer && tx.origin != merchant && tx.origin != admin)
return;
messages[messages.length++] = Message(tx.origin,text,now);
}
function getMessagesCount() constant returns(uint){
return messages.length;
}
function getMessageSender(uint index) constant returns(address){
return messages[index].sender;
}
function getMessageCyphertext(uint index) constant returns(string){
return messages[index].ciphertext;
}
function getMessageTimestamp(uint index) constant returns(uint){
return messages[index].timestamp;
}
function(){
received += msg.value;
}
function getMeta() constant returns(string){
return meta;
}
function getBuyer() constant returns(address){
return buyer;
}
function getMerchant() constant returns(address){
return merchant;
}
function getAdmin() constant returns(address){
return admin;
}
function getFee() constant returns(uint){
return fee;
}
function getStatus() constant returns(uint){
return status;
}
function getReceived() constant returns(uint){
return received;
}
function getTimestamp() constant returns(uint){
return timestamp;
}
function addUpdate(uint _status){
status = _status;
updates[updates.length++] = Update(tx.origin,_status,now);
}
function cancel(){
if(status != initialized)
return;
if(tx.origin != buyer && tx.origin != merchant)
return;
var isSent = buyer.send(this.balance);
if(!isSent) return;
addUpdate(cancelled);
}
function markAsShipped(){
if(status != initialized)
return;
if(tx.origin != merchant)
return;
shippedAt = now;
addUpdate(shipped);
}
function finalize(){
if(status != shipped)
return;
if(tx.origin != buyer && tx.origin != merchant)
return;
if(tx.origin == merchant && now - shippedAt < disputeSeconds)
return;
var isSent = merchant.send(this.balance);
if(!isSent) return;
addUpdate(finalized);
}
function dispute(){
if(tx.origin != buyer)
return;
if(status != shipped)
return;
if(now - shippedAt > disputeSeconds)
return;
if(admin==0)
return;
addUpdate(disputed);
}
function resolve(uint buyerAmount){
if(status!=disputed)
return;
if(tx.origin != admin)
return;
if(buyerAmount>0)
buyer.send(buyerAmount);
var merchantAmount = this.balance-buyerAmount;
if(merchantAmount>0)
merchant.send(merchantAmount);
addUpdate(resolved);
}
}
contract Store{
address merchant;
string meta;
function Store(string _meta){
merchant = tx.origin;
meta = _meta;
}
function getMerchant() constant returns(address){
return merchant;
}
function setMeta(string _meta){
if(tx.origin!=merchant) return;
meta = _meta;
}
function getMeta() constant returns(string){
return meta;
}
}External Links
Related contracts
Contract 0x3b33fd...67cc6e
Same deployerA 2015 public key directory that keys every entry off tx.origin instead of msg.sender.
0x3b33fd...67cc6eSeptember 25, 2015Contract 0x68656b...099a3c
Same deployerA 2015 public key directory that keys every entry off tx.origin instead of msg.sender.
0x68656b...099a3cSeptember 25, 2015Contract 0xb1cae1...3af281
Same deployerA 2015 public key directory that keys every entry off tx.origin instead of msg.sender.
0xb1cae1...3af281September 25, 2015Contract 0xd0f28a...a2b650
Same deployerA 2015 public key directory that keys every entry off tx.origin instead of msg.sender.
0xd0f28a...a2b650September 25, 2015Contract 0x6fe164...c7ef7a
Same deployerA 2015 public key directory that keys every entry off tx.origin instead of msg.sender.
0x6fe164...c7ef7aSeptember 25, 2015KeyRegistry
Same deployerA 2015 public key directory that keys every entry off tx.origin instead of msg.sender.
0x016c93...befc1aSeptember 25, 2015