This contract is not yet documented
Know something about this contract? Switch to the History tab and suggest an edit to help preserve Ethereum history.
Key Facts
Source Verified
Sourcify partial match (chain 1, address 0x709013617BB52c49003a9c8F3035Ef9ec9912B17). Compiled with solc 0.1.3+commit.028f561d, optimizer on, contract Lock.
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
This contract has verified source code.
View Verification ProofShow source code (Solidity)
// Recovered by EthereumHistory (ethereumhistory.com) -sw
contract Lock {
address owner;
function setDeposit(uint _deposit) {
if (msg.sender != owner) return;
deposit = _deposit;
}
function open() {
if (msg.sender == owner || msg.sender == user) {
isOpen += 1;
Open();
return;
}
if (isOpen > 0 || msg.value < deposit) {
msg.sender.send(msg.value);
} else {
isOpen += 1;
Open();
openTime = now;
user = msg.sender;
}
}
uint deposit;
uint price;
address user;
uint isOpen;
uint openTime;
uint closeTime;
uint timeBlock;
event Open();
event Close();
function Lock(uint _deposit, uint _price, uint _timeBlock) {
owner = msg.sender;
isOpen = 0;
deposit = _deposit;
price = _price;
if (_timeBlock == 0) timeBlock = 1;
else timeBlock = _timeBlock;
openTime = now;
user = msg.sender;
}
function setTimeBlock(uint _timeBlock) {
if (msg.sender != owner) return;
timeBlock = _timeBlock;
}
function costs() returns (uint) {
return price * (now - openTime + timeBlock) / timeBlock;
}
function setPrice(uint _price) {
if (msg.sender != owner) return;
price = _price;
}
function close() {
if (isOpen == 0) return;
if (msg.sender == owner && owner == user) {
isOpen = 0;
Close();
return;
}
if (msg.sender == user) {
uint c = costs();
if (c > deposit) {
owner.send(deposit);
} else {
user.send(deposit - c);
owner.send(c);
}
isOpen = 0;
user = owner;
Close();
}
}
function closedByOwner() {
if (msg.sender != owner) return;
if (costs() > deposit) {
owner.send(deposit);
isOpen = 0;
user = owner;
}
}
}External Links
Related contracts
Contract 0xdf373f...b3f825
Same deployerA pricing and deposit management contract from August 11, 2015, featured by ether.camp founder Roman Mandeleil as a notable early Frontier contract.
0xdf373f...b3f825August 11, 2015Wallet
Same deployerGav Wood's multisignature daily-limit wallet, deployed in November 2015 at block 548481.
0x3025cb...530b2aNovember 16, 2015