Skip to content

Commit 8be3385

Browse files
committed
Transpile ac2bf7f
1 parent 030d6bd commit 8be3385

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818

1919
# Changelog
2020

21+
## 3.4.2 (2021-08-26)
22+
23+
* `TimelockController`: Add additional isOperationReady check.
24+
2125
## 3.4.1 (2021-03-03)
2226

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

contracts/access/TimelockControllerUpgradeable.sol

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ contract TimelockControllerUpgradeable is Initializable, AccessControlUpgradeabl
234234
*/
235235
function execute(address target, uint256 value, bytes calldata data, bytes32 predecessor, bytes32 salt) public payable virtual onlyRole(EXECUTOR_ROLE) {
236236
bytes32 id = hashOperation(target, value, data, predecessor, salt);
237-
_beforeCall(predecessor);
237+
_beforeCall(id, predecessor);
238238
_call(id, 0, target, value, data);
239239
_afterCall(id);
240240
}
@@ -253,7 +253,7 @@ contract TimelockControllerUpgradeable is Initializable, AccessControlUpgradeabl
253253
require(targets.length == datas.length, "TimelockController: length mismatch");
254254

255255
bytes32 id = hashOperationBatch(targets, values, datas, predecessor, salt);
256-
_beforeCall(predecessor);
256+
_beforeCall(id, predecessor);
257257
for (uint256 i = 0; i < targets.length; ++i) {
258258
_call(id, i, targets[i], values[i], datas[i]);
259259
}
@@ -263,7 +263,8 @@ contract TimelockControllerUpgradeable is Initializable, AccessControlUpgradeabl
263263
/**
264264
* @dev Checks before execution of an operation's calls.
265265
*/
266-
function _beforeCall(bytes32 predecessor) private view {
266+
function _beforeCall(bytes32 id, bytes32 predecessor) private view {
267+
require(isOperationReady(id), "TimelockController: operation is not ready");
267268
require(predecessor == bytes32(0) || isOperationDone(predecessor), "TimelockController: missing dependency");
268269
}
269270

contracts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@openzeppelin/contracts-upgradeable",
33
"description": "Secure Smart Contract library for Solidity",
4-
"version": "3.4.1",
4+
"version": "3.4.2",
55
"files": [
66
"**/*.sol",
77
"/build/contracts/*.json",

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": true,
33
"name": "openzeppelin-solidity",
44
"description": "Secure Smart Contract library for Solidity",
5-
"version": "3.4.1",
5+
"version": "3.4.2",
66
"files": [
77
"/contracts/**/*.sol",
88
"/build/contracts/*.json",

0 commit comments

Comments
 (0)