Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
updata parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinGreen committed Dec 9, 2023
1 parent 02d6016 commit 07803ef
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions src/llama-scripts/LlamaGovernanceScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -220,19 +220,19 @@ contract LlamaGovernanceScript is LlamaBaseScript {

/// @notice Update a role description and set role holders for the updated role.
/// @param roleDescription Role description to update.
/// @param _setRoleHolders Array of role holders to set.
/// @param roleHolderData Array of role holders to set.
function updateRoleDescriptionAndRoleHolders(
UpdateRoleDescription calldata roleDescription,
RoleHolderData[] calldata _setRoleHolders
RoleHolderData[] calldata roleHolderData
) external onlyDelegateCall {
(, LlamaPolicy policy) = _context();
policy.updateRoleDescription(roleDescription.role, roleDescription.description);

uint256 length = _setRoleHolders.length;
uint256 length = roleHolderData.length;
for (uint256 i = 0; i < length; i = LlamaUtils.uncheckedIncrement(i)) {
if (_setRoleHolders[i].role != roleDescription.role) revert RoleIsNotUpdatedRole(_setRoleHolders[i].role);
if (roleHolderData[i].role != roleDescription.role) revert RoleIsNotUpdatedRole(roleHolderData[i].role);
}
setRoleHolders(_setRoleHolders);
setRoleHolders(roleHolderData);
}

/// @notice Create account and grant permissions to one or many roles with the account as a target.
Expand Down Expand Up @@ -367,39 +367,36 @@ contract LlamaGovernanceScript is LlamaBaseScript {
}

/// @notice Batch set role holders with the provided data.
/// @param _setRoleHolders Array of role holders to set.
function setRoleHolders(RoleHolderData[] memory _setRoleHolders) public onlyDelegateCall {
/// @param roleHolderData Array of role holders to set.
function setRoleHolders(RoleHolderData[] memory roleHolderData) public onlyDelegateCall {
(, LlamaPolicy policy) = _context();
uint256 length = _setRoleHolders.length;
uint256 length = roleHolderData.length;
for (uint256 i = 0; i < length; i = LlamaUtils.uncheckedIncrement(i)) {
policy.setRoleHolder(
_setRoleHolders[i].role,
_setRoleHolders[i].policyholder,
_setRoleHolders[i].quantity,
_setRoleHolders[i].expiration
roleHolderData[i].role, roleHolderData[i].policyholder, roleHolderData[i].quantity, roleHolderData[i].expiration
);
}
}

/// @notice Batch set role permissions with the provided data.
/// @param _setRolePermissions Array of role permissions to set.
function setRolePermissions(RolePermissionData[] memory _setRolePermissions) public onlyDelegateCall {
/// @param rolePermissionData Array of role permissions to set.
function setRolePermissions(RolePermissionData[] memory rolePermissionData) public onlyDelegateCall {
(, LlamaPolicy policy) = _context();
uint256 length = _setRolePermissions.length;
uint256 length = rolePermissionData.length;
for (uint256 i = 0; i < length; i = LlamaUtils.uncheckedIncrement(i)) {
policy.setRolePermission(
_setRolePermissions[i].role, _setRolePermissions[i].permissionData, _setRolePermissions[i].hasPermission
rolePermissionData[i].role, rolePermissionData[i].permissionData, rolePermissionData[i].hasPermission
);
}
}

/// @notice Batch revoke policies with the provided data.
/// @param _revokePolicies Array of policies to revoke.
function revokePolicies(address[] calldata _revokePolicies) external onlyDelegateCall {
/// @param policies Array of policies to revoke.
function revokePolicies(address[] calldata policies) external onlyDelegateCall {
(, LlamaPolicy policy) = _context();
uint256 length = _revokePolicies.length;
uint256 length = policies.length;
for (uint256 i = 0; i < length; i = LlamaUtils.uncheckedIncrement(i)) {
policy.revokePolicy(_revokePolicies[i]);
policy.revokePolicy(policies[i]);
}
}

Expand Down

0 comments on commit 07803ef

Please sign in to comment.