@@ -29,9 +29,15 @@ contract RoyaltyTokenDistributionWorkflowsTest is BaseTest {
29
29
WorkflowStructs.RoyaltyShare[] private royaltyShares;
30
30
WorkflowStructs.MakeDerivative private derivativeData;
31
31
32
+ /// DEPRECATED, WILL BE REMOVED IN V1.4----------------------------------------------------------------------------
33
+ PILTerms[] private commRemixTerms;
34
+ WorkflowStructs.MakeDerivativeDEPR private derivativeDataDEPR;
35
+ ///----------------------------------------------------------------------------------------------------------------
36
+
32
37
function setUp () public override {
33
38
super .setUp ();
34
39
_setUpTest ();
40
+ _setUpDEPR ();
35
41
}
36
42
37
43
function test_RoyaltyTokenDistributionWorkflows_mintAndRegisterIpAndAttachPILTermsAndDistributeRoyaltyTokens ()
@@ -53,7 +59,7 @@ contract RoyaltyTokenDistributionWorkflowsTest is BaseTest {
53
59
vm.stopPrank ();
54
60
55
61
assertTrue (ipAssetRegistry.isRegistered (ipId));
56
- assertEq (tokenId, 2 );
62
+ assertEq (tokenId, 3 );
57
63
assertEq (spgNftPublic.tokenURI (tokenId), string .concat (testBaseURI, ipMetadataDefault.nftMetadataURI));
58
64
assertMetadata (ipId, ipMetadataDefault);
59
65
_assertAttachedLicenseTerms (ipId, licenseTermsIds);
@@ -79,7 +85,7 @@ contract RoyaltyTokenDistributionWorkflowsTest is BaseTest {
79
85
});
80
86
vm.stopPrank ();
81
87
82
- assertEq (tokenId, 2 );
88
+ assertEq (tokenId, 3 );
83
89
assertEq (spgNftPublic.tokenURI (tokenId), string .concat (testBaseURI, ipMetadataDefault.nftMetadataURI));
84
90
assertEq (ipAssetRegistry.ipId (block .chainid , address (spgNftPublic), tokenId), ipId);
85
91
assertMetadata (ipId, ipMetadataDefault);
@@ -540,4 +546,112 @@ contract RoyaltyTokenDistributionWorkflowsTest is BaseTest {
540
546
(uint8 v , bytes32 r , bytes32 s ) = vm.sign (signerSk, digest);
541
547
signature = abi.encodePacked (r, s, v);
542
548
}
549
+
550
+ ////////////////////////////////////////////////////////////////////////////
551
+ // DEPRECATED, WILL BE REMOVED IN V1.4 //
552
+ ////////////////////////////////////////////////////////////////////////////
553
+
554
+ function test_RoyaltyTokenDistributionWorkflows_mintAndRegisterIpAndAttachPILTermsAndDistributeRoyaltyTokens_DEPR ()
555
+ public
556
+ {
557
+ vm.startPrank (u.alice);
558
+ mockToken.mint (u.alice, nftMintingFee + licenseMintingFee);
559
+ mockToken.approve (address (spgNftPublic), nftMintingFee);
560
+ mockToken.approve (address (royaltyTokenDistributionWorkflows), licenseMintingFee);
561
+
562
+ (address ipId , uint256 tokenId , uint256 [] memory licenseTermsIds ) = royaltyTokenDistributionWorkflows
563
+ .mintAndRegisterIpAndAttachPILTermsAndDistributeRoyaltyTokens_deprecated ({
564
+ spgNftContract: address (spgNftPublic),
565
+ recipient: u.alice,
566
+ ipMetadata: ipMetadataDefault,
567
+ terms: commRemixTerms,
568
+ royaltyShares: royaltyShares
569
+ });
570
+ vm.stopPrank ();
571
+
572
+ assertTrue (ipAssetRegistry.isRegistered (ipId));
573
+ assertEq (tokenId, 3 );
574
+ assertEq (spgNftPublic.tokenURI (tokenId), string .concat (testBaseURI, ipMetadataDefault.nftMetadataURI));
575
+ assertMetadata (ipId, ipMetadataDefault);
576
+ assertEq (licenseTermsIds[0 ], pilTemplate.getLicenseTermsId (commRemixTerms[0 ]));
577
+ (address licenseTemplateAttached , uint256 licenseTermsIdAttached ) = licenseRegistry.getAttachedLicenseTerms (
578
+ ipId,
579
+ 0
580
+ );
581
+ assertEq (licenseTemplateAttached, address (pilTemplate));
582
+ assertEq (licenseTermsIdAttached, pilTemplate.getLicenseTermsId (commRemixTerms[0 ]));
583
+ (licenseTemplateAttached, licenseTermsIdAttached) = licenseRegistry.getAttachedLicenseTerms (ipId, 1 );
584
+ assertEq (licenseTemplateAttached, address (pilTemplate));
585
+ assertEq (licenseTermsIdAttached, pilTemplate.getLicenseTermsId (commRemixTerms[1 ]));
586
+ _assertRoyaltyTokenDistribution (ipId);
587
+ }
588
+
589
+ function test_RoyaltyTokenDistributionWorkflows_revert_RoyaltyVaultNotDeployed_DEPR () public {
590
+ vm.startPrank (u.alice);
591
+ mockToken.mint (u.alice, licenseMintingFee);
592
+ mockToken.approve (address (spgNftPublic), licenseMintingFee);
593
+
594
+ PILTerms[] memory terms = new PILTerms [](1 );
595
+ terms[0 ] = PILFlavors.nonCommercialSocialRemixing ();
596
+ vm.expectRevert (Errors.RoyaltyTokenDistributionWorkflows__RoyaltyVaultNotDeployed.selector );
597
+ royaltyTokenDistributionWorkflows.mintAndRegisterIpAndAttachPILTermsAndDistributeRoyaltyTokens_deprecated ({
598
+ spgNftContract: address (spgNftPublic),
599
+ recipient: u.alice,
600
+ ipMetadata: ipMetadataDefault,
601
+ terms: terms,
602
+ royaltyShares: royaltyShares
603
+ });
604
+ vm.stopPrank ();
605
+ }
606
+
607
+ function _setUpDEPR () private {
608
+ uint32 testCommRevShare = 5 * 10 ** 6 ; // 5%
609
+
610
+ commRemixTerms.push (
611
+ PILFlavors.commercialRemix ({
612
+ mintingFee: licenseMintingFee,
613
+ commercialRevShare: testCommRevShare,
614
+ royaltyPolicy: address (royaltyPolicyLAP),
615
+ currencyToken: address (mockToken)
616
+ })
617
+ );
618
+
619
+ commRemixTerms.push (
620
+ PILFlavors.commercialRemix ({
621
+ mintingFee: licenseMintingFee,
622
+ commercialRevShare: testCommRevShare,
623
+ royaltyPolicy: address (royaltyPolicyLRP),
624
+ currencyToken: address (mockToken)
625
+ })
626
+ );
627
+
628
+ PILTerms[] memory commRemixTermsParent = new PILTerms [](1 );
629
+ commRemixTermsParent[0 ] = PILFlavors.commercialRemix ({
630
+ mintingFee: licenseMintingFee,
631
+ commercialRevShare: testCommRevShare,
632
+ royaltyPolicy: address (royaltyPolicyLRP),
633
+ currencyToken: address (mockToken)
634
+ });
635
+
636
+ address [] memory ipIdParent = new address [](1 );
637
+ uint256 [] memory licenseTermsIdsParent;
638
+ vm.startPrank (u.alice);
639
+ mockToken.mint (u.alice, licenseMintingFee);
640
+ mockToken.approve (address (spgNftPublic), licenseMintingFee);
641
+ (ipIdParent[0 ], , licenseTermsIdsParent) = licenseAttachmentWorkflows
642
+ .mintAndRegisterIpAndAttachPILTerms_deprecated ({
643
+ spgNftContract: address (spgNftPublic),
644
+ recipient: u.alice,
645
+ ipMetadata: ipMetadataDefault,
646
+ terms: commRemixTermsParent
647
+ });
648
+ vm.stopPrank ();
649
+
650
+ derivativeDataDEPR = WorkflowStructs.MakeDerivativeDEPR ({
651
+ parentIpIds: ipIdParent,
652
+ licenseTemplate: address (pilTemplate),
653
+ licenseTermsIds: licenseTermsIdsParent,
654
+ royaltyContext: ""
655
+ });
656
+ }
543
657
}
0 commit comments