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

Refactored Licensing from parameter based to framework based. #44

Merged
merged 21 commits into from
Jan 31, 2024

Conversation

Ramarti
Copy link
Contributor

@Ramarti Ramarti commented Jan 29, 2024

  • Policy as the unit of licensing instead of parameter.
  • Introducing PolicyFrameworkManagers as the contracts in charge of:
    -- Creating policies (values representing a particular licensing template, like UML)
    -- Verifying those policies make sense before registering into the LicenseRegistry
    -- Encoding and decoding them into the LicenseRegistry
    -- Verifying licensing parameter compliance

As an analogy with BalancerV2, LicenseRegistry is our Vault, and each PolicyFrameworkManager defines each pool's logic.

@Ramarti Ramarti requested review from jdubpark, leeren, kingster-will, LeoHChen, jzhao23 and Spablob and removed request for jdubpark and leeren January 29, 2024 21:35
@Ramarti Ramarti marked this pull request as ready for review January 29, 2024 21:36
Copy link

@jzhao23 jzhao23 left a comment

Choose a reason for hiding this comment

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

Overall great progress, left lots of inline comments!

Copy link
Member

@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.

IMO, the change is already too big to review carefully. Since it is a big refactoring code, to make it easier to review.
Please do

  1. Rebase the PR to the latest code
  2. Make it runnable
  3. Add test cases to provide better coverage
  4. Add integration test, working with @jdubpark
  5. Merge the code

Host a review session separately for the entire licensing policy and framework.

contracts/lib/Errors.sol Outdated Show resolved Hide resolved
@Ramarti Ramarti merged commit da23522 into storyprotocol:main Jan 31, 2024
1 check passed
jdubpark added a commit that referenced this pull request Jan 31, 2024
* refactored licensing from param based to fw based

* test policy integrity

* test tranferability

* feat: Integration test work, Script mods, Mock type changes, linting and refactoring

* renamed setByLinking to inherited policy

* refactor LicenseFramework into PolicyFramework

* refactor naming to policy framework

* comments and linting

* Update contracts/interfaces/licensing/IMintParamVerifier.sol

* Update contracts/interfaces/licensing/IPolicyFrameworkManager.sol

* refactor frameworkId to policyFrameworkId

* moved UMLFramework errors to another file

* rename IParamVerifier into IPolicyVerifier

* Adding Access Control to License

* feat: License NFT URI for UMLPolicyFrameworkManager, test and lint

* refactored licensing from param based to fw based

* refactor naming to policy framework

* comments and linting

* rename IParamVerifier into IPolicyVerifier

---------

Co-authored-by: Raul <raul@proofofcode.dev>
Co-authored-by: Jongwon Park <jwparktom@gmail.com>
Co-authored-by: Kingster <atarneo2015@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants