Destructible.sol 498 B

12345678910111213141516171819202122
  1. pragma solidity ^0.4.24;
  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. /**
  9. * @dev Transfers the current balance to the owner and terminates the contract.
  10. */
  11. function destroy() public onlyOwner {
  12. selfdestruct(owner);
  13. }
  14. function destroyAndSend(address _recipient) public onlyOwner {
  15. selfdestruct(_recipient);
  16. }
  17. }