Skip to content

Commit 0ec7f4c

Browse files
committed
Add additional isOperationReady check in TimelockController
(cherry picked from commit cec4f2e)
1 parent 1d2e15f commit 0ec7f4c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 4.3.1
4+
5+
* `TimelockController`: Add additional isOperationReady check.
6+
37
## 4.3.0 (2021-08-17)
48

59
* `ERC2771Context`: use private variable from storage to store the forwarder address. Fixes issues where `_msgSender()` was not callable from constructors. ([#2754](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2754))

contracts/governance/TimelockController.sol

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ contract TimelockController is AccessControl {
268268
bytes32 salt
269269
) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) {
270270
bytes32 id = hashOperation(target, value, data, predecessor, salt);
271-
_beforeCall(predecessor);
271+
_beforeCall(id, predecessor);
272272
_call(id, 0, target, value, data);
273273
_afterCall(id);
274274
}
@@ -293,7 +293,7 @@ contract TimelockController is AccessControl {
293293
require(targets.length == datas.length, "TimelockController: length mismatch");
294294

295295
bytes32 id = hashOperationBatch(targets, values, datas, predecessor, salt);
296-
_beforeCall(predecessor);
296+
_beforeCall(id, predecessor);
297297
for (uint256 i = 0; i < targets.length; ++i) {
298298
_call(id, i, targets[i], values[i], datas[i]);
299299
}
@@ -303,7 +303,8 @@ contract TimelockController is AccessControl {
303303
/**
304304
* @dev Checks before execution of an operation's calls.
305305
*/
306-
function _beforeCall(bytes32 predecessor) private view {
306+
function _beforeCall(bytes32 id, bytes32 predecessor) private view {
307+
require(isOperationReady(id), "TimelockController: operation is not ready");
307308
require(predecessor == bytes32(0) || isOperationDone(predecessor), "TimelockController: missing dependency");
308309
}
309310

0 commit comments

Comments
 (0)