Skip to main content

Timelock Governance

Command

yarn start dw uc timelock-governance [arguments] [-options]
# or
yarn start dw uc tg [arguments] [-options]

Overview

Timelock Governance commands provide a comprehensive toolkit for interacting with a TimeLock contract. These commands allow for scheduling, executing, and canceling time-delayed administrative operations, which is a critical safety feature for protocol governance.

The commands are grouped by the contract they primarily interact with, such as common, dashboard, pool, etc.

Common Commands

These commands interact directly with the TimeLock contract and are not specific to another contract's functionality.

Read Commands (common r)

CommandDescription
get-timelock-addressGets the timelock governance address for a given pool.
get-last-operationsFetches and decodes recent CallScheduled events.
get-operation-stateRetrieves the current state of a specific operation.
get-timestampGets the timestamp when an operation will become ready.
get-min-delayRetrieves the minimum delay for operations.
is-operationChecks if a given ID corresponds to a registered operation.
is-operation-pendingChecks if an operation is either 'Waiting' or 'Ready'.
is-operation-readyChecks if an operation is ready for execution.
is-operation-doneChecks if an operation has been executed.
get-operation-infoGets comprehensive information about a specific operation.

Write Commands (common w)

CommandDescription
propose-operationProposes a new timelock operation with contract, method and arguments by ABI
execute-operationExecutes a scheduled timelock operation by operation ID
proposeProposes a new timelock operation from raw parameters
executeExecutes a scheduled timelock operation by reconstructing from raw parameters.
cancelCancels a scheduled timelock operation.

Command Details

get-timelock-address

Finds the admin of a given pool, which is expected to be the TimeLock contract.

Arguments:

  • [pool]: The contract address of the pool.

get-last-operations

Scans recent blocks for CallScheduled events on the timelock contract and displays detailed, decoded information for each, including the target function and arguments.

Arguments:

  • [timelock]: The address of the TimeLock contract. Options:
  • -n, --number <number>: The number of blocks to look back. Default: 5000.

get-operation-state

Retrieves the state of an operation (e.g., Unset, Waiting, Ready, Done).

Arguments:

  • [timelock]: The address of the TimeLock contract.
  • [operation-id]: The ID of the operation.

get-operation-info

Provides a full report on a specific operation, including its state, ready timestamp, and various status flags (isPending, isReady, isDone).

Arguments:

  • [timelock]: The address of the TimeLock contract.
  • [operation-id]: The ID of the operation.

propose-operation

Schedules a new operation by specifying the target contract, the function to call, and its arguments in a human-readable format. The command will handle encoding the calldata and generating the operation ID.

Arguments:

  • [timelock]: The address of the TimeLock contract.
  • [targetContractType]: Target contract type to use ABI of. Possible values: proxy, dashboard, withdrawalQueue, distributor, timelock, stvPool, stvStethPool, genericStrategy, mellowStrategy.
  • [target]: The contract address the operation will call.
  • [method]: The name of the method to call on the target contract.
  • [...args]: The arguments to pass to the method on the target contract. Space separated if multiple. Will be parsed according to the ABI of the target contract. Options:
  • --value, -v [value]: The amount of ETH (in wei) to send with the operation. Default: 0.
  • -p, --predecessor <id>: The ID of a preceding operation that must be completed first.
  • --salt <salt>: A custom salt for the operation ID.
  • --skip-simulation: Skip simulation of the execution of proposed operation by timelock.

Example:

