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(SPGNFT): add setTokenURI function to SPGNFT Contract #189

Merged

Conversation

sebsadface
Copy link
Member

@sebsadface sebsadface commented Mar 3, 2025

Description

This PR adds functionality to allow NFT token owners to update their token URIs. The new setTokenURI function enables token owners to modify the metadata URI of their tokens while maintaining proper access control.

Changes

  • Added setTokenURI function to SPGNFT contract that allows token owners to update their token URIs
  • Added corresponding interface function to ISPGNFT
  • Added new SPGNFT__CallerNotOwner error for unauthorized access attempts
  • Added test cases to verify:
    • Successful token URI updates by token owners
    • Rejection of unauthorized attempts to update token URIs

Testing

  • Added test_SPGNFT_setTokenURI() to verify successful token URI updates
  • Added test_SPGNFT_setTokenURI_revert_callerNotOwner() to verify access control
  • All tests pass successfully

Related Issues

Adds ability for NFT token owners to update their token URIs with proper access control. Only the owner of a token can update its URI. Includes:
- New setTokenURI function in SPGNFT contract
- Interface update in ISPGNFT
- New SPGNFT__CallerNotOwner error
- Test cases for successful updates and unauthorized attempts
@sebsadface sebsadface force-pushed the feat/support-set-token-uri branch from c34336a to 2b3f5ac Compare March 3, 2025 21:19
kingster-will
kingster-will previously approved these changes Mar 3, 2025
Renames the tokenId parameter to tokenId_ in both the SPGNFT contract and ISPGNFT interface to maintain consistent parameter naming convention.
@sebsadface sebsadface force-pushed the feat/support-set-token-uri branch from daa4afb to 2f14a63 Compare March 4, 2025 03:30
@sebsadface sebsadface merged commit b322d41 into storyprotocol:main Mar 4, 2025
10 checks passed
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.

Support tokenURI Updates in SPGNFT
2 participants