Skip to content

Commit

Permalink
Fixed inconsistent licensing manager role (#250)
Browse files Browse the repository at this point in the history
* inconsistency in licensing roles

* remove inconsistency in tests

* removed role from deployment script

---------

Co-authored-by: Raul <[email protected]>
  • Loading branch information
Ramarti and Raul authored Dec 18, 2023
1 parent 400ffbf commit 4a354db
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 11 deletions.
2 changes: 0 additions & 2 deletions contracts/lib/AccessControl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,4 @@ library AccessControl {
// Role that can execute Hooks
bytes32 public constant HOOK_CALLER_ROLE = keccak256("HOOK_CALLER_ROLE");

// Role to set legal terms in TermsRepository
bytes32 public constant LICENSING_MANAGER = keccak256("LICENSING_MANAGER");
}
2 changes: 1 addition & 1 deletion contracts/modules/licensing/LicensingFrameworkRepo.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ contract LicensingFrameworkRepo is AccessControlled, Multicall {
/// @dev this is an admin only function, and can only be called by the
/// licensing manager role
/// @param input_ the input parameters for the framework
function addFramework(Licensing.SetFramework calldata input_) external onlyRole(AccessControl.LICENSING_MANAGER) {
function addFramework(Licensing.SetFramework calldata input_) external onlyRole(AccessControl.LICENSING_MANAGER_ROLE) {
FrameworkStorage storage framework = _frameworks[input_.id];
if (framework.paramTags.length() > 0) {
revert Errors.LicensingFrameworkRepo_FrameworkAlreadyAdded();
Expand Down
4 changes: 0 additions & 4 deletions script/foundry/deployment/Main.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,6 @@ contract Main is Script, BroadcastManager, JsonDeploymentHandler, ProxyHelper {
AccessControl.LICENSING_MANAGER_ROLE,
admin
);
accessControlSingleton.grantRole(
AccessControl.LICENSING_MANAGER,
admin
);
accessControlSingleton.grantRole(
AccessControl.IPORG_CREATOR_ROLE,
admin
Expand Down
2 changes: 1 addition & 1 deletion test/foundry/e2e/e2e.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ contract E2ETest is IE2ETest, BaseTest {
function setUp() public virtual override {
super.setUp();
_grantRole(vm, AccessControl.RELATIONSHIP_MANAGER_ROLE, admin);
_grantRole(vm, AccessControl.LICENSING_MANAGER, admin);
_grantRole(vm, AccessControl.LICENSING_MANAGER_ROLE, admin);
_grantRole(
vm,
AccessControl.HOOK_CALLER_ROLE,
Expand Down
4 changes: 2 additions & 2 deletions test/foundry/modules/licensing/LicensingFrameworkRepo.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract LicensingFrameworkRepoTest is Test, AccessControlHelper {

function setUp() public {
_setupAccessControl();
_grantRole(vm, AccessControl.LICENSING_MANAGER, admin);
_grantRole(vm, AccessControl.LICENSING_MANAGER_ROLE, admin);
repo = new LicensingFrameworkRepo(address(accessControl));
}

Expand Down Expand Up @@ -68,7 +68,7 @@ contract LicensingFrameworkRepoTest is Test, AccessControlHelper {
vm.expectRevert(
abi.encodeWithSelector(
Errors.MissingRole.selector,
AccessControl.LICENSING_MANAGER,
AccessControl.LICENSING_MANAGER_ROLE,
address(this)
)
);
Expand Down
2 changes: 1 addition & 1 deletion test/foundry/utils/BaseTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ contract BaseTest is BaseTestUtils, ProxyHelper, AccessControlHelper {

// Create Licensing contracts
licensingFrameworkRepo = new LicensingFrameworkRepo(address(accessControl));
_grantRole(vm, AccessControl.LICENSING_MANAGER, licensingManager);
_grantRole(vm, AccessControl.LICENSING_MANAGER_ROLE, licensingManager);

licenseRegistry = new LicenseRegistry(
address(registry),
Expand Down

0 comments on commit 4a354db

Please sign in to comment.