Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Killable to lifecycle #2044

Closed
Akira-Taniguchi opened this issue Jan 7, 2020 · 4 comments
Closed

Add Killable to lifecycle #2044

Akira-Taniguchi opened this issue Jan 7, 2020 · 4 comments

Comments

@Akira-Taniguchi
Copy link

🧐 Motivation

Is your feature request related to a specific problem? Is it just a crazy idea? Tell us about it!

Related to a specific issue

📝 Details

Please describe your feature request in detail.

I want to add Killable.sol under the lifecycle package
for example...

pragma solidity ^0.5.0;

contract Killable {
	address payable public _owner;

	constructor() internal {
		_owner = msg.sender;
	}

	function kill() public {
		require(msg.sender == _owner, "only owner method");
		selfdestruct(_owner);
	}
}
@abcoathup
Copy link
Contributor

Hi @Akira-Taniguchi ,

Thanks for starting this discussion. We may want to move this to the community forum (https://forum.openzeppelin.com/), as it is easier for the entire community to see and hence participate.

Are you using Destructable contracts yourself or have you some examples of them being used?

@Akira-Taniguchi
Copy link
Author

Are you using Destructable contracts yourself or have you some examples of them being used?

yes, I am using Destructable contracts myself.

[Killable contract]
https://github.com/dev-protocol/protocol/blob/master/contracts/src/common/lifecycle/Killable.sol

[Usage examples]
https://github.com/dev-protocol/protocol/blob/master/contracts/src/policy/Policy.sol#L12

@abcoathup

@abcoathup abcoathup changed the title killable Add Killable to lifecycle Jan 7, 2020
@abcoathup
Copy link
Contributor

Hi @Akira-Taniguchi,

I didn't realize, but there used to be Destructible in OpenZeppelin Contracts but it was removed for the following reason:

#1254
selfdestruct should be used with tons of care because it's not always safe to use, so it shouldn't be as simple as inheriting a contract.

There was also a recent discussion on reasons not to use selfdestruct in the Community Forum:
https://forum.openzeppelin.com/t/what-are-the-best-practices-for-building-selfdestruct-functionality/1508/4?u=abcoathup

I really appreciate you suggesting improvements to OpenZeppelin Contracts, but in this instance based on the above, I will close this Issue.

@Akira-Taniguchi
Copy link
Author

ok, thanks @abcoathup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants