# UXDTimelockController

`UXDTimelockController` schedules proposals for execution after they have passed a community vote. This is also the executor of governance proposals, and the treasury.

It inherits from the OpenZeppelin `TimelockController`, which provides most of the underlying timelock functionality.

The contract uses role based access to guard permissioned functions.

These roles are available:&#x20;

1. admin: Can grant and revoke roles. No address is set as admin, thus roles can not be changed after initial setup.
2. proposers: Can propose new actions for scheduling and execution. This must be set to only the `UXDGovernor` to ensure security of the protocol.
3. executors: Can execute passed proposers. This is set to the zero address by default, thus anyone can execute proposals once passed.
4. cancellers: Can cancel a proposal at any state prior to execution. The canceller role is not granted to any address by default, thus, proposals can not be cancelled. This could be granted to an admin guardian address through a governance proposal.

{% hint style="info" %}
Note: Only the `admin` role can grant or revoke other roles. On contract deployment, the deployer address is set as the admin initially. This is then used to set up the other roles. Ones the roles are set up, the admin role is revoked from the deployer address, leaving no admin superuser.
{% endhint %}

The verified contract can be seen here on Etherscan.

### Configuration Parameters

<table><thead><tr><th width="190.09670329670328">Parameter</th><th width="347.51776948460673">Description</th><th>Value</th></tr></thead><tbody><tr><td><code>minDelay</code></td><td>The delay between a proposal being queued and when it can be executed, in seconds.</td><td>300</td></tr><tr><td><code>proposers</code></td><td>The list of addresses that can propose actions for execution. This must only be set to the <code>UXDGovernor</code> contract.</td><td></td></tr><tr><td><code>executors</code></td><td>The list of addresses that can execute a proposal once it has passed a vote, and voting delay is over.</td><td>Zero address (anyone).</td></tr></tbody></table>

### Public Interface

The select public interface of the `UXDTimelockController`.

```solidity
contract UXDTimelockController {

function schedule(
        address target,
        uint256 value,
        bytes calldata data,
        bytes32 predecessor,
        bytes32 salt,
        uint256 delay
    ) public virtual onlyRole(PROPOSER_ROLE);
    
function scheduleBatch(
        address[] calldata targets,
        uint256[] calldata values,
        bytes[] calldata payloads,
        bytes32 predecessor,
        bytes32 salt,
        uint256 delay
    ) public virtual onlyRole(PROPOSER_ROLE);

function execute(
        address target,
        uint256 value,
        bytes calldata data,
        bytes32 predecessor,
        bytes32 salt
    ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE);
    
function executeBatch(
        address[] calldata targets,
        uint256[] calldata values,
        bytes[] calldata payloads,
        bytes32 predecessor,
        bytes32 salt
    ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE);

function cancel(bytes32 id) public virtual onlyRole(CANCELLER_ROLE);
    
/// View functions
function getMinDelay() public view virtual returns (uint256 duration);

function hashOperation(
        address target,
        uint256 value,
        bytes calldata data,
        bytes32 predecessor,
        bytes32 salt
    ) public pure virtual returns (bytes32 hash);

}

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.uxd.fi/uxdprogram-ethereum/governance/contracts/uxdtimelockcontroller.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
