-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #593 from daostack/wallet
add wallet.sol
- Loading branch information
Showing
2 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pragma solidity ^0.5.2; | ||
import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; | ||
|
||
|
||
contract Wallet is Ownable { | ||
|
||
event ReceiveEther(address indexed _sender, uint256 _value); | ||
event Pay(address indexed _sender, uint256 _value); | ||
|
||
function() external payable { | ||
emit ReceiveEther(msg.sender, msg.value); | ||
} | ||
|
||
function pay(address payable _beneficiary) public onlyOwner { | ||
uint256 amount = address(this).balance; | ||
_beneficiary.transfer(amount); | ||
emit Pay(_beneficiary, amount); | ||
} | ||
|
||
} |
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