> For the complete documentation index, see [llms.txt](https://docs.union.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.union.finance/developers/governance/itimelock.md).

# Timelock

Each Union contract allows the Timelock address to modify it. The Timelock contract can modify system parameters, logic, and contracts in a 'time-delayed, opt-out' upgrade pattern.

The Timelock has a hard-coded, minimum delay of 2 days. 2 days is the least amount of notice possible for a governance action. Each proposed action will be published at a minimum of 2 days in the future from the time of announcement. Major upgrades, such as changing the risk system, may have a 14-day delay.

## Functions

### isOperation() -> bool

Returns whether an id correspond to a registered operation. This includes both Pending, Ready and Done operations.

### isOperationPending() -> bool

Returns whether an operation is pending or not.

### isOperationReady() -> bool

Returns whether an operation is ready or not.

### isOperationDone() -> bool

Returns whether an operation is done or not.

### getTimestamp() -> uint256

Returns the timestamp at with an operation becomes ready (0 for unset operations, 1 for done operations).

### getMinDelay() -> uint256

Returns the minimum delay for an operation to become valid.

### schedule( address target, uint256 value, bytes calldata data, bytes32 predecessor, bytes32 salt, uint256 delay )

Schedule an operation containing a single transaction.

### scheduleBatch( address\[] calldata targets, uint256\[] calldata values, bytes\[] calldata datas, bytes32 predecessor, bytes32 salt, uint256 delay )

Schedule an operation containing a batch of transactions.

### cancel(bytes32 id)

Cancel an operation.

### execute( address target, uint256 value, bytes calldata data, bytes32 predecessor, bytes32 salt )

Execute an (ready) operation containing a single transaction.

### executeBatch( address\[] calldata targets, uint256\[] calldata values, bytes\[] calldata datas, bytes32 predecessor, bytes32 salt )

Execute an (ready) operation containing a batch of transactions.

## Events

### CallScheduled( bytes32 indexed id, uint256 indexed index, address target, uint256 value, bytes data, bytes32 predecessor, uint256 delay )

Emitted when a call is scheduled as part of operation id.

### CallExecuted(bytes32 indexed id, uint256 indexed index, address target, uint256 value, bytes data)

Emitted when a call is performed as part of operation id.

### Cancelled(bytes32 indexed id)

Emitted when operation id is cancelled.

### MinDelayChange(uint256 oldDuration, uint256 newDuration)

Emitted when the minimum delay for future operations is modified.
