-
Notifications
You must be signed in to change notification settings - Fork 1
/
EtherealTipJar.sol
38 lines (30 loc) · 1.18 KB
/
EtherealTipJar.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
pragma solidity ^0.4.18;
import "./EtherealFoundationOwned.sol";
import "./EtherealToken.sol";
contract EtherealTipJar is EtherealFoundationOwned{
string public constant CONTRACT_NAME = "EtherealTipJar";
string public constant CONTRACT_VERSION = "B";
string public constant QUOTE = "'The universe never did make sense; I suspect it was built on government contract.' -Robert A. Heinlein";
event RecievedTip(address indexed from, uint256 value);
function () payable public {
RecievedTip(msg.sender, msg.value);
}
event TransferedEth(address indexed to, uint256 value);
function TransferEth(address to, uint256 value) public onlyOwner{
require(this.balance >= value);
if(value > 0)
{
to.transfer(value);
TransferedEth(to, value);
}
}
event TransferedERC20(address tokenContract, address indexed to, uint256 value);
function TransferERC20(address tokenContract, address to, uint256 value) public onlyOwner{
EtherealToken token = EtherealToken(tokenContract);
if(value > 0)
{
token.transfer(to, value);
TransferedERC20(tokenContract,to, value);
}
}
}