ChancellorTimelockControl

Extension to work with TimeLock

The ChancellorTimelockControl allows the Chancellor to work with a TimeLock.

TimeLock contracts allow the existence of a execution delay for approved proposals. This gives the holders to leave or take some action before the proposal is really implemented.

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.

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