Join our community of builders on

Telegram!Telegram

Governance

Smart contract governance utilities and implementations

This directory includes extensions and utilities for on-chain governance.

  • TimelockControllerEnumerable: Extension of OpenZeppelin’s TimelockController with enumerable operations support.

TimelockControllerEnumerable

import "@openzeppelin/contracts/governance/TimelockControllerEnumerable.sol";

Extends the TimelockController to allow for enumerable operations

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

public

#

Schedule an operation containing a single transaction.

Emits CallSalt if salt is nonzero, and CallScheduled.

Requirements:

  • the caller must have the 'proposer' role.

scheduleBatch(address[] targets, uint256[] values, bytes[] payloads, bytes32 predecessor, bytes32 salt, uint256 delay)

public

#

Schedule an operation containing a batch of transactions.

Emits CallSalt if salt is nonzero, and one CallScheduled event per transaction in the batch.

Requirements:

  • the caller must have the 'proposer' role.

cancel(bytes32 id)

public

#

Cancel an operation.

Requirements:

  • the caller must have the 'canceller' role.

operations() → struct TimelockControllerEnumerable.Operation[] operations_

public

#

Return all scheduled operations

This is designed for view accessors queried without gas fees. Using it in state-changing functions may become uncallable if the list grows too large.

operations(uint256 start, uint256 end) → struct TimelockControllerEnumerable.Operation[] operations_

public

#

Return the operations in the given index range

operationsCount() → uint256 operationsCount_

public

#

Return the number of operations from the set

operation(uint256 index) → struct TimelockControllerEnumerable.Operation operation_

public

#

Return the operation at the given index

operation(bytes32 id) → struct TimelockControllerEnumerable.Operation operation_

public

#

Return the operation with the given id

operationsBatch() → struct TimelockControllerEnumerable.OperationBatch[] operationsBatch_

public

#

Return all scheduled operation batches

This is designed for view accessors queried without gas fees. Using it in state-changing functions may become uncallable if the list grows too large.

operationsBatch(uint256 start, uint256 end) → struct TimelockControllerEnumerable.OperationBatch[] operationsBatch_

public

#

Return the operationsBatch in the given index range

operationsBatchCount() → uint256 operationsBatchCount_

public

#

Return the number of operationsBatch from the set

operationBatch(uint256 index) → struct TimelockControllerEnumerable.OperationBatch operationBatch_

public

#

Return the operationsBatch at the given index

operationBatch(bytes32 id) → struct TimelockControllerEnumerable.OperationBatch operationBatch_

public

#

Return the operationsBatch with the given id

OperationIndexNotFound(uint256 index)

error

#

The error when the operation index is not found

OperationIdNotFound(bytes32 id)

error

#

The error when the operation id is not found

OperationBatchIndexNotFound(uint256 index)

error

#

The error when the operation batch index is not found

OperationBatchIdNotFound(bytes32 id)

error

#

The error when the operation batch id is not found

InvalidIndexRange(uint256 start, uint256 end)

error

#

The error when the index range is invalid