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 & spgnft): add support for base URI #66

Merged
merged 3 commits into from
Sep 16, 2024

Conversation

sebsadface
Copy link
Member

Description

This PR adds support for base URIs in SPG and SPGNFT. The baseURI is optional. If set, the tokenURI will be either baseURI + token ID (if nftMetadataURI is empty) or baseURI + nftMetadataURI. When baseURI is empty, the tokenURI will be the nftMetadataURI provided during minting.

Key Changes

  • Added _baseURI storage to SPGNFT.
  • Added baseURI, setBaseURI, and an internal _baseURI function in SPGNFT for setting and retrieving base URIs.
  • Introduced an InitParam struct for SPGNFT to handle initialization parameters and avoid deep stack issues.
  • Updated the initialize function in SPGNFT and createCollection function in SPG to use the new InitParam struct.
  • Minor style and comment updates.

Tests

  • Added test_SPGNFT_setBaseURI to cover setting and retrieving base URIs, testing combinations of empty and non-empty baseURI and nftMetadataURI.
  • Updated existing tests to align with the changes in SPG and SPGNFT.

All tests (new and existing) pass locally.

Related Issue

Notes

This PR introduces interface changes to the createCollection function in SPG and functions in SPGNFT.

@sebsadface sebsadface merged commit 175186c into storyprotocol:main Sep 16, 2024
3 checks passed
@sebsadface sebsadface deleted the baseURI-support 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.

BaseURI Support in SPGNFT
2 participants