-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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 Ownable2Step extension with 2-step transfer #3620
Conversation
this way it is accessible via inheritance
it could be a way for owner to cancel a transfer
Thank you @heldersepu. However, it is not clear that this is the solution we want to implement. I've been thinking we should add the two-step functionality as an opt-in feature into Ownable itself (so not as an extension). That way, the owner can choose if they prefer to use the two-step process for added safety. @Amxx What do you think of this? |
I personally don't like the name of this extensions. Calling it This I like the idea that it can be implemented as an extension. IMO extensions are the best way to "opt-in" without adding any bytecode to contracts that are not opting in. |
Still, I'm not really a fan of the proposed code. What I would do:
|
I'd feel comfortable making the choice to include 2-step transfer by default with Ownable. Do you think users would be against that? |
I would love to Ownable have a 2 step transfer by default. We've built our own Ownable that does that, and I would love to get rid of it haha |
Ye, to me the current ... but I'm fine with any other name (maybe |
|
I wish we had statistic to back up our decisions on this topic ... My feeling is that most developers are fine with .. so no I would not change the existing |
Small world, we did the same, that is why I decided to contribute back what we did... |
I agree with @Amxx on making it an extension to reduce the amount of bytecode for users who do not want to opt-in. So using something like |
That would break ERC173 compliance. Big no to me |
One thing I'd like to point out is that, even though is seems "unsafe" to transferOwnership directly, that is just like sending ERC20 tokens directly with no receive function on if the contract is a receiver. That is in retrospect a bad idea, but that is how the ecosystem has been working for years. IMO changing that such a fundamental things would create more confusion then anything. |
I also think its important for a contract to be able to renounce ownership ... which is difficult to do in a clean way with the two step process. So if we override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great work @heldersepu championing this, and thanks for the patience!
Woohoo, your important contribution to this open-source project has earned you a GitPOAP! GitPOAP: 2022 OpenZeppelin Contracts Contributor: Head on over to GitPOAP.io and connect your GitHub account to mint! |
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com> Co-authored-by: Francisco <frangio.1@gmail.com>
@frangio @Amxx https://github.com/lukso-network/lsp-smart-contracts/blob/develop/contracts/Custom/ClaimOwnership.sol Just to curious to have your feedbacks on it, regarding the naming |
I wonder if we should use |
@CJ42 I don't think that
that feel like someone can put a claim of ownership, and that later if uncontested it will become reality... ... now, english is my 3rd language, so take my feedback with a grain of salt ... So no I don't think that |
Great that we finally, after years, get a 2 step transfer of ownership process ! Just an additional idea (suggestion). I used the synthetix ... and why not just add these functions to
|
I also argued above for including the 2-step functionality directly in Ownable and I still believe it's the best option. We couldn't get consensus to go for that option mostly because it adds to bytecode size. |
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com> Co-authored-by: Francisco <frangio.1@gmail.com>
This has been discussed in #7 and be further explored in OpenZeppelin/openzeppelin-contracts#3620 Closes #7
This has been discussed in #7 and be further explored in OpenZeppelin/openzeppelin-contracts#3620 Closes #7
This has been discussed in #7 and be further explored in OpenZeppelin/openzeppelin-contracts#3620 Closes #7
This has been discussed in #7 and be further explored in OpenZeppelin/openzeppelin-contracts#3620 Closes #7
Fixes #2369
Resolves #1488
This contract adds an additional layer to the trusted Ownable.
The transfer is a two step process
transferOwnership
initiates the process andacceptOwnership
makes it official.Transfer of ownership is a delicate and irreversible process, it could leave a contract useless, with a two step process we add a guard against typos or bad copy/paste.
PR Checklist