Skip to content

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.

Setter for the transaction queue delay

function setDelay(uint256 delay_) public
NameTypeDescription
delay_uint256The new delay period for the transaction queue

Method for accepting a proposed admin

function acceptAdmin() public

Method to propose a new admin authorized to call timelock functions. This should be the Governor Contract

function setPendingAdmin(address pendingAdmin_) public
NameTypeDescription
pendingAdmin_addressAddress of the proposed admin

Called for each action when queuing a proposal

function queueTransaction(address target, uint256 value, string signature, bytes data, uint256 eta) public returns (bytes32)
NameTypeDescription
targetaddressAddress of the contract with the method to be called
valueuint256Native token amount sent with the transaction
signaturestringSignature of the function to be called
databytesArguments to be passed to the function when called
etauint256Timestamp after which the transaction can be executed
NameTypeDescription
[0]bytes32Hash of the queued transaction

Called to cancel a queued transaction

function cancelTransaction(address target, uint256 value, string signature, bytes data, uint256 eta) public
NameTypeDescription
targetaddressAddress of the contract with the method to be called
valueuint256Native token amount sent with the transaction
signaturestringSignature of the function to be called
databytesArguments to be passed to the function when called
etauint256Timestamp after which the transaction can be executed

Called to execute a queued transaction

function executeTransaction(address target, uint256 value, string signature, bytes data, uint256 eta) public payable returns (bytes)
NameTypeDescription
targetaddressAddress of the contract with the method to be called
valueuint256Native token amount sent with the transaction
signaturestringSignature of the function to be called
databytesArguments to be passed to the function when called
etauint256Timestamp after which the transaction can be executed