Change killable to destructible and kill to destroy
This commit is contained in:
@ -2,7 +2,7 @@ pragma solidity ^0.4.8;
|
||||
|
||||
|
||||
import './payment/PullPayment.sol';
|
||||
import './lifecycle/Killable.sol';
|
||||
import './lifecycle/Destructible.sol';
|
||||
|
||||
|
||||
/*
|
||||
@ -10,7 +10,7 @@ import './lifecycle/Killable.sol';
|
||||
*
|
||||
* This bounty will pay out to a researcher if they break invariant logic of the contract.
|
||||
*/
|
||||
contract Bounty is PullPayment, Killable {
|
||||
contract Bounty is PullPayment, Destructible {
|
||||
bool public claimed;
|
||||
mapping(address => address) public researchers;
|
||||
|
||||
|
||||
@ -24,8 +24,8 @@ contract MultisigWallet is Multisig, Shareable, DayLimit {
|
||||
Shareable(_owners, _required)
|
||||
DayLimit(_daylimit) { }
|
||||
|
||||
// kills the contract sending everything to `_to`.
|
||||
function kill(address _to) onlymanyowners(keccak256(msg.data)) external {
|
||||
// destroys the contract sending everything to `_to`.
|
||||
function destroy(address _to) onlymanyowners(keccak256(msg.data)) external {
|
||||
selfdestruct(_to);
|
||||
}
|
||||
|
||||
|
||||
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