Skip to content

Commit 6753d01

Browse files
committed
Add additional isOperationReady check in TimelockController
(cherry picked from commit cec4f2e)
1 parent 1c3d6c9 commit 6753d01

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+
## 3.4.2-solc-0.7
4+
5+
* `TimelockController`: Add additional isOperationReady check.
6+
37
## 3.4.1-solc-0.7 (2021-03-03)
48

59
* `ERC721`: made `_approve` an internal function (was private).

contracts/access/TimelockController.sol

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ contract TimelockController is AccessControl {
227227
*/
228228
function execute(address target, uint256 value, bytes calldata data, bytes32 predecessor, bytes32 salt) public payable virtual onlyRole(EXECUTOR_ROLE) {
229229
bytes32 id = hashOperation(target, value, data, predecessor, salt);
230-
_beforeCall(predecessor);
230+
_beforeCall(id, predecessor);
231231
_call(id, 0, target, value, data);
232232
_afterCall(id);
233233
}
@@ -246,7 +246,7 @@ contract TimelockController is AccessControl {
246246
require(targets.length == datas.length, "TimelockController: length mismatch");
247247

248248
bytes32 id = hashOperationBatch(targets, values, datas, predecessor, salt);
249-
_beforeCall(predecessor);
249+
_beforeCall(id, predecessor);
250250
for (uint256 i = 0; i < targets.length; ++i) {
251251
_call(id, i, targets[i], values[i], datas[i]);
252252
}
@@ -256,7 +256,8 @@ contract TimelockController is AccessControl {
256256
/**
257257
* @dev Checks before execution of an operation's calls.
258258
*/
259-
function _beforeCall(bytes32 predecessor) private view {
259+
function _beforeCall(bytes32 id, bytes32 predecessor) private view {
260+
require(isOperationReady(id), "TimelockController: operation is not ready");
260261
require(predecessor == bytes32(0) || isOperationDone(predecessor), "TimelockController: missing dependency");
261262
}
262263

0 commit comments

Comments
 (0)