|
@@ -1,16 +1,16 @@
|
|
|
---- access/manager/AccessManager.sol 2023-10-05 12:17:09.694051809 -0300
|
|
|
-+++ access/manager/AccessManager.sol 2023-10-05 12:26:18.498688718 -0300
|
|
|
-@@ -6,7 +6,6 @@
|
|
|
+--- access/manager/AccessManager.sol 2025-08-16 15:15:34
|
|
|
++++ access/manager/AccessManager.sol 2025-08-16 15:17:51
|
|
|
+@@ -7,7 +7,6 @@
|
|
|
import {IAccessManaged} from "./IAccessManaged.sol";
|
|
|
import {Address} from "../../utils/Address.sol";
|
|
|
import {Context} from "../../utils/Context.sol";
|
|
|
-import {Multicall} from "../../utils/Multicall.sol";
|
|
|
import {Math} from "../../utils/math/Math.sol";
|
|
|
import {Time} from "../../utils/types/Time.sol";
|
|
|
-
|
|
|
-@@ -57,7 +56,8 @@
|
|
|
- * mindful of the danger associated with functions such as {{Ownable-renounceOwnership}} or
|
|
|
- * {{AccessControl-renounceRole}}.
|
|
|
+ import {Hashes} from "../../utils/cryptography/Hashes.sol";
|
|
|
+@@ -59,7 +58,8 @@
|
|
|
+ * mindful of the danger associated with functions such as {Ownable-renounceOwnership} or
|
|
|
+ * {AccessControl-renounceRole}.
|
|
|
*/
|
|
|
-contract AccessManager is Context, Multicall, IAccessManager {
|
|
|
+// NOTE: The FV version of this contract doesn't include Multicall because CVL HAVOCs on any `delegatecall`.
|
|
@@ -18,7 +18,7 @@
|
|
|
using Time for *;
|
|
|
|
|
|
// Structure that stores the details for a target contract.
|
|
|
-@@ -105,7 +105,7 @@
|
|
|
+@@ -115,7 +115,7 @@
|
|
|
|
|
|
// Used to identify operations that are currently being executed via {execute}.
|
|
|
// This should be transient storage when supported by the EVM.
|
|
@@ -26,8 +26,8 @@
|
|
|
+ bytes32 internal _executionId; // private → internal for FV
|
|
|
|
|
|
/**
|
|
|
- * @dev Check that the caller is authorized to perform the operation, following the restrictions encoded in
|
|
|
-@@ -253,6 +253,11 @@
|
|
|
+ * @dev Check that the caller is authorized to perform the operation.
|
|
|
+@@ -263,6 +263,11 @@
|
|
|
_setGrantDelay(roleId, newDelay);
|
|
|
}
|
|
|
|
|
@@ -39,28 +39,28 @@
|
|
|
/**
|
|
|
* @dev Internal version of {grantRole} without access control. Returns true if the role was newly granted.
|
|
|
*
|
|
|
-@@ -287,6 +292,11 @@
|
|
|
- return newMember;
|
|
|
- }
|
|
|
+@@ -295,6 +300,11 @@
|
|
|
|
|
|
+ emit RoleGranted(roleId, account, executionDelay, since, newMember);
|
|
|
+ return newMember;
|
|
|
++ }
|
|
|
++
|
|
|
+ // Exposed for FV
|
|
|
+ function _getRoleGrantDelayFull(uint64 roleId) internal view virtual returns (uint32, uint32, uint48) {
|
|
|
+ return _roles[roleId].grantDelay.getFull();
|
|
|
-+ }
|
|
|
-+
|
|
|
- /**
|
|
|
- * @dev Internal version of {revokeRole} without access control. This logic is also used by {renounceRole}.
|
|
|
- * Returns true if the role was previously granted.
|
|
|
-@@ -586,7 +596,7 @@
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
- * @dev Check if the current call is authorized according to admin logic.
|
|
|
+@@ -596,7 +606,7 @@
|
|
|
+ *
|
|
|
+ * WARNING: Carefully review the considerations of {AccessManaged-restricted} since they apply to this modifier.
|
|
|
*/
|
|
|
- function _checkAuthorized() private {
|
|
|
+ function _checkAuthorized() internal virtual { // private → internal virtual for FV
|
|
|
address caller = _msgSender();
|
|
|
(bool immediate, uint32 delay) = _canCallSelf(caller, _msgData());
|
|
|
if (!immediate) {
|
|
|
-@@ -609,7 +619,7 @@
|
|
|
+@@ -619,7 +629,7 @@
|
|
|
*/
|
|
|
function _getAdminRestrictions(
|
|
|
bytes calldata data
|
|
@@ -69,7 +69,7 @@
|
|
|
if (data.length < 4) {
|
|
|
return (false, 0, 0);
|
|
|
}
|
|
|
-@@ -662,7 +672,7 @@
|
|
|
+@@ -672,7 +682,7 @@
|
|
|
address caller,
|
|
|
address target,
|
|
|
bytes calldata data
|
|
@@ -78,7 +78,7 @@
|
|
|
if (target == address(this)) {
|
|
|
return _canCallSelf(caller, data);
|
|
|
} else {
|
|
|
-@@ -716,14 +726,14 @@
|
|
|
+@@ -728,14 +738,14 @@
|
|
|
/**
|
|
|
* @dev Extracts the selector from calldata. Panics if data is not at least 4 bytes
|
|
|
*/
|
|
@@ -92,6 +92,6 @@
|
|
|
*/
|
|
|
- function _hashExecutionId(address target, bytes4 selector) private pure returns (bytes32) {
|
|
|
+ function _hashExecutionId(address target, bytes4 selector) internal pure returns (bytes32) { // private → internal for FV
|
|
|
- return keccak256(abi.encode(target, selector));
|
|
|
+ return Hashes.efficientKeccak256(bytes32(uint256(uint160(target))), selector);
|
|
|
}
|
|
|
}
|