#  Schedule an operation to grant a role by providing the encoded calldata
yarn start dw uc tg common w propose-operation <timelock-addr> dashboard <dashboard-addr> grantRole <hexRole> <account>`

execute-operation

Executes a scheduled operation by it's ID. Supports batch operations. If operations require ether, it will be sent with the transaction.

Arguments:

  • [timelock]: The address of the TimeLock contract.
  • [operationId]: The ID (hash) of the operation to execute. Options:
  • --salt <salt>: A custom salt to use for operation reconstruction.

propose

Schedules a new operation by reconstructing its parameters. This is a powerful, generic command that can propose any operation if you provide the correct target, value, payload, and salt.

Arguments:

  • [timelock]: The address of the TimeLock contract.
  • [target]: The contract address the operation will call.
  • [value]: The amount of ETH (in wei) to send with the operation. Default: 0.
  • [payload]: The hex-encoded calldata representing the function and arguments to be called on the target. Options:
  • -p, --predecessor <id>: The ID of a preceding operation that must be completed first.
  • --salt <salt>: A custom salt for the operation ID.

Example:

#  Schedule an operation to grant a role by providing the encoded calldata
yarn start dw uc tg common w propose <timelock-addr> <dashboard-addr> 0 <encoded-grantRole-calldata>

execute

Executes a scheduled operation by reconstructing its parameters. This is a powerful, generic command that can execute any operation if you provide the correct target, value, payload, and salt.

Arguments:

  • [timelock]: The address of the TimeLock contract.
  • [target]: The contract address the operation will call.
  • [value]: The amount of ETH (in wei) to send with the operation. Default: 0.
  • [payload]: The hex-encoded calldata representing the function and arguments to be called on the target. Options:
  • -p, --predecessor <id>: The ID of a preceding operation that must be completed first.
  • --salt <salt>: A custom salt for the operation ID.

Example:

# Execute a proposal to grant a role by providing the encoded calldata
yarn start dw uc tg common w execute <timelock-addr> <dashboard-addr> 0 <encoded-grantRole-calldata>

cancel

Cancels a scheduled operation. An operation cannot be canceled if it has already been executed.

Arguments:

  • [timelock]: The address of the TimeLock contract.
  • [operation-id]: The ID of the operation to cancel.

Dashboard Commands

These commands are for proposing and executing administrative changes to a Dashboard contract through the TimeLock.

Write Commands (dashboard w)

Each function on the Dashboard contract has a corresponding propose- and execute- command pair.

CommandDescription
propose-grant-roleProposes granting a role to an account.
execute-grant-roleExecutes a proposal to grant a role.
propose-revoke-roleProposes revoking a role from an account.
execute-revoke-roleExecutes a proposal to revoke a role.
propose-change-tierProposes changing a tier's share limit.
execute-change-tierExecutes a proposal to change a tier.
propose-sync-tierProposes syncing a tier.
execute-sync-tierExecutes a proposal to sync a tier.
propose-update-share-limitProposes updating the share limit for a tier.
execute-update-share-limitExecutes a proposal to update a share limit.
propose-set-pdg-policyProposes setting the PDG (Predeposit Guarantee) policy.
execute-set-pdg-policyExecutes a proposal to set the PDG policy.
propose-transfer-vault-ownershipProposes transferring vault ownership.
execute-transfer-vault-ownershipExecutes a proposal to transfer vault ownership.

Command Details

All dashboard write commands share a similar structure.

Arguments:

  • [timelock]: The address of the TimeLock contract.
  • [dashboard]: The address of the Dashboard contract being managed.
  • Additional arguments specific to the function being called (e.g., role, account, tierId, shareLimit).

Options:

  • --salt <salt>: A custom salt for the operation ID.

Example (propose-grant-role):

# Propose granting the FINALIZE_ROLE to a new account
yarn start dw uc tg dashboard w propose-grant-role <timelock-addr> <dashboard-addr> FINALIZE_ROLE <account-addr>

Example (execute-grant-role):

# Execute the proposal to grant the role
yarn start dw uc tg dashboard w execute-grant-role <timelock-addr> <dashboard-addr> FINALIZE_ROLE <account-addr>

Pool Commands

These commands are for proposing and executing administrative changes to a StvStETHPool contract through the TimeLock.

Write Commands (pool w)

CommandDescription
propose-grant-roleProposes granting a role to an account on the pool.
execute-grant-roleExecutes a proposal to grant a role on the pool.
propose-revoke-roleProposes revoking a role from an account on the pool.
execute-revoke-roleExecutes a proposal to revoke a role on the pool.
propose-set-max-loss-socialization-bpProposes setting the maxLossSocializationBP.
execute-set-max-loss-socialization-bpExecutes a proposal to set the maxLossSocializationBP.

Command Details

All pool write commands follow a similar pattern.

Arguments:

  • [timelock]: The address of the TimeLock contract.
  • [pool]: The address of the StvStETHPool contract being managed.
  • Additional arguments specific to the function being called (e.g., role, account, maxSocializablePortionBP).

Options:

  • --salt <salt>: A custom salt for the operation ID.

Example (propose-set-max-loss-socialization-bp):

# Propose setting the max loss socialization to 100 basis points (1%)
yarn start dw uc tg pool w propose-set-max-loss-socialization-bp <timelock-addr> <pool-addr> 100

Example (execute-set-max-loss-socialization-bp):

# Execute the proposal to set the max loss socialization
yarn start dw uc tg pool w execute-set-max-loss-socialization-bp <timelock-addr> <pool-addr> 100

Strategy Commands

These commands are for proposing and executing administrative changes to a Strategy contract connected to StvStrategyPool through the TimeLock.

Write Commands (strategy w)

CommandDescription
propose-grant-roleProposes granting a role to an account on the strategy.
execute-grant-roleExecutes a proposal to grant a role on the strategy.
propose-revoke-roleProposes revoking a role from an account on the strategy.
execute-revoke-roleExecutes a proposal to revoke a role on the strategy.

Command Details

All strategy write commands follow a similar pattern.

Arguments:

  • [timelock]: The address of the TimeLock contract.
  • [strategy]: The address of the Strategy contract being managed.
  • Additional arguments specific to the function being called (e.g., role, account).

Options:

  • --salt <salt>: A custom salt for the operation ID.

Example (propose-grant-role):

# Propose granting a role to an account on the strategy
yarn start dw uc tg strategy w propose-grant-role <timelock-addr> <strategy-addr> <role> <account>

Example (execute-grant-role):

# Execute the proposal to grant a role on the strategy
yarn start dw uc tg strategy w execute-grant-role <timelock-addr> <strategy-addr> <role> <account>

Proxy Commands

These commands are for proposing and executing upgrades to OssifiableProxy contracts through the TimeLock. This is a critical part of contract maintenance and evolution.

Write Commands (proxy w)

CommandDescription
propose-upgrade-toProposes a simple upgrade to a new implementation contract.
execute-upgrade-toExecutes a simple implementation upgrade.
propose-upgrade-to-and-callProposes an upgrade that also includes an initialization (setup) call.
execute-upgrade-to-and-callExecutes an upgrade with an initialization call.

Command Details

All proxy write commands follow a similar pattern for proposing and executing changes.

Arguments:

  • [timelock]: The address of the TimeLock contract.
  • [proxy]: The address of the OssifiableProxy contract to be upgraded.
  • [newImplementation]: The address of the new implementation contract.
  • [setupCalldata] (for ...-and-call commands): The hex-encoded calldata for the initialization function to be called on the new implementation.

Options:

  • --salt <salt>: A custom salt for the operation ID.

Example (propose-upgrade-to-and-call):

# Propose upgrading a proxy and calling an initializer function
yarn start dw uc tg proxy w propose-upgrade-to-and-call <timelock-addr> <proxy-addr> <impl-addr> <calldata>

Example (execute-upgrade-to-and-call):

# Execute the proxy upgrade with the initialization call
yarn start dw uc tg proxy w execute-upgrade-to-and-call <timelock-addr> <proxy-addr> <impl-addr> <calldata>

Withdrawal Queue Commands

These commands are for proposing and executing administrative changes to a WithdrawalQueue contract through the TimeLock.

Write Commands (withdrawal-queue w)

CommandDescription
propose-grant-roleProposes granting a role to an account on the queue.
execute-grant-roleExecutes a proposal to grant a role on the queue.
propose-revoke-roleProposes revoking a role from an account on the queue.
execute-revoke-roleExecutes a proposal to revoke a role on the queue.

Command Details

All withdrawal-queue write commands follow a similar pattern for proposing and executing role changes.

Arguments:

  • [timelock]: The address of the TimeLock contract.
  • [withdrawalQueue]: The address of the WithdrawalQueue contract being managed.
  • [role]: The role to grant or revoke (e.g., FINALIZE_ROLE).
  • [account]: The account address to grant or revoke the role for.

Options:

  • --salt <salt>: A custom salt for the operation ID.

Example (propose-grant-role):

# Propose granting the FINALIZE_ROLE to a new operator
yarn start dw uc tg withdrawal-queue w propose-grant-role <timelock-addr> <wq-addr> FINALIZE_ROLE <operator-addr>

Example (execute-grant-role):

# Execute the proposal to grant the role
yarn start dw uc tg withdrawal-queue w execute-grant-role <timelock-addr> <wq-addr> FINALIZE_ROLE <operator-addr>