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.
admin_address
: usually the address of Gnosis Safe walletdelay
: how long will the execution be paused, its unit is secondMINIMUM_DELAY
: the minimum delay of an executionMAXIMUM_DELAY
: the maximum delay of an executionGRACE_PERIOD
: how long will the execution be staleAn 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.
Same as queuing a transaction above, the parameters are the same.