Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
pragma solidity ^0.4.24;
import "https://github.com/OpenZeppelin/openzeppelin-solidity/contracts/lifecycle/Destructible.sol";
contract SimpleBank is Destructible {
mapping (address => uint) private balances;
address public owner;
event LogDepositMade(address accountAddress, uint amount);
constructor() public {
owner = msg.sender;
}
function deposit() public payable returns (uint) {
require((balances[msg.sender] + msg.value) >= balances[msg.sender]);
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