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

Dispute effects on royalty #35

Merged
merged 9 commits into from
Apr 5, 2024

Conversation

Spablob
Copy link

@Spablob Spablob commented Apr 4, 2024

This pr adds royalty related restrictions when IP assets are tagged via dispute:

  • tagged IP assets are unable to receive license minting fee
  • tagged IP assets are unable to receive voluntary royalty payments
  • tagged IP assets IpRoyaltyVault does not allow claiming revenue tokens nor collect of royalty tokens

@Spablob Spablob marked this pull request as ready for review April 5, 2024 08:16
contracts/interfaces/modules/royalty/IRoyaltyModule.sol Outdated Show resolved Hide resolved
contracts/modules/royalty/RoyaltyModule.sol Outdated Show resolved Hide resolved
contracts/lib/Errors.sol Show resolved Hide resolved
contracts/lib/Errors.sol Show resolved Hide resolved
/// @param royaltyStack The royalty stack of a given ipId is the sum of the royalties to be paid to each ancestors
/// @param ancestorsAddresses The ancestors addresses array
/// @param ancestorsRoyalties Contains royalty token amounts for each ancestor on same index as ancestorsAddresses
struct LAPRoyaltyData {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any redundancy of those data with license data?

Copy link

@LeoHChen LeoHChen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in general. @kingster-will please also review.

Comment on lines +33 to +42
/// @notice Sets the licensing module
/// @dev Enforced to be only callable by the protocol admin
/// @param licensing The address of the license module
function setLicensingModule(address licensing) external;

/// @notice Sets the dispute module
/// @dev Enforced to be only callable by the protocol admin
/// @param dispute The address of the dispute module
function setDisputeModule(address dispute) external;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unnecessary to include these two functions in the interface, as no other contracts will invoke them. It would be sufficient to define only those functions that are directly related to the functionality of the royalty module. The two configuration functions are specific to the implementation and do not require definition in the interface.

Comment on lines 43 to +48
/// @notice Returns the licensing module address
function licensingModule() external view returns (address);

/// @notice Returns the dispute module address
function disputeModule() external view returns (address);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two can also be removed, as we don't expect the functions to be called by another contract.

Comment on lines +80 to +87
/// @notice Sets the dispute module
/// @dev Enforced to be only callable by the protocol admin
/// @param dispute The address of the dispute module
function setDisputeModule(address dispute) external onlyProtocolAdmin {
if (dispute == address(0)) revert Errors.RoyaltyModule__ZeroDisputeModule();
_getRoyaltyModuleStorage().disputeModule = dispute;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of making this "set" function as a governance function.
It would better follow the "update" pattern of updating the dispute module address according to ModuleRegistry.
We have apply the pattern in the CoreMedataViewModule:

    function updateCoreMetadataModule() external {
        coreMetadataModule = IModuleRegistry(MODULE_REGISTRY).getModule(CORE_METADATA_MODULE_KEY);
    }

in this case, it would be:

    function updateDisputeModule() external {
         _getRoyaltyModuleStorage().disputeModule = IModuleRegistry(MODULE_REGISTRY).getModule(DISPUTE_MODULE_KEY);
    }

so that the function can be permissionless and maintain code style consistency in our code base.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not advertise this as a "permissionless" method, because the setter of value in ModuleRegistry is still the governance. Simply delegating the reading & setting to the public, where the value is controlled by the governance.

But yes, this is a cleaner syntax since we don't need to pass in the dispute module address for each contract. Just update in the Module Registry, and then call updateDisputeModule in each relevant contract.

I recommend we make this change for all contracts in a separate PR, since most other modules are still using the old style.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, we will leave those changes to next PR @Spablob

@LeoHChen
Copy link

LeoHChen commented Apr 5, 2024

I will merge this PR, all open comments can be addressed in the next PR @Spablob . Thanks.

@LeoHChen LeoHChen merged commit c21d73d into storyprotocol:main Apr 5, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants