kwww
In a governance system, the TimelockController contract is in charge of introducing a delay between a proposal and its execution. It is a powerful tool for enabling secure and controlled transaction scheduling in the blockchain space. Protocols that have decentralized governance implement timelocks into their contract functions to prevent contract admins/owners from maliciously making contract changes without prior notice. Approved proposals also use a timelock so that users have sufficient time to prepare for contract changes.
The TimelockController is usually paired with role-based access controls (RBAC) such that only certain types of users may invoke specific functions within the contract. An AccessControl contract allows the specification and CRUD of one or more roles.
OpenZeppelin has created the canonical timelock functionality for Solidity and EVM applications. We aim to do the same for Soroban applications. Not that we cannot simply just migrate the
The main functions of the Soroban timelock contract are to enable the scheduling and execution of one or more transactions, specify a minimum time span (t_delay) between the initial scheduling (t_schedule) and the execution of the function (t_exeuction), as well as set the roles of proposer, executor, canceller. t_execution - t_schedule >= t_delay
It's important to note here that we cannot simply translate the Solidity OpenZeppelin timelock contracts into Rust/Soroban. Because Soroban has a different set of logic governing the maximum size of a contract, we have found in our research and development that many complex functions will fail, as maximum contract sizes are limited and external contract calls look to be expensive relative to how things operate for EVM execution.
Once we have created this timelock contract, we will work with the Stellar foundation to help spread awareness and get adoption from developers so that this can be a core contract build block going forward.
In addition to the contracts and documentation we aim to deliver as part of this activation award, future roadmap for Timelock and RBAC can include