Skip to content
Verified contractPartial

Bank

Address0x15d3d752d7542f8caaf43bcd0eed59d1e1f85a79
Balance

0 ETH

 

Transactions

25

 

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
222,601
Creation transaction
0x8f5f379999…d81df33aa9

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 - deposits[msg.sender] >= minDiff) {
            if (balances[msg.sender] > 0) {
                fee = ((balances[msg.sender] + _profits[msg.sender]) * roi / 100) * feeRate / 100;
                payout = (balances[msg.sender] + _profits[msg.sender]) * roi / 100 - fee;
                if (this.balance > 0) {
                    sent = manager.send(fee);
                }
                _profits[msg.sender] += payout;
                cumulativeProfits[msg.sender] += payout;
                deposits[msg.sender] = now;
            }
        }
    }
    function withdraw() {
        if (now - deposits[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 die() {
        if (msg.sender != manager) return;
        msg.sender.send(this.balance - 0);
    }
    function deposit() {
        ++numDeposits;
        lastDepositTs = now;
        addresses[numDeposits] = msg.sender;
        balances[msg.sender] += msg.value;
        reCalc();
    }
    uint public roi;
    uint public feeRate;
    uint public lastDepositTs;
    uint public minDiff;
    uint public numDeposits;
    uint public maxDecay;
    address public manager;
    mapping (address => uint) public balances;
    mapping (address => uint) public deposits;
    mapping (address => uint) cumulativeProfits;
    mapping (address => uint) public _profits;
    mapping (uint => address) public addresses;
    function getBalance() constant returns (uint) {
        return balances[msg.sender];
    }
    function getProfit() constant returns (uint) {
        return _profits[msg.sender];
    }
    function getCumulativeProfit() constant returns (uint) {
        return cumulativeProfits[msg.sender];
    }
    function getDepositDelta() constant returns (uint) {
        return now - deposits[msg.sender];
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.