Last active
July 11, 2018 15:02
-
-
Save ashtewari/aa7ac8064302803d83aa3255d40faa2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.24; | |
contract SimpleBank { | |
mapping (address => uint) private balances; | |
event LogDepositMade(address accountAddress, uint amount); | |
address public owner; | |
constructor() public { | |
owner = msg.sender; | |
} | |
function deposit() public payable returns (uint) { | |
balances[msg.sender] += msg.value; | |
emit LogDepositMade(msg.sender, msg.value); | |
return balances[msg.sender]; | |
} | |
function balance() constant public returns (uint) { | |
return balances[msg.sender]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment