⏰ChancellorTimelockControl
Extension to work with TimeLock
The ChancellorTimelockControl allows the Chancellor to work with a TimeLock.
If a timelock is set to the Chancellor, to execute a proposal you must queue within the timelock.
Only after the defined delay of timelock you can execute the queued proposal.
The calls for Queue and Execute are always made to the Chancellor contract, that understanding the existence of a timelock, will interact with it.
For security purpose, after the Chancellor and Timelock are deployed, you should give the Chancellor contract roles of proposer, executor and canceler (in case you want to allow a proposal to be vetoed after queue) in the Timelock contract.
After this is done, you resign the admin role from the deployer/owner of the Timelock contract and he can never compromised.
If at any point you wish, for example, to change the execution delay of the timelock, you can do it through proposal to the Chancellor.
// example of role definition for the timelock after deploy
const proposer_role = await executorInstance.PROPOSER_ROLE();
const executor_role = await executorInstance.EXECUTOR_ROLE();
const timelock_admin_role = await executorInstance.TIMELOCK_ADMIN_ROLE();
const canceler_role = await executorInstance.CANCELLER_ROLE();
await executorInstance.grantRole(proposer_role, Chancellor.address);
await executorInstance.grantRole(canceler_role, Chancellor.address);
await executorInstance.grantRole(executor_role, burnAddress);
const tx = await executorInstance.revokeRole(timelock_admin_role, owner);
await tx.wait(1);
Last updated