Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
ypatil12 committed Nov 6, 2024
1 parent 3fbed49 commit 7cdcf56
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 48 deletions.
10 changes: 2 additions & 8 deletions src/contracts/core/AllocationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -296,18 +296,12 @@ contract AllocationManager is
}

/// @inheritdoc IAllocationManager
function updateAVSMetadataURI(
address avs,
string calldata metadataURI
) external checkCanCall(avs) {
function updateAVSMetadataURI(address avs, string calldata metadataURI) external checkCanCall(avs) {
emit AVSMetadataURIUpdated(msg.sender, metadataURI);
}

/// @inheritdoc IAllocationManager
function createOperatorSets(
address avs,
CreateSetParams[] calldata params
) external checkCanCall(avs) {
function createOperatorSets(address avs, CreateSetParams[] calldata params) external checkCanCall(avs) {
for (uint256 i = 0; i < params.length; i++) {
OperatorSet memory operatorSet = OperatorSet(avs, params[i].operatorSetId);

Expand Down
38 changes: 12 additions & 26 deletions src/contracts/interfaces/IAllocationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,7 @@ interface IAllocationManager is ISignatureUtils, IAllocationManagerErrors, IAllo
/**
* @notice Called by an AVS to slash an operator in a given operator set
*/
function slashOperator(
address avs,
SlashingParams calldata params
) external;
function slashOperator(address avs, SlashingParams calldata params) external;

/**
* @notice Modifies the proportions of slashable stake allocated to an operator set from a list of strategies
Expand All @@ -237,10 +234,7 @@ interface IAllocationManager is ISignatureUtils, IAllocationManagerErrors, IAllo
* @dev Updates encumberedMagnitude for the updated strategies
* @dev msg.sender is used as operator
*/
function modifyAllocations(
address operator,
AllocateParams[] calldata params
) external;
function modifyAllocations(address operator, AllocateParams[] calldata params) external;

/**
* @notice This function takes a list of strategies and for each strategy, removes from the deallocationQueue
Expand All @@ -265,10 +259,7 @@ interface IAllocationManager is ISignatureUtils, IAllocationManagerErrors, IAllo
* @dev After registering within the ALM, this method calls `avs.registerOperator` to complete
* registration. This call MUST succeed in order for registration to be successful.
*/
function registerForOperatorSets(
address operator,
RegisterParams calldata params
) external;
function registerForOperatorSets(address operator, RegisterParams calldata params) external;

/**
* @notice Allows an operator or AVS to deregister the operator from one or more of the AVS's operator sets.
Expand All @@ -288,18 +279,15 @@ interface IAllocationManager is ISignatureUtils, IAllocationManagerErrors, IAllo
* @param operator The operator to set the delay on behalf of.
* @param delay the allocation delay in blocks
*/
function setAllocationDelay(address operator, uint32 delay) external;
function setAllocationDelay(address operator, uint32 delay) external;

/**
* @notice Called by an AVS to configure the address that is called when an operator registers
* or is deregistered from the AVS's operator sets. If not set (or set to 0), defaults
* to the AVS's address.
* @param registrar the new registrar address
*/
function setAVSRegistrar(
address avs,
IAVSRegistrar registrar
) external;
function setAVSRegistrar(address avs, IAVSRegistrar registrar) external;

/**
* @notice Called by an AVS to emit an `AVSMetadataURIUpdated` event indicating the information has updated.
Expand All @@ -308,18 +296,12 @@ interface IAllocationManager is ISignatureUtils, IAllocationManagerErrors, IAllo
*
* @dev Note that the `metadataURI` is *never stored* and is only emitted in the `AVSMetadataURIUpdated` event.
*/
function updateAVSMetadataURI(
address avs,
string calldata metadataURI
) external;
function updateAVSMetadataURI(address avs, string calldata metadataURI) external;

/**
* @notice Allows an AVS to create new operator sets, defining strategies that the operator set uses
*/
function createOperatorSets(
address avs,
CreateSetParams[] calldata params
) external;
function createOperatorSets(address avs, CreateSetParams[] calldata params) external;

/**
* @notice Allows an AVS to add strategies to an operator set
Expand All @@ -337,7 +319,11 @@ interface IAllocationManager is ISignatureUtils, IAllocationManagerErrors, IAllo
* @param operatorSetId the operator set to remove strategies from
* @param strategies the strategies to remove
*/
function removeStrategiesFromOperatorSet(address avs, uint32 operatorSetId, IStrategy[] calldata strategies) external;
function removeStrategiesFromOperatorSet(
address avs,
uint32 operatorSetId,
IStrategy[] calldata strategies
) external;

/**
*
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/interfaces/IPermissionController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.27;

interface IPermissionControllerErrors {
/// @notice Thrown when the caller is not the admin
/// @notice Thrown when the caller is not the admin
error NotAdmin();
/// @notice Thrown when an admin is set to the zero address
error AdminAlreadySet();
Expand Down Expand Up @@ -67,7 +67,7 @@ interface IPermissionController is IPermissionControllerErrors, IPermissionContr
function removeDelegate(address account, address delegate, address target, bytes4 selector) external;

/**
* @notice Checks if the given caller is an admin of the account
* @notice Checks if the given caller is an admin of the account
* @dev If the account has no admin, the caller is checked to be the account itself
*/
function isAdmin(address account, address caller) external view returns (bool);
Expand Down
10 changes: 2 additions & 8 deletions src/contracts/interfaces/IRewardsCoordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,7 @@ interface IRewardsCoordinator is IRewardsCoordinatorErrors, IRewardsCoordinatorE
* @dev This function will revert if the `rewardsSubmission` is malformed,
* e.g. if the `strategies` and `weights` arrays are of non-equal lengths
*/
function createAVSRewardsSubmission(
address avs,
RewardsSubmission[] calldata rewardsSubmissions
) external;
function createAVSRewardsSubmission(address avs, RewardsSubmission[] calldata rewardsSubmissions) external;

/**
* @notice similar to `createAVSRewardsSubmission` except the rewards are split amongst *all* stakers
Expand Down Expand Up @@ -347,10 +344,7 @@ interface IRewardsCoordinator is IRewardsCoordinatorErrors, IRewardsCoordinatorE
* @param claimer The address of the entity that can call `processClaim` on behalf of the earner
* @dev Only callable by an address that configures the claimer
*/
function setClaimerFor(
address earner,
address claimer
) external;
function setClaimerFor(address earner, address claimer) external;

/**
* @notice Sets the delay in timestamp before a posted root can be claimed against
Expand Down
4 changes: 3 additions & 1 deletion src/contracts/mixins/PermissionControllerMixin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ abstract contract PermissionControllerMixin {
* @dev `msg.sender` is the caller to check that can call the function on behalf of `account`.
* @dev Returns a bool, instead of reverting
*/
function _checkCanCall(address account) internal returns (bool) {
function _checkCanCall(
address account
) internal returns (bool) {
return permissionController.canCall(account, msg.sender, address(this), msg.sig);
}
}
4 changes: 1 addition & 3 deletions src/contracts/permissions/PermissionController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ contract PermissionController is Initializable, PermissionControllerStorage {
_disableInitializers();
}

function initialize() external initializer{}
function initialize() external initializer {}

/**
*
Expand Down Expand Up @@ -51,8 +51,6 @@ contract PermissionController is Initializable, PermissionControllerStorage {
emit AdminRemoved(account, admin);
}



/// @inheritdoc IPermissionController
function setDelegate(
address account,
Expand Down

0 comments on commit 7cdcf56

Please sign in to comment.