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

Prevent Recursive Derivatives in IP Registration #150

Conversation

kingster-will
Copy link

Description

This PR includes changes that enhance the registerDerivativeIp function in the LicenseRegistry contract. The function now checks whether the child IP already has a child IP before registering it as a derivative. This change is aimed at preventing recursive derivatives in our IP registration process.

Changes:

  1. Modified the registerDerivativeIp function to include a check for existing child IPs. If the child IP already has a child IP, the function will revert and prevent the registration.

  2. Updated the unit tests to reflect these changes.

Test Plan

Add unit tests to cover to new code changes

@jdubpark
Copy link

For clarification, is this disallowing a root IP with existing children from becoming a child itself?

Copy link

@Ramarti Ramarti left a comment

Choose a reason for hiding this comment

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

LGTM + Approved by auditors

@kingster-will
Copy link
Author

For clarification, is this disallowing a root IP with existing children from becoming a child itself?

Yes, in that case, the number of children of the root IP would not be 0, hence the root IP cannot be a child itself.

@Ramarti Ramarti merged commit 5ee5ff2 into storyprotocol:main Jun 27, 2024
3 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.

3 participants