@@ -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