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

refactor(workflows): replace permission setting with executeWithSig #121

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

sebsadface
Copy link
Member

Description

This PR refactors workflow contracts to use the executeWithSig function from IPAccount, and enables direct calls to core protocol functions on behalf of the IP owner. This eliminates the need to grant extended permissions to workflow contracts via the protocol access controller, which enhances the security of periphery contracts by ensuring permissions are limited to the duration of a single workflow function call.

KeyChanges:

  • Removed PermissionHelper, the library contract previously used for setting permissions for periphery contracts.
  • Updated MetadataHelper to leverage executeWithSig for invoking core protocol functions, removing reliance on permission setting.
  • Introduced two new functions in LicensingHelper to support registering and attaching PIL terms using executeWithSig.
  • Updated minting fee and license token collection logic in DerivativeWorkflows to account for whether executeWithSig is used. This makes sure proper handling of minting fees and license tokens depending on whether msg.sender of the core protocol function is the workflow contract or the IP account.
  • Refactored all the rest workflow contracts to use executeWithSig for core protocol functions that require IP account permissions.
  • The function mintAndRegisterIpAndAttachLicenseAndAddToGroup in GroupingWorkflows still sets permissions through the access controller because the ipId is not known at the time of the function call. There are no known security issues for this approach.

Test Plan

The tests are updated to reflect these changes and all tests pass locally.

Related Issue

Notes

This PR include API changes, and requires updates to downstream integrations.

@sebsadface sebsadface merged commit a6fbf2c into storyprotocol:main Nov 20, 2024
3 checks passed
sebsadface added a commit to sebsadface/pp-v1 that referenced this pull request Nov 28, 2024
…teWithSig` (storyprotocol#121)"

This reverts commit a6fbf2c.

Revert "feat(licensing): support custom license templates and decouple terms registration from attachment (storyprotocol#123)"

This reverts commit 68f4a4a.

Revert "feat(licensing): enable multi-license attachment (storyprotocol#128)"

This reverts commit 027eed9.
sebsadface added a commit to sebsadface/pp-v1 that referenced this pull request Nov 28, 2024
…teWithSig` (storyprotocol#121)"

This reverts commit a6fbf2c.

Revert "feat(licensing): support custom license templates and decouple terms registration from attachment (storyprotocol#123)"

This reverts commit 68f4a4a.

Revert "feat(licensing): enable multi-license attachment (storyprotocol#128)"

This reverts commit 027eed9.
sebsadface added a commit that referenced this pull request Nov 29, 2024
…teWithSig` (#121)" (#133)

* Revert "refactor(permission): enable direct function calls via `executeWithSig` (#121)"

This reverts commit a6fbf2c.

Revert "feat(licensing): support custom license templates and decouple terms registration from attachment (#123)"

This reverts commit 68f4a4a.

Revert "feat(licensing): enable multi-license attachment (#128)"

This reverts commit 027eed9.

* test(derivative): fix stack too deep
@sebsadface sebsadface deleted the use-executeWithSig 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.

Refactor Periphery Contracts to Use executeWithSig for Direct Function Calls
2 participants