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(spg): add public minting support #65

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

sebsadface
Copy link
Member

Description

This PR adds public minting support for SPG functions that handle minting. It replaces the onlyCallerWithMinterRole access control modifier with onlyMintAuthorized, which checks if the caller is authorized to mint—either by having the minter role in the given SPG NFT contract or if the contract has publicMinting enabled.

Test Plan

  • Added test_SPG_revert_mintAndRegisterIp_callerNotAuthorizedToMint to verify that minting is blocked when the caller doesn't have the minter role and public minting is disabled in the collection.
  • Added test_SPG_mintAndRegisterIp_publicMint to test that minting is allowed when public minting is enabled, even if the caller doesn't have the minter role.
  • Existing tests already cover cases where the caller has the minter role, but public minting is disabled.

All new and existing tests pass locally.

Related Issue

@sebsadface sebsadface merged commit 22f208b into storyprotocol:main Sep 14, 2024
3 checks passed
@sebsadface sebsadface deleted the public-mint 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.

Add Public Minting Support to Periphery Contracts
2 participants