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

feat(hooks): add LockLicenseHook to locking/disabling licensing operations #102

Merged
merged 2 commits into from
Oct 19, 2024

Conversation

sebsadface
Copy link
Member

Description

This PR introduces the LockLicenseHook contract, which is designed to prevent any license token minting, derivative registration, and minting fee calculations. This hook can be used to effectively lock a license, preventing any further operations on it.

Changes

  • Added LockLicenseHook contract in contracts/hooks/LockLicenseHook.sol
  • Implemented ILicensingHook interface
  • Added custom error LockLicenseHook_LicenseLocked
  • Implemented beforeMintLicenseTokens, beforeRegisterDerivative, and calculateMintingFee functions to always revert
  • Added supportsInterface function for ERC165 compliance

Test Plan

Tested integration with the LicensingModule to verify that the hook prevents minting and derivative registration.

Usage

  1. To lock or disable a license:
    • IP owners should set the license configuration using the LicensingModule.
    • Set the LockLicenseHook as the license hook in the license configuration to enforce the lock.
  2. To unlock or re-enable a license:
    • Change the isSet flag to false in license configuration to deactivate the lock.
    • Alternatively, remove the lock by setting license hook to address(0) in license configuration.

Copy link
Collaborator

@kingster-will kingster-will left a comment

Choose a reason for hiding this comment

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

Looks good!
Please address the comment and submit.

@sebsadface sebsadface merged commit cd25593 into storyprotocol:main Oct 19, 2024
3 checks passed
@sebsadface sebsadface deleted the new-hook branch December 4, 2024 05:38
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.

2 participants