Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed inconsistent licensing manager role #250

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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