Skip to content

Commit

Permalink
Add additional isOperationReady check in TimelockController
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed Aug 24, 2021
1 parent 52188a2 commit cec4f2e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 4.3.1

* `TimelockController`: Add additional isOperationReady check.

## 4.3.0 (2021-08-17)

* `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))
Expand Down Expand Up @@ -95,6 +99,10 @@ Make sure you're using git or another version control system to be able to recov

Some further changes have been done between the different beta iterations. Transitions made during this period are configured in the `migrate-imports` script. Consequently, you can upgrade from any previous 4.0-beta.x version using the same script as described in the *How to upgrade from 3.x* section.

## 3.4.2

* `TimelockController`: Add additional isOperationReady check.

## 3.4.1 (2021-03-03)

* `ERC721`: made `_approve` an internal function (was private).
Expand Down
7 changes: 4 additions & 3 deletions contracts/governance/TimelockController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ contract TimelockController is AccessControl {
bytes32 salt
) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) {
bytes32 id = hashOperation(target, value, data, predecessor, salt);
_beforeCall(predecessor);
_beforeCall(id, predecessor);
_call(id, 0, target, value, data);
_afterCall(id);
}
Expand All @@ -293,7 +293,7 @@ contract TimelockController is AccessControl {
require(targets.length == datas.length, "TimelockController: length mismatch");

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

Expand Down

0 comments on commit cec4f2e

Please sign in to comment.