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

Commit

Permalink
refactor: remove contract initializing setter fns in interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
jdubpark committed Feb 17, 2024
1 parent 9f838e9 commit 605e4e1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
4 changes: 0 additions & 4 deletions contracts/interfaces/modules/royalty/IRoyaltyModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ interface IRoyaltyModule is IModule {
/// @param ipId The ipId
function isRoyaltyPolicyImmutable(address ipId) external view returns (bool);

/// @notice Sets the licensing module
/// @param licensingModule The address of the licensing module
function setLicensingModule(address licensingModule) external;

/// @notice Whitelist a royalty policy
/// @param royaltyPolicy The address of the royalty policy
/// @param allowed Indicates if the royalty policy is whitelisted or not
Expand Down
4 changes: 0 additions & 4 deletions contracts/interfaces/registries/ILicenseRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ interface ILicenseRegistry is IERC1155 {
Licensing.License licenseData
);

/// @notice Set the licensing module
/// @param newLicensingModule The address of the licensing module
function setLicensingModule(address newLicensingModule) external;

/// @notice Returns the address of the licensing module
function licensingModule() external view returns (address);

Expand Down
2 changes: 1 addition & 1 deletion contracts/modules/royalty-module/RoyaltyModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ contract RoyaltyModule is IRoyaltyModule, Governable, ReentrancyGuard, BaseModul
_;
}

/// @notice Sets the license registry
/// @dev Sets the license registry
/// @param _licensingModule The address of the license registry
function setLicensingModule(address _licensingModule) external onlyProtocolAdmin {
if (_licensingModule == address(0)) revert Errors.RoyaltyModule__ZeroLicensingModule();
Expand Down
6 changes: 4 additions & 2 deletions test/foundry/utils/BaseTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { AccessController } from "../../../contracts/AccessController.sol";
// solhint-disable-next-line max-line-length
import { IP_RESOLVER_MODULE_KEY, REGISTRATION_MODULE_KEY, DISPUTE_MODULE_KEY, TAGGING_MODULE_KEY, ROYALTY_MODULE_KEY, LICENSING_MODULE_KEY } from "../../../contracts/lib/modules/Module.sol";
import { AccessPermission } from "../../../contracts/lib/AccessPermission.sol";
import { RoyaltyModule } from "../../../contracts/modules/royalty-module/RoyaltyModule.sol";
import { LicenseRegistry } from "../../../contracts/registries/LicenseRegistry.sol";

// test
import { DeployHelper } from "./DeployHelper.t.sol";
Expand Down Expand Up @@ -155,7 +157,7 @@ contract BaseTest is Test, DeployHelper, LicensingHelper {
require(address(royaltyModule) != address(0), "royaltyModule not set");

vm.startPrank(u.admin);
royaltyModule.setLicensingModule(getLicensingModule());
RoyaltyModule(address(royaltyModule)).setLicensingModule(getLicensingModule());
royaltyModule.whitelistRoyaltyToken(address(erc20), true);
if (address(royaltyPolicyLS) != address(0)) {
royaltyModule.whitelistRoyaltyPolicy(address(royaltyPolicyLS), true);
Expand Down Expand Up @@ -183,7 +185,7 @@ contract BaseTest is Test, DeployHelper, LicensingHelper {
require(address(licenseRegistry) != address(0), "licenseRegistry not set");

vm.startPrank(u.admin);
licenseRegistry.setLicensingModule(getLicensingModule());
LicenseRegistry(address(licenseRegistry)).setLicensingModule(getLicensingModule());
vm.stopPrank();
}

Expand Down

0 comments on commit 605e4e1

Please sign in to comment.