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(SPG): refactor SPG into "workflow" contracts #68

Merged
merged 11 commits into from
Sep 17, 2024

Conversation

sebsadface
Copy link
Member

Description

This PR refactors the monolithic StoryProtocolGateway into three "workflow" contracts. The associated tests, deployment, and upgrade scripts have been updated accordingly. Following this change, the Story PoC Periphery now includes the following five main contracts:

  • RegistrationWorkflows (new)
  • LicenseAttachmentWorkflows (new)
  • DerivativeWorkflows (new)
  • GroupingWorkflows (existing)
  • SPGNFT (existing)

Key Changes

  • Split StoryProtocolGateway.sol into three separate contracts: RegistrationWorkflows.sol, LicenseAttachmentWorkflows.sol, and DerivativeWorkflows.sol. Their interfaces were also separated accordingly.
  • Added WorkflowStructs to contain shared struct definitions across the different workflows.
  • Updated DeployHelper to support the deployment of the new workflow contracts.
  • Moved mock core protocol deployment logic from BaseTest to DeployHelper.
  • Added Users utility library to setup mock users and secret keys for tests.
  • Refactored SPG tests into three separate test files corresponding to the new workflow contracts.
  • Created UpgradeHelper to house shared logic for upgrading workflow contracts.
  • Added upgrade scripts for the new workflow contracts and updated the existing upgrade scripts.
  • Updated documentation to reflect these changes.

Test Plan

All new and existing tests pass locally.

Related Issue

Notes

This PR introduces significant changes to the contract interfaces, which will require updates to existing integrations.

@sebsadface sebsadface merged commit 9891156 into storyprotocol:main Sep 17, 2024
3 checks passed
@sebsadface sebsadface deleted the refactor-main branch October 16, 2024 04:25
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 SPG Contract into Multiple "Workflow" Contracts
2 participants