In Open Zeppelin's Governance/Timelock contracts, what is the purpose of minDelay
and how is it used?
1 Answer
The reason is to set a delay between the time the voting period ended to the time you can execute the proposal.
The timelock addon to the governor contract enables queueing a proposal after it succeded. You can queue a proposal with a certain delay time and set its state to Queued. When you want to execute a proposal with the timelock addon the condition is its state is Queued.
Then when executing, the contract checks if the delay you put when you queued the proposal has passed, and then it can run it.
The purpose of the minDelay is to make proposals wait for at least a certain amount of time after the voting period ended.
The value can be 0, meaning there is no minimum delay after the voting period ended, but an admin can change it as he wishes.
-
hi @egjlmn1, but why do we want to have a delay? what can possibly be done between queue state and execute state? Is there an example? Commented Nov 15, 2021 at 6:59
-
Let's say the proposal might do drastic changes to the system. by putting a delay, users can know the proposal will be executed and can get ready for it. For example, they think that after the proposal their coins will be worthless, so they have time to sell them. If we don't have a delay, users won't know for sure if the proposal will pass or not and won't be able to prepare accordingly.– egjlmn1Commented Nov 15, 2021 at 7:14
-