Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pragma solidity 0.4.21;
- contract Forwarder {
- address public destinationAddress;
- event LogForwarded(address indexed sender, uint amount);
- event LogFlushed(address indexed sender, uint amount);
- function Forwarder() public {
- destinationAddress = msg.sender;
- }
- function() payable public {
- emit LogForwarded(msg.sender, msg.value);
- destinationAddress.transfer(msg.value);
- }
- function flush() public {
- emit LogFlushed(msg.sender, address(this).balance);
- destinationAddress.transfer(address(this).balance);
- }
- }
Add Comment
Please, Sign In to add comment