Destructible.sol 535 B

12345678910111213141516171819202122232425
  1. pragma solidity ^0.4.23;
  2. import "../ownership/Ownable.sol";
  3. /**
  4. * @title Destructible
  5. * @dev Base contract that can be destroyed by owner. All funds in contract will be sent to the owner.
  6. */
  7. contract Destructible is Ownable {
  8. constructor() public payable { }
  9. /**
  10. * @dev Transfers the current balance to the owner and terminates the contract.
  11. */
  12. function destroy() onlyOwner public {
  13. selfdestruct(owner);
  14. }
  15. function destroyAndSend(address _recipient) onlyOwner public {
  16. selfdestruct(_recipient);
  17. }
  18. }