Closed sebsadface closed 2 months ago
The recent changes to the SPGNFT
and StoryProtocolGateway
contracts significantly enhance their metadata handling capabilities. The minting functions now allow for explicit metadata input during NFT creation, providing greater flexibility and clarity. By restructuring metadata parameters and supporting off-chain storage options, these updates improve usability and pave the way for more robust NFT management.
Files | Change Summary |
---|---|
contracts/SPGNFT.sol, contracts/interfaces/ISPGNFT.sol | Updated mint and mintBySPG functions to include nftMetadata parameter for better metadata management during NFT minting. |
contracts/StoryProtocolGateway.sol, contracts/interfaces/IStoryProtocolGateway.sol | Split metadata parameter into nftMetadata and ipMetadata for clarity in minting and registration functions, enhancing the contract's usability. |
test/SPGNFT.t.sol, test/StoryProtocolGateway.t.sol | Introduced new metadata variables in tests, adjusting assertions and minting calls to reflect changes in metadata handling for NFTs and IPs. |
sequenceDiagram
participant User
participant SPGNFT
participant StoryProtocolGateway
User->>SPGNFT: mint(address to, string nftMetadata)
SPGNFT->>SPGNFT: _mintToken(to, nftMetadata)
SPGNFT->>User: Return tokenId
User->>StoryProtocolGateway: mintAndRegisterIp(address nftContract, address recipient, string nftMetadata, IPMetadata ipMetadata)
StoryProtocolGateway->>StoryProtocolGateway: Process minting and registration
StoryProtocolGateway->>User: Return confirmation
Objective | Addressed | Explanation |
---|---|---|
SPG NFT supports set metadata (#17) | β | |
Ability to specify tokenURI during minting | β | |
Support for off-chain metadata storage option | β | Current changes do not implement off-chain metadata storage. |
π° In the meadow where the NFTs play,
Metadata dances in a bright array.
With every mint, a story to tell,
Off-chain whispers, we know it well.
Hopping through code, our joy we proclaim,
In the land of tokens, we play the game! πΌβ¨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Description
This PR adds support for setting metadata for SPG NFT, including:
metadata
parameter toipMetadata
to distinguish it from the newnftMetadata
parameter.Tests
Related Issue
This PR closes #17
Notes
An additional
nftMetadata
argument is now required for SPG functions with minting functionality (e.g.,mintAndRegisterIp
,mintAndRegisterIpAndAttachPILTerms
) and direct SPG NFT mint calls.Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests