What TimelockController does
OpenZeppelin TimelockController is a delay vault for privileged operations. Instead of an EOA or Governor executing admin calls immediately, actions are scheduled, wait minDelay, then execute. That window lets token holders exit, veto, or raise alarms before upgrades, treasury moves, or parameter changes land.
- minDelay — minimum seconds between schedule and execute
- PROPOSER_ROLE — who may queue operations (usually Governor)
- EXECUTOR_ROLE — who may execute after the delay (often anyone via address(0))
- CANCELLER_ROLE — who may cancel queued ops before execution
- DEFAULT_ADMIN_ROLE — bootstrap admin; transfer or renounce after wiring Governor
Roles that matter more than the delay
A long minDelay is useless if the wrong address holds PROPOSER or admin. Production wiring: Governor is the only proposer, executors include the zero address so anyone can finish a passed proposal, and Ownable contracts point at the Timelock — not the Governor and not your deployer key.
- Grant PROPOSER to the Governor contract only
- Grant EXECUTOR to address(0) for public execution after delay
- Keep a CANCELLER for emergency cancel of malicious queues
- Transfer DEFAULT_ADMIN to the Timelock itself (or a multisig) after setup
- Never leave the deployer as permanent admin on mainnet
Schedule, wait, execute
Operations are identified by a hash of targets, values, payloads, predecessor, and salt. Proposers call schedule (or scheduleBatch). After block.timestamp >= eta, executors call execute. Predecessor links let you enforce ordering between operations.
- Use unique salts so identical payloads do not collide
- Batch related calls with scheduleBatch / executeBatch
- Monitor Timelock events (CallScheduled, CallExecuted, Cancelled) in explorers
// Conceptual OpenZeppelin TimelockController flow
timelock.schedule(
target, // contract to call
value, // ETH to send
data, // calldata
predecessor, // bytes32(0) if none
salt, // unique salt
delay // >= minDelay
);
// ... wait until ready ...
timelock.execute(target, value, data, predecessor, salt);Recommended minDelay values
Choose delay from risk, not from convenience. Testnets can use minutes; mainnet treasuries and upgrade keys should use at least one day.
- Sepolia / Base Sepolia experiments — 300–3600 seconds
- Small protocol parameters — 1 day (86400)
- Treasury + upgrade control — 2 days (172800) or more
- Emergency pause may live outside Timelock — document that exception
Wire Timelock with Governor
Deploy order: votes token → Timelock → Governor(timelock) → grant roles → transfer ownership of protocol contracts to the Timelock. Ethereum Toolset ships both templates so you can complete the stack without hand-writing role calldata.
- Token holders must self-delegate for ERC20Votes power
- Governor proposals should target Timelock-owned contracts
- Read the Governor DAO guide for the full three-contract checklist
Deploy from your wallet
Use the TimelockController template to set minDelay and initial proposers/executors, estimate gas, and deploy on Ethereum or a supported L2 — then verify on the explorer.
