IAccessControlDefaultAdminRules.sol 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // SPDX-License-Identifier: MIT
  2. // OpenZeppelin Contracts v4.9.0 (access/IAccessControlDefaultAdminRules.sol)
  3. pragma solidity ^0.8.0;
  4. import "./IAccessControl.sol";
  5. /**
  6. * @dev External interface of AccessControlDefaultAdminRules declared to support ERC165 detection.
  7. *
  8. * _Available since v4.9._
  9. */
  10. interface IAccessControlDefaultAdminRules is IAccessControl {
  11. /**
  12. * @dev Emitted when a `DEFAULT_ADMIN_ROLE` transfer is started, setting `newDefaultAdmin`
  13. * as the next default admin, which will have rights to claim the `DEFAULT_ADMIN_ROLE`
  14. * after `defaultAdminTransferDelayedUntil` has passed.
  15. */
  16. event DefaultAdminRoleChangeStarted(address indexed newDefaultAdmin, uint48 defaultAdminTransferDelayedUntil);
  17. /**
  18. * @dev Returns the delay between each `DEFAULT_ADMIN_ROLE` transfer.
  19. */
  20. function defaultAdminDelay() external view returns (uint48);
  21. /**
  22. * @dev Returns the address of the current `DEFAULT_ADMIN_ROLE` holder.
  23. */
  24. function defaultAdmin() external view returns (address);
  25. /**
  26. * @dev Returns the address of the pending `DEFAULT_ADMIN_ROLE` holder.
  27. */
  28. function pendingDefaultAdmin() external view returns (address);
  29. /**
  30. * @dev Returns the timestamp after which the pending default admin can claim the `DEFAULT_ADMIN_ROLE`.
  31. */
  32. function defaultAdminTransferDelayedUntil() external view returns (uint48);
  33. /**
  34. * @dev Starts a `DEFAULT_ADMIN_ROLE` transfer by setting a pending default admin
  35. * and a timer to pass.
  36. *
  37. * Requirements:
  38. *
  39. * - Only can be called by the current `DEFAULT_ADMIN_ROLE` holder.
  40. *
  41. * Emits a {DefaultAdminRoleChangeStarted}.
  42. */
  43. function beginDefaultAdminTransfer(address newAdmin) external;
  44. /**
  45. * @dev Completes a `DEFAULT_ADMIN_ROLE` transfer.
  46. *
  47. * Requirements:
  48. *
  49. * - Caller should be the pending default admin.
  50. * - `DEFAULT_ADMIN_ROLE` should be granted to the caller.
  51. * - `DEFAULT_ADMIN_ROLE` should be revoked from the previous holder.
  52. */
  53. function acceptDefaultAdminTransfer() external;
  54. /**
  55. * @dev Cancels a `DEFAULT_ADMIN_ROLE` transfer.
  56. *
  57. * Requirements:
  58. *
  59. * - Can be called even after the timer has passed.
  60. * - Can only be called by the current `DEFAULT_ADMIN_ROLE` holder.
  61. */
  62. function cancelDefaultAdminTransfer() external;
  63. }