forked from Etheraffle/Solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEtherReceiverStub.sol
38 lines (34 loc) · 1002 Bytes
/
EtherReceiverStub.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.24;
contract EtherReceiverStub {
address public etheraffle;
event LogEtherReceived(address fromWhere, uint howMuch, uint atTime);
/**
* @notice Sets the etheraffle var to the Etheraffle mangerial
* multisig account.
*
* @param _etheraffle The Etheraffle multisig account
*
*/
constructor(address _etheraffle) {
etheraffle = _etheraffle;
}
/**
* @notice Standard receive ether function. Fires event
* announcing arrivale of ETH.
*
*/
function receiveEther() payable external {
emit LogEtherReceived(msg.sender, msg.value, now);
}
/**
* @notice Deletes contract data and moves any funds to given
* address.
*
* @param _addr The destination address for any ether herein.
*
*/
function selfDestruct(address _addr) external {
require(msg.sender == etheraffle);
selfdestruct(_addr);
}
}