pragma solidity ^0.4.15; contract ArgentWallet { address public owner; mapping(address => uint) public balances; event Deposit(address indexed _from, uint _value); event Withdrawal(address indexed _to, uint _value); modifier onlyOwner() { require(msg.sender == owner); _; } function ArgentWallet() public { owner = msg.שsender; } function deposit() public payable { balances[msg.sender] += msg.value; Deposit(msg.sender, msg.value); } function withdraw(uint _amount) public { require(_amount <= balances[msg.sender]); balances[msg.sender] -= _amount; msg.sender.transfer(_amount); Withdrawal(msg.sender, _amount); } function getBalance() public constant returns (uint) { return balances[msg.sender]; } function transfer(address _to, uint _amount) public { require(_amount <= balances[msg.sender]); balances[msg.sender] -= _amount; balances[_to] += _amount; Withdrawal(_to, _amount); } }
0.4.15