Merge pull request #187 from DavidKnott/change-killable-contract-to-destructible
Change killable to destructible and kill to destroy
This commit is contained in:
15
contracts/lifecycle/Destructible.sol
Normal file
15
contracts/lifecycle/Destructible.sol
Normal file
@ -0,0 +1,15 @@
|
||||
pragma solidity ^0.4.8;
|
||||
|
||||
|
||||
import "../ownership/Ownable.sol";
|
||||
|
||||
|
||||
/*
|
||||
* Destructible
|
||||
* Base contract that can be destroyed by owner. All funds in contract will be sent to the owner.
|
||||
*/
|
||||
contract Destructible is Ownable {
|
||||
function destroy() onlyOwner {
|
||||
selfdestruct(owner);
|
||||
}
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
pragma solidity ^0.4.8;
|
||||
|
||||
|
||||
import "../ownership/Ownable.sol";
|
||||
|
||||
|
||||
/*
|
||||
* Killable
|
||||
* Base contract that can be killed by owner. All funds in contract will be sent to the owner.
|
||||
*/
|
||||
contract Killable is Ownable {
|
||||
function kill() onlyOwner {
|
||||
selfdestruct(owner);
|
||||
}
|
||||
}
|
||||
@ -4,18 +4,18 @@ pragma solidity ^0.4.8;
|
||||
import "../ownership/Ownable.sol";
|
||||
import "../token/ERC20Basic.sol";
|
||||
|
||||
/// @title TokenKillable:
|
||||
/// @title TokenDestructible:
|
||||
/// @author Remco Bloemen <remco@2π.com>
|
||||
///.Base contract that can be killed by owner. All funds in contract including
|
||||
///.Base contract that can be destroyed by owner. All funds in contract including
|
||||
/// listed tokens will be sent to the owner
|
||||
contract TokenKillable is Ownable {
|
||||
contract TokenDestructible is Ownable {
|
||||
|
||||
/// @notice Terminate contract and refund to owner
|
||||
/// @param tokens List of addresses of ERC20 or ERC20Basic token contracts to
|
||||
// refund
|
||||
/// @notice The called token contracts could try to re-enter this contract.
|
||||
// Only supply token contracts you
|
||||
function kill(address[] tokens) onlyOwner {
|
||||
function destroy(address[] tokens) onlyOwner {
|
||||
|
||||
// Transfer tokens to owner
|
||||
for(uint i = 0; i < tokens.length; i++) {
|
||||
Reference in New Issue
Block a user