Skip to content

Commit

Permalink
Fix royalty redundancies (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spablob authored Jun 26, 2024
1 parent da6e2cb commit a4d54f4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
2 changes: 0 additions & 2 deletions contracts/modules/royalty/RoyaltyModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,6 @@ contract RoyaltyModule is
) external onlyLicensingModule {
RoyaltyModuleStorage storage $ = _getRoyaltyModuleStorage();
if (!$.isWhitelistedRoyaltyToken[token]) revert Errors.RoyaltyModule__NotWhitelistedRoyaltyToken();
if (DISPUTE_MODULE.isIpTagged(receiverIpId)) revert Errors.RoyaltyModule__IpIsTagged();
if (licenseRoyaltyPolicy == address(0)) revert Errors.RoyaltyModule__NoRoyaltyPolicySet();
if (!$.isWhitelistedRoyaltyPolicy[licenseRoyaltyPolicy])
revert Errors.RoyaltyModule__NotWhitelistedRoyaltyPolicy();
if (LICENSE_REGISTRY.isExpiredNow(receiverIpId)) revert Errors.RoyaltyModule__IpIsExpired();
Expand Down
6 changes: 1 addition & 5 deletions contracts/modules/royalty/policies/RoyaltyPolicyLAP.sol
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,7 @@ contract RoyaltyPolicyLAP is
/// @param ipId The to initialize the policy for
/// @param parentIpIds The parent ipIds that the children ipId is being linked to (if any)
/// @param licenseData The license data custom to each the royalty policy
function _initPolicy(
address ipId,
address[] memory parentIpIds,
bytes[] memory licenseData
) internal onlyRoyaltyModule {
function _initPolicy(address ipId, address[] memory parentIpIds, bytes[] memory licenseData) internal {
RoyaltyPolicyLAPStorage storage $ = _getRoyaltyPolicyLAPStorage();
// decode license data
uint32[] memory parentRoyalties = new uint32[](parentIpIds.length);
Expand Down
17 changes: 0 additions & 17 deletions test/foundry/modules/royalty/RoyaltyModule.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -370,23 +370,6 @@ contract TestRoyaltyModule is BaseTest {
assertEq(ipRoyaltyVaultUSDCBalAfter - ipRoyaltyVaultUSDCBalBefore, royaltyAmount);
}

function test_RoyaltyModule_payLicenseMintingFee_revert_IpIsTagged() public {
// raise dispute
vm.startPrank(ipAccount1);
USDC.approve(address(arbitrationPolicySP), ARBITRATION_PRICE);
disputeModule.raiseDispute(ipAddr, string("urlExample"), "PLAGIARISM", "");
vm.stopPrank();

// set dispute judgement
vm.startPrank(arbitrationRelayer);
disputeModule.setDisputeJudgement(1, true, "");

vm.startPrank(address(licensingModule));

vm.expectRevert(Errors.RoyaltyModule__IpIsTagged.selector);
royaltyModule.payLicenseMintingFee(ipAddr, ipAccount1, address(royaltyPolicyLAP), address(USDC), 100);
}

function test_RoyaltyModule_payLicenseMintingFee_revert_NotWhitelistedRoyaltyToken() public {
uint256 royaltyAmount = 100 * 10 ** 6;
address receiverIpId = address(2);
Expand Down

0 comments on commit a4d54f4

Please sign in to comment.