Make AccessManager.execute/schedule more conservative when delay is 0 by frangio · Pull Request #4644 · OpenZeppelin/openzeppelin-contracts (original) (raw)

This PR makes the schedule function revert when the caller does not have an enforced delay. Note that this doesn't prevent a situation where a caller is able to schedule a call but later has their delay removed. To make that case more consistent with the normal schedule/execute case, this PR also makes schedule consume an available schedule even when the caller doesn't have a currently enforced delay, and correctly return the corresponding nonce which is important for GovernorTimelockAccess.

Cherry picked from #4613, where tests were adjusted.