Timelock
Timelock
Section titled “Timelock”Venus has two active Timelock source families with the same transaction tuple but different administration semantics. BNB mainnet’s three Governor Bravo routes use the legacy Solidity 0.5 Timelock. Destination-mainnet governance artifacts use Solidity 0.8.25 TimelockV8.
TimelockV8 allows setPendingAdmin from the current admin as well as from the timelock itself, rejects duplicate queue/cancel state transitions, validates nonzero admins, and exposes GRACE_PERIOD, MINIMUM_DELAY, and MAXIMUM_DELAY as virtual view functions. The legacy contract permits setPendingAdmin only through the timelock itself. Select the contract family by network and bytecode before relying on those differences.
Solidity API
Section titled “Solidity API”setDelay
Section titled “setDelay”Setter for the transaction queue delay
function setDelay(uint256 delay_) publicParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| delay_ | uint256 | The new delay period for the transaction queue |
acceptAdmin
Section titled “acceptAdmin”Method for accepting a proposed admin
function acceptAdmin() publicsetPendingAdmin
Section titled “setPendingAdmin”Method to propose a new admin authorized to call timelock functions. This should be the Governor Contract
function setPendingAdmin(address pendingAdmin_) publicParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| pendingAdmin_ | address | Address of the proposed admin |
queueTransaction
Section titled “queueTransaction”Called for each action when queuing a proposal
function queueTransaction(address target, uint256 value, string signature, bytes data, uint256 eta) public returns (bytes32)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| target | address | Address of the contract with the method to be called |
| value | uint256 | Native token amount sent with the transaction |
| signature | string | Signature of the function to be called |
| data | bytes | Arguments to be passed to the function when called |
| eta | uint256 | Timestamp after which the transaction can be executed |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| [0] | bytes32 | Hash of the queued transaction |
cancelTransaction
Section titled “cancelTransaction”Called to cancel a queued transaction
function cancelTransaction(address target, uint256 value, string signature, bytes data, uint256 eta) publicParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| target | address | Address of the contract with the method to be called |
| value | uint256 | Native token amount sent with the transaction |
| signature | string | Signature of the function to be called |
| data | bytes | Arguments to be passed to the function when called |
| eta | uint256 | Timestamp after which the transaction can be executed |
executeTransaction
Section titled “executeTransaction”Called to execute a queued transaction
function executeTransaction(address target, uint256 value, string signature, bytes data, uint256 eta) public payable returns (bytes)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| target | address | Address of the contract with the method to be called |
| value | uint256 | Native token amount sent with the transaction |
| signature | string | Signature of the function to be called |
| data | bytes | Arguments to be passed to the function when called |
| eta | uint256 | Timestamp after which the transaction can be executed |