Verified contractPartial
Bank
Address0x59a62444ed992eb6c3cbd87e362664e9e8f0c66d
- Balance
0 ETH
- Transactions
33
- Compiler
solc 0.1.3
- Same code
Only this contract
Details
- Compiler
- solc 0.1.3+commit.028f561d
- Language
- solidity
- Optimization
- No
- License
- Not stated
- Match
- Partialcreation code: no, runtime code: yes
- Verified on Sourcify
- Created in block
- 197,740
- Creation transaction
- 0x2337cf2b80…ced821247c
Bank.sol
// Recovered by EthereumHistory (ethereumhistory.com) -sw
contract Bank {
address owner;
function Bank() {
owner = msg.sender;
numDeposits = 0;
roi = 120;
minDiff = 50;
tDiff = 0;
}
uint public roi;
uint public lastTs;
uint public tDiff;
uint public minDiff;
uint public numDeposits;
mapping (address => uint) balances;
mapping (address => uint) timestamps;
mapping (address => uint) profits;
function getBalance(address a) constant returns (uint) {
if (msg.sender != a) {
return;
}
return balances[a];
}
function getProfit(address a) constant returns (uint) {
if (msg.sender != a) {
return;
}
return profits[a];
}
function getDepositDelta(address a) constant returns (uint) {
if (msg.sender != a) {
return;
}
return now - timestamps[a];
}
function deposit() {
++numDeposits;
lastTs = now;
timestamps[msg.sender] = lastTs;
profits[msg.sender] += msg.value * roi / 100;
balances[msg.sender] += msg.value;
}
function withdraw(address a) {
if (msg.sender != a) {
return;
}
if (now - timestamps[a] >= minDiff) {
msg.sender.send(balances[a] + profits[a]);
profits[a] = 0;
balances[a] = 0;
} else {
tDiff = now;
}
}
}
Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.