Verified contractPartial
Bank
Address0xbf4aa23fc8a11f84f6ce07a11b1f7455b732eb1b
- Balance
0.000062 ETH
- Transactions
26
- 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
- 219,546
- Creation transaction
- 0xc90d5adc0f…90ab8a3b4c
Bank.sol
// Recovered by EthereumHistory (ethereumhistory.com) -sw
contract Bank {
bool sent;
uint fee;
uint payout;
function Bank() {
manager = msg.sender;
numDeposits = 0;
roi = 120;
feeRate = 3;
minDiff = 30;
maxDecay = 90;
}
function reCalc() {
if (now - timestamps[msg.sender] >= minDiff) {
fee = (balances[msg.sender] * roi / 100) * feeRate / 100;
payout = balances[msg.sender] * roi / 100 - fee;
manager.send(fee);
profits[msg.sender] += payout;
cumulativeProfits[msg.sender] += payout;
timestamps[msg.sender] = now;
}
}
function getProfit() constant returns (uint) {
return profits[msg.sender];
}
function getCumulativeProfit() constant returns (uint) {
return cumulativeProfits[msg.sender];
}
function withdraw() {
if (now - timestamps[msg.sender] >= minDiff) {
if (this.balance > balances[msg.sender] + payout) {
sent = msg.sender.send(balances[msg.sender] + payout);
if (sent) {
profits[msg.sender] = 0;
balances[msg.sender] = 0;
}
}
}
}
function withdrawProfit() {
if (now - timestamps[msg.sender] >= minDiff) {
if (this.balance > payout) {
sent = msg.sender.send(payout);
if (sent) {
timestamps[msg.sender] = now;
profits[msg.sender] -= profits[msg.sender];
reCalc();
}
}
}
}
function getBalance() constant returns (uint) {
return balances[msg.sender];
}
uint public roi;
function deposit() {
++numDeposits;
lastDepositTs = now;
depositors[numDeposits] = msg.sender;
balances[msg.sender] += msg.value;
reCalc();
}
uint public feeRate;
function getDepositDelta() constant returns (uint) {
return now - timestamps[msg.sender];
}
uint public lastDepositTs;
uint public minDiff;
uint public numDeposits;
uint public maxDecay;
address public manager;
mapping (address => uint) balances;
mapping (address => uint) timestamps;
mapping (address => uint) cumulativeProfits;
mapping (address => uint) profits;
mapping (uint => address) depositors;
}
Compiler settingsShow
{
"optimizer": {
"runs": 200,
"enabled": false
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.