Overview

The main role of timelock contract is to delay the execution of another contract’s function. Leave the delay time for community to gain awareness of particular decision making.

Two main functions: queue and execute a transaction.

*TheSpace DAO timelock contract is from Compound.

Get started

Deploy timelock contract

  1. Prepare these parameters beforehand, discussed with the community
    1. admin_address: usually the address of Gnosis Safe wallet
    2. delay: how long will the execution be paused, its unit is second
    3. MINIMUM_DELAY: the minimum delay of an execution
    4. MAXIMUM_DELAY: the maximum delay of an execution
    5. GRACE_PERIOD: how long will the execution be stale
  2. Follow the build and deploy steps here

Queue a transaction in Gnosis Safe wallet

Grant corresponding role to timelock contract

An execution of a function needs certain role, grant this permission to the timelock contract.

For example, in TheSpace contract, setTotalSupply function needs marketAdmin role to invoke.

Execute a transaction in Gnosis Safe wallet

Same as queuing a transaction above, the parameters are the same.

References