openzeppelin-contracts icon indicating copy to clipboard operation
openzeppelin-contracts copied to clipboard

Consider making `_hasSchedulePassed` internal virtual in AccessControlDefaultAdminRules

Open QEDK opened this issue 6 months ago • 7 comments

In AccessControlDefaultAdminRules.sol, you can't execute on inclusion block + scheduled delay but rather, inclusion block + scheduled delay + 1. This is a rather strange pattern since time limits are usually enforced as block.timestamp >= expectedTimestamp. I presume this is intended to induce a delay when schedule timestamp == block.timestamp but has been left undocumented.

💻 Environment v5.3.0 OZ v1 Foundry

📝 Details I think this should be documented or fixed. I don't strictly view it as a bug but it's a definite pitfall.

🔢 Code to reproduce bug

  • multicall([...], [...])
    • beginDefaultAdminTransfer(...)
    • acceptDefaultAdminTransfer()

QEDK avatar May 03 '25 19:05 QEDK