-
Notifications
You must be signed in to change notification settings - Fork 6
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(contract): update SpaceOwner
token URI methods
#586
Conversation
Added new methods to manage default URI in `SpaceOwner` and `SpaceOwnerUriBase`. This includes setting and getting the default URI, updating the `_render` method to use the default URI, and adding relevant events and validation checks.
Simplify layout access in `SpaceOwner` with direct getter and setter methods. Add selectors for `setDefaultUri` and `getDefaultUri` in deployment script. Extend tests to cover new `setDefaultUri` functionality and improve `tokenURI` tests.
if (spaceAddress == address(0)) revert SpaceOwner__SpaceNotFound(); | ||
|
||
SpaceOwnerStorage.Space storage space = ds.spaceByAddress[spaceAddress]; | ||
string memory uri = bytes(space.uri).length == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe if the space sets the URI, we don't want to append the spaceAddress to it, we only want it when we're sending the default URI back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tak-hntlabs Could you confirm and update the Linear issue accordingly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, Brian is right. If the caller sets it explicitly, we should respect that, and not add any thing else to the returned uri. I'll update the Linear.
Streamline the logic for building URIs by prioritizing space URIs and falling back to the default URI. The test suite has been updated to reflect these changes, ensuring that URIs with and without trailing slashes are handled correctly.
Added Solady library to the project and updated `remappings.txt` and `copyLibs.js` accordingly. Replaced OpenZeppelin's `Strings` with Solady's `LibString` for string operations in `SpaceOwnerUriBase.sol` and corresponding test file. Updated `package.json` and `yarn.lock` to include Solady.
Added new methods to manage default URI in
SpaceOwner
andSpaceOwnerUriBase
. This includes setting and getting the default URI, updating the_render
method to use the default URI, and adding relevant events and validation checks.Simplify layout access in
SpaceOwner
with direct getter and setter methods. Add selectors forsetDefaultUri
andgetDefaultUri
in deployment script. Extend tests to cover newsetDefaultUri
functionality and improvetokenURI
tests.Streamline the logic for building URIs by prioritizing space URIs and falling back to the default URI. The test suite has been updated to reflect these changes, ensuring that URIs with and without trailing slashes are handled correctly.
Added Solady library to the project and updated
remappings.txt
andcopyLibs.js
accordingly. Replaced OpenZeppelin'sStrings
with Solady'sLibString
for string operations inSpaceOwnerUriBase.sol
and corresponding test file. Updatedpackage.json
andyarn.lock
to include Solady.https://linear.app/hnt-labs/issue/HNT-10522/space-metadata-uri
https://linear.app/hnt-labs/issue/HNT-10623/spec-town-metadata-changes-to-support-public-town-image