Fix some spelling issues in AccessManager.sol & Time.sol (#4571)
Co-authored-by: Francisco <fg@frang.io>
This commit is contained in:
@ -45,7 +45,7 @@ import {Time} from "../../utils/types/Time.sol";
|
||||
* will be {AccessManager} itself.
|
||||
*
|
||||
* WARNING: When granting permissions over an {Ownable} or {AccessControl} contract to an {AccessManager}, be very
|
||||
* mindful of the danger associated with functions such as {{Ownable-renounceOwnership}} or
|
||||
* mindful of the danger associated with functions such as {{Ownable-renounceOwnership}} or
|
||||
* {{AccessControl-renounceRole}}.
|
||||
*/
|
||||
contract AccessManager is Context, Multicall, IAccessManager {
|
||||
@ -56,10 +56,10 @@ contract AccessManager is Context, Multicall, IAccessManager {
|
||||
bool closed;
|
||||
}
|
||||
|
||||
// Structure that stores the details for a group/account pair. This structures fit into a single slot.
|
||||
// Structure that stores the details for a group/account pair. This structure fits into a single slot.
|
||||
struct Access {
|
||||
// Timepoint at which the user gets the permission. If this is either 0, or in the future, the group permission
|
||||
// are not available. Should be checked using {Time-isSetAndPast}
|
||||
// is not available. Should be checked using {Time-isSetAndPast}
|
||||
uint48 since;
|
||||
// delay for execution. Only applies to restricted() / relay() calls. This does not restrict access to
|
||||
// functions that use the `onlyGroup` modifier.
|
||||
@ -70,7 +70,7 @@ contract AccessManager is Context, Multicall, IAccessManager {
|
||||
// - the members of the group
|
||||
// - the admin group (that can grant or revoke permissions)
|
||||
// - the guardian group (that can cancel operations targeting functions that need this group
|
||||
// - the grand delay
|
||||
// - the grant delay
|
||||
struct Group {
|
||||
mapping(address user => Access access) members;
|
||||
uint64 admin;
|
||||
@ -97,7 +97,7 @@ contract AccessManager is Context, Multicall, IAccessManager {
|
||||
|
||||
mapping(bytes32 operationId => Schedule) private _schedules;
|
||||
|
||||
// This should be transcient storage when supported by the EVM.
|
||||
// This should be transient storage when supported by the EVM.
|
||||
bytes32 private _relayIdentifier;
|
||||
|
||||
/**
|
||||
@ -128,8 +128,8 @@ contract AccessManager is Context, Multicall, IAccessManager {
|
||||
* the schedule, leaving the possibility of multiple executions. Maybe this function should not be view?
|
||||
*
|
||||
* NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that
|
||||
* is backward compatible. Some contract may thus ignore the second return argument. In that case they will fail
|
||||
* to identify the indirect workflow, and will consider call that require a delay to be forbidden.
|
||||
* is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail
|
||||
* to identify the indirect workflow, and will consider calls that require a delay to be forbidden.
|
||||
*/
|
||||
function canCall(address caller, address target, bytes4 selector) public view virtual returns (bool, uint32) {
|
||||
(uint64 classId, bool closed) = getContractClass(target);
|
||||
@ -212,7 +212,7 @@ contract AccessManager is Context, Multicall, IAccessManager {
|
||||
|
||||
/**
|
||||
* @dev Get the access details for a given account in a given group. These details include the timepoint at which
|
||||
* membership becomes active, and the delay applied to all operation by this user that require this permission
|
||||
* membership becomes active, and the delay applied to all operation by this user that requires this permission
|
||||
* level.
|
||||
*
|
||||
* Returns:
|
||||
@ -607,7 +607,7 @@ contract AccessManager is Context, Multicall, IAccessManager {
|
||||
) public virtual returns (bytes32 operationId, uint32 nonce) {
|
||||
address caller = _msgSender();
|
||||
|
||||
// Fetch restriction to that apply to the caller on the targeted function
|
||||
// Fetch restrictions that apply to the caller on the targeted function
|
||||
(bool allowed, uint32 setback) = _canCallExtended(caller, target, data);
|
||||
|
||||
uint48 minWhen = Time.timestamp() + setback;
|
||||
@ -656,7 +656,7 @@ contract AccessManager is Context, Multicall, IAccessManager {
|
||||
function relay(address target, bytes calldata data) public payable virtual returns (uint32) {
|
||||
address caller = _msgSender();
|
||||
|
||||
// Fetch restriction to that apply to the caller on the targeted function
|
||||
// Fetch restrictions that apply to the caller on the targeted function
|
||||
(bool allowed, uint32 setback) = _canCallExtended(caller, target, data);
|
||||
|
||||
// If caller is not authorised, revert
|
||||
|
||||
@ -44,9 +44,9 @@ library Time {
|
||||
/**
|
||||
* @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the
|
||||
* future. The "effect" timepoint describes when the transitions happens from the "old" value to the "new" value.
|
||||
* This allows updating the delay applied to some operation while keeping so guarantees.
|
||||
* This allows updating the delay applied to some operation while keeping some guarantees.
|
||||
*
|
||||
* In particular, the {update} function guarantees that is the delay is reduced, the old delay still applies for
|
||||
* In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for
|
||||
* some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set
|
||||
* the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should
|
||||
* still apply for some time.
|
||||
@ -113,8 +113,8 @@ library Time {
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Update a Delay object so that it takes a new duration after at a timepoint that is automatically computed
|
||||
* to enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the
|
||||
* @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to
|
||||
* enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the
|
||||
* new delay becomes effective.
|
||||
*/
|
||||
function withUpdate(Delay self, uint32 newValue, uint32 minSetback) internal view returns (Delay, uint48) {
|
||||
|
||||
Reference in New Issue
Block a user