-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBank.sol
More file actions
43 lines (33 loc) · 1.05 KB
/
Bank.sol
File metadata and controls
43 lines (33 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
pragma solidity ^0.4.19;
///@title SimpleBank
///@author Akshay
contract SimpleBank{
mapping (address => uint) private balances;
address private owner;
event LogDepositMade(address accountAddress, uint amount);
event status(uint indexed statusCode);
function SimpleBank() public{
owner = msg.sender;
}
function Deposit(address owner, uint amount) public returns(uint){
if(amount > 10 ){
balances[owner] += amount;
LogDepositMade(msg.sender,msg.value);
return balances[msg.sender];
}
else{
return amount;
}
}
function Withdraw(address owner,uint amount) public returns(uint){
balances[owner] -= amount;
LogDepositMade(msg.sender,msg.value);
return balances[msg.sender];
}
function checkBalance(address owner) public constant returns(uint balance){
return balances[owner];
}
function() public{
throw;
}
}