Launch: Unizon Timelock Admin

Unizon has launched the Unizon Timelock Admin version1.0 .

Image for post
Image for post
Figure 1. Main Interface of Unizon Timelock Admin

Timelock, as the name suggests, is a mechanism of locking and unlocking based on time. This is the basic functional module used in almost every DeFi and DAPP project, which can be roughly considered as a “delayed pipeline”. A planned action, after being locked by the time lock, will suspend execution, waiting to execute after a specified time. The logic of this function is simple, but very useful and important. On a blockchain platform like Ethereum, it is not easy to do it right.

Image for post
Figure 2. An operation delayed and suspended by a time lock and waiting for execution
Image for post
Figure 3. An expired and completed operation

DeFi is said to be a Lego building block. For basic functions such as Timelock, a small block should correspond to it, so that the required items can be taken and used at any time. However, at present, the Timelock function is implemented in their large amount of smart contract codes by all mainstream projects, which can neither be split nor be supplemented.

A Timelock administration framework has also been implemented by our team during the development of DeFi protocol, and has been running stably and reliably for a period of time in several products. We believe that we should contribute to the ecology of DeFi development, so we decided to split this Timelock and make it into a Lego building block. If it is needed by other DeFi projects in the future, they can no longer need to re-develop it but integrate it directly and freely in their own projects. Of course, as an open source code, colleagues are also welcomed to freely improve this framework.

No matter in code size or in its meaning, it is only a small contribution. But this is the first open source project released by us after our establishment. In the future, we hope to continuously submit some useful “Lego blocks” to the entire DeFi and DAPP community. The equality, openness and collaboration of blockchain should also be reflected in technology and code.

Here is the project code:

For specific instructions, please see below.


As the standard configuration of high-quality DeFi projects, Timelock has become an indispensable part of the governance system. By taking over/limiting super users to modify system parameters through Timelock, on the one hand, it can prevent the evil things made by administrators or the damages of the system made by attackers after gaining administrator privileges, while on the other hand, it can also give users greater authority to have enough time to act in advance to avoid asset losses when they disagree with certain governance measures.

At present, a standard Timelock contract, as adapted in this project, is generally adopted in the industry, including projects such as Compound and SushiSwap. However, there is no simple and common solution for the use and management of contracts. Currently, there are two typical types: one is the simple query method adopted by Sushiswap, that is, to query all transactions involved in the Timelock contract and display them in chronological order, without caring about the operation logic of specific business.

See: The other is a method completely integrated with the governance system, such as displayed on the official website of Compound.

At present, we have not seen a complete open source project for the use and management of Timelock, which can help DeFi developers quickly use and manage Timelock.

In case of this, if a DeFi project manager wants to use Timelock effectively, he or she will encounter two main problems. Firstly, a considerable amount of development is required. Timelock calls must be written by yourself to correspond with all functions corresponding to your own contract, with a large development workload and difficulties in guaranteeing correctness. Secondly, if referring to the running account organization like SushiSwap, Timelock cannot be used and managed from a business perspective. For example, a typical scene is to initiate a Timelock transaction, then modify a certain parameter in the platform, and confirm the transaction two days later when the Timelock is allowed to take effect. However, in original query method like SushiSwap, it is impossible to know which transactions in the current Timelock are to be executed and what are their contents. All the transactions mixed together (including initiating, confirming, canceling, etc.) must be reviewed, so as to find the original transaction and then execute it again.

We believe that an effective Timelock administration framework should achieve two points. On the one hand, the project should be allowed to achieve its management of methods with Timelock through the configuration method, without requiring a lot of development. On the other hand, the data organization form should be more likely to fit the business logic. By using business-based organization, queue transaction should be matched and organized with execute transaction and cancel transaction to simplify the administrator’s work.

This is the original intention of Unizon Timelock Admin.

Function Introduction

General Timelock will be used to manage DAPP. Just by modifying the configuration file, it can realize the Timelock transaction display, modification of functions of queue transaction, execute transaction, and cancel transaction, Timelock and configuration file modified by constants.ts file (this configuration takes compound as an example):

* the contract address managed by timelock, taking compound as an example in this configuration
export const contract_address : any = {
3: {
'unitroller': '0x52Ab60E7F463B73C6A90ee116dBB18ac61DC63FF',
'comptroller': '0x52Ab60E7F463B73C6A90ee116dBB18ac61DC63FF',
'cToken1': '',
'cToken2': '',
'cTokenn': ''
1: {
'unitroller': '0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B',
'comptroller': '0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B',
'cToken1': '',
'cToken2': '',
'cTokenn': ''

* abi files corresponding to the contracts managed by timelock, which needs to be copied/timelock/abi contents

export const contract_abi_file : any = {
'unitroller': 'unitroller-abi.json',
'comptroller': 'comptroller-abi.json',
'cToken1': 'cToken-abi.json',
'cToken2': 'cToken-abi.json',
'cTokenn': 'cToken-abi.json'

* deplay Offset, unit: seconds
export const delay_offset = 300;

* the address of timelock contracts are mainnet and ropsten, in which the major network is the address of compound timelock contracts
export const timelock_address : any = {
1: '0x6d903f6003cca6255D85CcA4D3B5E5146dC33925',
3: '0x4168FE8179C5e99074068244413909F40c4301B2'

contracts managed by timelock need to execute the function list of queue transaction

export const queue_functions : any = {
'unitroller': ['_acceptAdmin', '_setPendingAdmin', '_setPendingImplementation'],
'comptroller': ['_become', '_setBorrowPaused', '_setMiningBuff', '_setCompRate', '_setMintPaused', '_supportMarket', '_dropCompMarket', '_setPriceOracle', '_setCollateralFactor'],
'cToken1': ['_acceptAdmin', '_setReserveFactor'],
'cToken2': ['_acceptAdmin', '_setReserveFactor'],
'cTokenn': ['_acceptAdmin', '_setReserveFacto

Operation and Deployment


Execute in the root directory of the project

yarnyarn dev


Execute in the root directory of the project

yarn build

Deploy ./dist content by nginx/apache

About us:

Unizon is a development team, dedicated to blockchain and open financial technology, and specializing in DeFi protocol development, technical advisory services, and model design for Tokenomics.

Contact us:


Website | + posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact us

Fill in the form below or give us a call and we'll contact you. We endeavour to answer all enquiries within 24 hours on business days.