LIPs icon indicating copy to clipboard operation
LIPs copied to clipboard

[LSP0 and LSP9] Add two step process for renounceOwnership

Open frozeman opened this issue 1 year ago • 7 comments

This creates additional safety for a very dangerous action. Options are:

Call renounceOwnership() 2x within 50 blocks

Call renounceOwnership() and after confirmRenounceOwnership()/renounceOwnershipConfirm() within 50 blocks

frozeman avatar Aug 26 '22 09:08 frozeman

Lets go with Call renounceOwnership() 2x within 100 blocks

frozeman avatar Aug 26 '22 09:08 frozeman

@JeneaVranceanu @YamenMerhi

frozeman avatar Aug 26 '22 09:08 frozeman

I suppose that instead of me @CJ42 expected to be tagged :)

JeneaVranceanu avatar Aug 26 '22 11:08 JeneaVranceanu

event RenounceOwnershipInitiated(...)

There should be as well a deadline for renouncing ownership.

// renounceOwnership(...).       // ---------------------> timeline to confirm <---------------//                                
block n -----------------> block n + 50 ---------------------------------------------> block n + 150 ------------------> timeout

After block n + 150, this is a timeout and the process has to start all over again.

CJ42 avatar Aug 29 '22 09:08 CJ42

@frozeman adding this as a comment for clarity (as it is mentioned in the first comment of the issue.

We agreed on calling the same function renounceOwnership(...) twice ✅
(no functions ~confirmRenounceOwnership()~ or ~renounceOwnershipConfirm()~) ❌

CJ42 avatar Aug 29 '22 09:08 CJ42

It was decided to make renounceOwnership(..) a two step process action, where the the user calls renounceOwnership(..), which starts a time in blocks, where for the first 100 blocks, he can not complete the renouncement, and after 100 blocks he has the ability to call renounceOwnership(..) again to complete the renouncement. If after 200 blocks after the initial call to renounceOwnership() the process was not completed, the user will have to start all over again. We also added a RenounceOwnershipInitiated Event to notify the user that renounceOwnership(..) was called for the first time.

This will allow for a delay time for the owner to act, if a malicious controller initiated the process. And allows for an expiry, the process is not completed within 100 blocks (~20min)

YamenMerhi avatar Aug 30 '22 11:08 YamenMerhi

@frozeman Can we use block.timestamp instead of block.number?

b00ste avatar Sep 05 '22 11:09 b00ste

Closing as implemented in #129 ✅

CJ42 avatar Dec 07 '22 10:12 CJ42