Skip to content
Verified contractPartial

Bank

Address0xf5e713bf02733eeba7e5cfe8478fe2d9dfafcf85
Balance

0 ETH

 

Transactions

22

 

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,358
Creation transaction
0x66cc3d426b…bc6ce52031

Bank.sol

// Recovered by EthereumHistory (ethereumhistory.com) -sw
contract Bank {
    address owner;

    function Bank() {
        owner = msg.sender;
        numDeposits = 0;
        roi = 120;
        tDiff = 0;
    }

    uint public roi;
    uint public lastTs;
    uint public tDiff;
    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]) / 3600 / 24 >= 0) {
            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.