Governance
| This document is better viewed at https://docs.openzeppelin.com/contracts/api/governance |
This directory includes extensions and utilities for on-chain governance.
-
TimelockControllerEnumerable: Extension of OpenZeppelin’s TimelockController with enumerable operations support.
Timelock
TimelockControllerEnumerable
import "@openzeppelin/community-contracts/governance/TimelockControllerEnumerable.sol";
Extends the TimelockController to allow for enumerable operations
-
schedule(target, value, data, predecessor, salt, delay) -
scheduleBatch(targets, values, payloads, predecessor, salt, delay) -
cancel(id) -
operations() -
operations(start, end) -
operationsCount() -
operation(index) -
operation(id) -
operationsBatch() -
operationsBatch(start, end) -
operationsBatchCount() -
operationBatch(index) -
operationBatch(id)
-
receive() -
supportsInterface(interfaceId) -
isOperation(id) -
isOperationPending(id) -
isOperationReady(id) -
isOperationDone(id) -
getTimestamp(id) -
getOperationState(id) -
getMinDelay() -
hashOperation(target, value, data, predecessor, salt) -
hashOperationBatch(targets, values, payloads, predecessor, salt) -
execute(target, value, payload, predecessor, salt) -
executeBatch(targets, values, payloads, predecessor, salt) -
_execute(target, value, data) -
updateDelay(newDelay) -
_encodeStateBitmap(operationState) -
PROPOSER_ROLE() -
EXECUTOR_ROLE() -
CANCELLER_ROLE()
-
onERC1155Received(, , , , ) -
onERC1155BatchReceived(, , , , )
-
onERC721Received(, , , )
-
hasRole(role, account) -
_checkRole(role) -
_checkRole(role, account) -
getRoleAdmin(role) -
grantRole(role, account) -
revokeRole(role, account) -
renounceRole(role, callerConfirmation) -
_setRoleAdmin(role, adminRole) -
_grantRole(role, account) -
_revokeRole(role, account) -
DEFAULT_ADMIN_ROLE()
-
CallScheduled(id, index, target, value, data, predecessor, delay) -
CallExecuted(id, index, target, value, data) -
CallSalt(id, salt) -
Cancelled(id) -
MinDelayChange(oldDuration, newDuration)
-
RoleAdminChanged(role, previousAdminRole, newAdminRole) -
RoleGranted(role, account, sender) -
RoleRevoked(role, account, sender)
-
OperationIndexNotFound(index) -
OperationIdNotFound(id) -
OperationBatchIndexNotFound(index) -
OperationBatchIdNotFound(id) -
InvalidIndexRange(start, end)
-
TimelockInvalidOperationLength(targets, payloads, values) -
TimelockInsufficientDelay(delay, minDelay) -
TimelockUnexpectedOperationState(operationId, expectedStates) -
TimelockUnexecutedPredecessor(predecessorId) -
TimelockUnauthorizedCaller(caller)
-
AccessControlUnauthorizedAccount(account, neededRole) -
AccessControlBadConfirmation()
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 WARNING: 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
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 WARNING: 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