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

Commit

Permalink
fix: add approvals and other fixes for royalty upfront payments
Browse files Browse the repository at this point in the history
  • Loading branch information
jdubpark authored and Ramarti committed Feb 9, 2024
1 parent 94423c2 commit 6bbc90a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions test/foundry/integration/big-bang/NftLicenseRoyalty.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ contract BigBang_Integration_NftLicenseRoyalty is BaseIntegration, Integration_S
// Bob mints 1 license from Alice's NFT 1 IPAccount, registers NFT 2 IPAccount, and links using the license
{
vm.startPrank(u.bob);
USDC.approve(address(royaltyPolicyLS), mintFeeAmount);
uint256 bob_license_from_root_alice = licensingModule.mintLicense(
policyIds["uml_com_deriv_reciprocal"],
ipAcct[1], // Alice's IPAccount
Expand All @@ -120,6 +121,7 @@ contract BigBang_Integration_NftLicenseRoyalty is BaseIntegration, Integration_S
// Carl mints 1 license from Bob's NFT 2 IPAccount, registers NFT 3 IPAccount, and links using the license
{
vm.startPrank(u.carl);
USDC.approve(address(royaltyPolicyLS), mintFeeAmount);
uint256 carl_license_from_bob = licensingModule.mintLicense(
policyIds["uml_com_deriv_reciprocal"],
ipAcct[2], // Bob's IPAccount
Expand Down Expand Up @@ -149,6 +151,7 @@ contract BigBang_Integration_NftLicenseRoyalty is BaseIntegration, Integration_S
// Dan mints 1 license from Carl's NFT 3 IPAccount, registers NFT 4 IPAccount, and links using the license
{
vm.startPrank(u.dan);
USDC.approve(address(royaltyPolicyLS), mintFeeAmount);
uint256 dan_license_from_carl = licensingModule.mintLicense(
policyIds["uml_com_deriv_reciprocal"],
ipAcct[3], // Carl's IPAccount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ contract BigBang_Integration_SingleNftCollection is BaseIntegration, Integration
commercializers: new string[](0),
commercialRevShare: 10,
royaltyPolicy: address(royaltyPolicyLS),
mintingFeeAmount: mintFeeAmount,
mintingFeeAmount: 0, // no unpfront payment
mintingFeeToken: address(USDC)
}),
UMLPolicyDerivativeParams({
Expand Down
4 changes: 4 additions & 0 deletions test/foundry/modules/licensing/LicensingModule.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ contract LicensingModuleTest is Test {

vm.label(ipId1, "IPAccount1");
vm.label(ipId2, "IPAccount2");

// For `test_LicensingModule_licenseUri` to use UML policy, we must whitelist the royalty token.
// TODO: fix to use mock
royaltyModule.whitelistRoyaltyToken(address(USDC), true);
}

function _createPolicy() internal pure returns (bytes memory) {
Expand Down
2 changes: 1 addition & 1 deletion test/foundry/modules/royalty/LSClaimer.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ contract TestLSClaimer is TestHelper {
commercializers: new string[](0),
commercialRevShare: 10,
royaltyPolicy: address(royaltyPolicyLS),
mintingFeeAmount: mintFeeAmount,
mintingFeeAmount: 0, // no upfront payment for LSClaimer
mintingFeeToken: address(USDC)
}),
UMLPolicyDerivativeParams({
Expand Down

0 comments on commit 6bbc90a

Please sign in to comment.