GovernorTimelock
On‑chain administrative gateway for governor‑privileged actions. Enforces time‑delayed execution via scheduled proposals and per‑function timelock parameters. Manages proposer/executor/canceller roles and supports role updates through the timelock itself.
Functions
CANCELLER_ROLE
CANCELLER_ROLEReturns the bytes32 representation of the canceller role.
function CANCELLER_ROLE()
view
returns (
bytes32 cancelerRole
);EXECUTOR_ROLE
EXECUTOR_ROLEReturns the bytes32 representation of the executor role.
function EXECUTOR_ROLE()
view
returns (
bytes32 executorRole
);PROPOSER_ROLE
PROPOSER_ROLEReturns the bytes32 representation of the proposer role.
function PROPOSER_ROLE()
view
returns (
bytes32 proposerRole
);ROLE_ADMIN
ROLE_ADMINReturns the bytes32 representation of the role admin.
function ROLE_ADMIN()
view
returns (
bytes32 roleAdmin
);MIN_DELAY
MIN_DELAYReturns the minimum allowed delay (seconds).
function MIN_DELAY()
view
returns (
uint32
);MIN_EXECUTION_WINDOW
MIN_EXECUTION_WINDOWReturns the minimum allowed execution window (seconds).
function MIN_EXECUTION_WINDOW()
view
returns (
uint32
);defaultTimelockParameters
defaultTimelockParametersReturns the default timelock parameters.
function defaultTimelockParameters()
view
returns (
uint32 delay,
uint32 executionWindow
);setDefaultTimelockParameters
setDefaultTimelockParametersSets the default timelock parameters (only via timelock itself).
function setDefaultTimelockParameters(
uint32 delay,
uint32 executionWindow
)
external;Parameters:
0
delay
uint32
uint32
New default delay (seconds)
1
executionWindow
uint32
uint32
New default window (seconds)
setFunctionTimelockParameters
setFunctionTimelockParametersSets per‑function timelock parameters (only via timelock itself).
function setFunctionTimelockParameters(
address target,
bytes4 functionSelector,
uint32 delay,
uint32 executionWindow
)
external;Parameters:
0
target
address
address
Target contract address
1
functionSelector
bytes4
bytes4
Function selector
2
delay
uint32
uint32
Delay for this function (seconds)
3
executionWindow
uint32
uint32
Execution window for this function
scheduleProposals
scheduleProposalsSchedules proposals for execution after the delay.
function scheduleProposals(
address[] targets,
bytes[] data
)
external;Parameters:
0
targets
address[]
address[]
Target contract addresses to call
1
data
bytes[]
bytes[]
Encoded calldata for each target
unscheduleProposals
unscheduleProposalsUnschedules proposals by id (non‑role updates only).
function unscheduleProposals(
uint256[] proposalIds
)
external;Parameters:
0
proposalIds
uint256[]
uint256[]
IDs of proposals to cancel
executeProposals
executeProposalsExecutes proposals within their execution window.
function executeProposals(
uint256[] proposalIds,
address[] targets,
bytes[] data
)
external;Parameters:
0
proposalIds
uint256[]
uint256[]
IDs of proposals to execute
1
targets
address[]
address[]
Target contract addresses
2
data
bytes[]
bytes[]
Encoded calldata for each target
proposeRoleUpdates
proposeRoleUpdatesProposes role grants/revocations (must be executed via timelock).
function proposeRoleUpdates(
bytes32[] roles,
address[] accounts,
bool[] shouldGrant
)
external;Parameters:
0
roles
bytes32[]
bytes32[]
Roles to update
1
accounts
address[]
address[]
Accounts to apply role changes to
2
shouldGrant
bool[]
bool[]
true to grant, false to revoke
updateRole
updateRoleUpdates a role (callable only by the timelock itself during execution).
function updateRole(
bytes32 role,
address account,
bool grantRole
)
external;Parameters:
0
role
bytes32
bytes32
Role identifier
1
account
address
address
Account to update
2
grantRole
bool
bool
true to grant, false revoke
isExecutable
isExecutableReturns true if a proposalId is executable now.
function isExecutable(
uint256 proposalId
)
view
returns (
bool isExecutable_
);Parameters:
0
proposalId
uint256
uint256
Proposal to check timing
Events
DefaultTimelockSet
DefaultTimelockSetevent DefaultTimelockSet(
uint32 delay,
uint32 executionWindow
);ERC20TokenWithdrawn
ERC20TokenWithdrawnevent ERC20TokenWithdrawn(
address indexed token,
address indexed receiver,
uint256 amount
);FunctionTimelockSet
FunctionTimelockSetevent FunctionTimelockSet(
address indexed target,
bytes4 indexed functionSelector,
uint32 delay,
uint32 executionWindow
);PendingTokenWithdrawerSet
PendingTokenWithdrawerSetevent PendingTokenWithdrawerSet(
address indexed newPendingTokenWithdrawer
);ProposalExecuted
ProposalExecutedevent ProposalExecuted(
uint256 indexed proposalId
);ProposalScheduled
ProposalScheduledevent ProposalScheduled(
uint256 indexed proposalId,
Proposal proposal
);ProposalUnscheduled
ProposalUnscheduledevent ProposalUnscheduled(
uint256 indexed proposalId
);RoleUpdated
RoleUpdatedevent RoleUpdated(
bytes32 indexed role,
address indexed account,
bool grantRole
);TokenWithdrawerAccepted
TokenWithdrawerAcceptedevent TokenWithdrawerAccepted(
address indexed tokenWithdrawer
);Last updated