access_manager_AccessManager.sol.patch 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. --- access/manager/AccessManager.sol 2025-08-16 15:15:34
  2. +++ access/manager/AccessManager.sol 2025-08-16 15:17:51
  3. @@ -7,7 +7,6 @@
  4. import {IAccessManaged} from "./IAccessManaged.sol";
  5. import {Address} from "../../utils/Address.sol";
  6. import {Context} from "../../utils/Context.sol";
  7. -import {Multicall} from "../../utils/Multicall.sol";
  8. import {Math} from "../../utils/math/Math.sol";
  9. import {Time} from "../../utils/types/Time.sol";
  10. import {Hashes} from "../../utils/cryptography/Hashes.sol";
  11. @@ -59,7 +58,8 @@
  12. * mindful of the danger associated with functions such as {Ownable-renounceOwnership} or
  13. * {AccessControl-renounceRole}.
  14. */
  15. -contract AccessManager is Context, Multicall, IAccessManager {
  16. +// NOTE: The FV version of this contract doesn't include Multicall because CVL HAVOCs on any `delegatecall`.
  17. +contract AccessManager is Context, IAccessManager {
  18. using Time for *;
  19. // Structure that stores the details for a target contract.
  20. @@ -115,7 +115,7 @@
  21. // Used to identify operations that are currently being executed via {execute}.
  22. // This should be transient storage when supported by the EVM.
  23. - bytes32 private _executionId;
  24. + bytes32 internal _executionId; // private → internal for FV
  25. /**
  26. * @dev Check that the caller is authorized to perform the operation.
  27. @@ -263,6 +263,11 @@
  28. _setGrantDelay(roleId, newDelay);
  29. }
  30. + // Exposed for FV
  31. + function _getTargetAdminDelayFull(address target) internal view virtual returns (uint32, uint32, uint48) {
  32. + return _targets[target].adminDelay.getFull();
  33. + }
  34. +
  35. /**
  36. * @dev Internal version of {grantRole} without access control. Returns true if the role was newly granted.
  37. *
  38. @@ -295,6 +300,11 @@
  39. emit RoleGranted(roleId, account, executionDelay, since, newMember);
  40. return newMember;
  41. + }
  42. +
  43. + // Exposed for FV
  44. + function _getRoleGrantDelayFull(uint64 roleId) internal view virtual returns (uint32, uint32, uint48) {
  45. + return _roles[roleId].grantDelay.getFull();
  46. }
  47. /**
  48. @@ -596,7 +606,7 @@
  49. *
  50. * WARNING: Carefully review the considerations of {AccessManaged-restricted} since they apply to this modifier.
  51. */
  52. - function _checkAuthorized() private {
  53. + function _checkAuthorized() internal virtual { // private → internal virtual for FV
  54. address caller = _msgSender();
  55. (bool immediate, uint32 delay) = _canCallSelf(caller, _msgData());
  56. if (!immediate) {
  57. @@ -619,7 +629,7 @@
  58. */
  59. function _getAdminRestrictions(
  60. bytes calldata data
  61. - ) private view returns (bool adminRestricted, uint64 roleAdminId, uint32 executionDelay) {
  62. + ) internal view returns (bool adminRestricted, uint64 roleAdminId, uint32 executionDelay) { // private → internal for FV
  63. if (data.length < 4) {
  64. return (false, 0, 0);
  65. }
  66. @@ -672,7 +682,7 @@
  67. address caller,
  68. address target,
  69. bytes calldata data
  70. - ) private view returns (bool immediate, uint32 delay) {
  71. + ) internal view returns (bool immediate, uint32 delay) { // private → internal for FV
  72. if (target == address(this)) {
  73. return _canCallSelf(caller, data);
  74. } else {
  75. @@ -728,14 +738,14 @@
  76. /**
  77. * @dev Extracts the selector from calldata. Panics if data is not at least 4 bytes
  78. */
  79. - function _checkSelector(bytes calldata data) private pure returns (bytes4) {
  80. + function _checkSelector(bytes calldata data) internal pure returns (bytes4) { // private → internal for FV
  81. return bytes4(data[0:4]);
  82. }
  83. /**
  84. * @dev Hashing function for execute protection
  85. */
  86. - function _hashExecutionId(address target, bytes4 selector) private pure returns (bytes32) {
  87. + function _hashExecutionId(address target, bytes4 selector) internal pure returns (bytes32) { // private → internal for FV
  88. return Hashes.efficientKeccak256(bytes32(uint256(uint160(target))), selector);
  89. }
  90. }