Guest User

Untitled

a guest
Jun 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. pragma solidity 0.4.21;
  2.  
  3. contract Forwarder {
  4.  
  5. address public destinationAddress;
  6. event LogForwarded(address indexed sender, uint amount);
  7. event LogFlushed(address indexed sender, uint amount);
  8.  
  9. function Forwarder() public {
  10. destinationAddress = msg.sender;
  11. }
  12.  
  13. function() payable public {
  14. emit LogForwarded(msg.sender, msg.value);
  15. destinationAddress.transfer(msg.value);
  16. }
  17.  
  18. function flush() public {
  19. emit LogFlushed(msg.sender, address(this).balance);
  20. destinationAddress.transfer(address(this).balance);
  21. }
  22.  
  23. }
Add Comment
Please, Sign In to add comment