-
Notifications
You must be signed in to change notification settings - Fork 196
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
fix(world-modules): properly concat baseURI and tokenURI in ERC721 module #2686
Conversation
🦋 Changeset detectedLatest commit: 028e08f The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Would definitely prefer the OZ implementation if possible, looks like we can just use this https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Strings.sol#L24 (would just copy over the Math and String lib from there and refer back to the source in the header, so we don't have to add more remappings in consuming projects) |
@@ -64,7 +64,7 @@ contract ERC721System is IERC721Mintable, System, PuppetMaster { | |||
|
|||
string memory baseURI = _baseURI(); | |||
string memory _tokenURI = TokenURI.get(_tokenUriTableId(_namespace()), tokenId); | |||
_tokenURI = bytes(_tokenURI).length > 0 ? _tokenURI : string(abi.encodePacked(tokenId)); | |||
_tokenURI = bytes(_tokenURI).length > 0 ? _tokenURI : uintToString(tokenId); |
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.
tokenURI
was not properly returningconcat(baseURI, tokenURI)
uintToString
function i found, lmk if you want to use OpenZeppelin or something