You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
590 B
24 lines
590 B
6 years ago
|
pragma solidity ^0.5.0;
|
||
7 years ago
|
|
||
|
contract Wallet {
|
||
|
|
||
|
event Deposit(address indexed _sender, uint _value);
|
||
|
|
||
6 years ago
|
function transferPayment(uint payment, address payable recipient) public {
|
||
7 years ago
|
recipient.transfer(payment);
|
||
|
}
|
||
|
|
||
6 years ago
|
function sendPayment(uint payment, address payable recipient) public {
|
||
5 years ago
|
require(recipient.send(payment), 'sendPayment failed');
|
||
7 years ago
|
}
|
||
|
|
||
6 years ago
|
function getBalance() public view returns(uint){
|
||
7 years ago
|
return address(this).balance;
|
||
|
}
|
||
5 years ago
|
|
||
6 years ago
|
function() external payable
|
||
7 years ago
|
{
|
||
|
if (msg.value > 0)
|
||
6 years ago
|
emit Deposit(msg.sender, msg.value);
|
||
7 years ago
|
}
|
||
|
}
|