|
1 |
| ---- access/manager/AccessManager.sol 2023-10-05 12:17:09.694051809 -0300 |
2 |
| -+++ access/manager/AccessManager.sol 2023-10-05 12:26:18.498688718 -0300 |
3 |
| -@@ -6,7 +6,6 @@ |
| 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 | 4 | import {IAccessManaged} from "./IAccessManaged.sol";
|
5 | 5 | import {Address} from "../../utils/Address.sol";
|
6 | 6 | import {Context} from "../../utils/Context.sol";
|
7 | 7 | -import {Multicall} from "../../utils/Multicall.sol";
|
8 | 8 | import {Math} from "../../utils/math/Math.sol";
|
9 | 9 | import {Time} from "../../utils/types/Time.sol";
|
10 |
| - |
11 |
| -@@ -57,7 +56,8 @@ |
12 |
| - * mindful of the danger associated with functions such as {{Ownable-renounceOwnership}} or |
13 |
| - * {{AccessControl-renounceRole}}. |
| 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 | 14 | */
|
15 | 15 | -contract AccessManager is Context, Multicall, IAccessManager {
|
16 | 16 | +// NOTE: The FV version of this contract doesn't include Multicall because CVL HAVOCs on any `delegatecall`.
|
17 | 17 | +contract AccessManager is Context, IAccessManager {
|
18 | 18 | using Time for *;
|
19 | 19 |
|
20 | 20 | // Structure that stores the details for a target contract.
|
21 |
| -@@ -105,7 +105,7 @@ |
| 21 | +@@ -115,7 +115,7 @@ |
22 | 22 |
|
23 | 23 | // Used to identify operations that are currently being executed via {execute}.
|
24 | 24 | // This should be transient storage when supported by the EVM.
|
25 | 25 | - bytes32 private _executionId;
|
26 | 26 | + bytes32 internal _executionId; // private → internal for FV
|
27 | 27 |
|
28 | 28 | /**
|
29 |
| - * @dev Check that the caller is authorized to perform the operation, following the restrictions encoded in |
30 |
| -@@ -253,6 +253,11 @@ |
| 29 | + * @dev Check that the caller is authorized to perform the operation. |
| 30 | +@@ -263,6 +263,11 @@ |
31 | 31 | _setGrantDelay(roleId, newDelay);
|
32 | 32 | }
|
33 | 33 |
|
|
39 | 39 | /**
|
40 | 40 | * @dev Internal version of {grantRole} without access control. Returns true if the role was newly granted.
|
41 | 41 | *
|
42 |
| -@@ -287,6 +292,11 @@ |
43 |
| - return newMember; |
44 |
| - } |
| 42 | +@@ -295,6 +300,11 @@ |
45 | 43 |
|
| 44 | + emit RoleGranted(roleId, account, executionDelay, since, newMember); |
| 45 | + return newMember; |
| 46 | ++ } |
| 47 | ++ |
46 | 48 | + // Exposed for FV
|
47 | 49 | + function _getRoleGrantDelayFull(uint64 roleId) internal view virtual returns (uint32, uint32, uint48) {
|
48 | 50 | + return _roles[roleId].grantDelay.getFull();
|
49 |
| -+ } |
50 |
| -+ |
51 |
| - /** |
52 |
| - * @dev Internal version of {revokeRole} without access control. This logic is also used by {renounceRole}. |
53 |
| - * Returns true if the role was previously granted. |
54 |
| -@@ -586,7 +596,7 @@ |
| 51 | + } |
| 52 | + |
55 | 53 | /**
|
56 |
| - * @dev Check if the current call is authorized according to admin logic. |
| 54 | +@@ -596,7 +606,7 @@ |
| 55 | + * |
| 56 | + * WARNING: Carefully review the considerations of {AccessManaged-restricted} since they apply to this modifier. |
57 | 57 | */
|
58 | 58 | - function _checkAuthorized() private {
|
59 | 59 | + function _checkAuthorized() internal virtual { // private → internal virtual for FV
|
60 | 60 | address caller = _msgSender();
|
61 | 61 | (bool immediate, uint32 delay) = _canCallSelf(caller, _msgData());
|
62 | 62 | if (!immediate) {
|
63 |
| -@@ -609,7 +619,7 @@ |
| 63 | +@@ -619,7 +629,7 @@ |
64 | 64 | */
|
65 | 65 | function _getAdminRestrictions(
|
66 | 66 | bytes calldata data
|
|
69 | 69 | if (data.length < 4) {
|
70 | 70 | return (false, 0, 0);
|
71 | 71 | }
|
72 |
| -@@ -662,7 +672,7 @@ |
| 72 | +@@ -672,7 +682,7 @@ |
73 | 73 | address caller,
|
74 | 74 | address target,
|
75 | 75 | bytes calldata data
|
|
78 | 78 | if (target == address(this)) {
|
79 | 79 | return _canCallSelf(caller, data);
|
80 | 80 | } else {
|
81 |
| -@@ -716,14 +726,14 @@ |
| 81 | +@@ -728,14 +738,14 @@ |
82 | 82 | /**
|
83 | 83 | * @dev Extracts the selector from calldata. Panics if data is not at least 4 bytes
|
84 | 84 | */
|
|
92 | 92 | */
|
93 | 93 | - function _hashExecutionId(address target, bytes4 selector) private pure returns (bytes32) {
|
94 | 94 | + function _hashExecutionId(address target, bytes4 selector) internal pure returns (bytes32) { // private → internal for FV
|
95 |
| - return keccak256(abi.encode(target, selector)); |
| 95 | + return Hashes.efficientKeccak256(bytes32(uint256(uint160(target))), selector); |
96 | 96 | }
|
97 | 97 | }
|
0 commit comments