authenticvision / digitalsoul

MetaAnchor-Framework for self-hosting
MIT License
2 stars 0 forks source link

Leading-zero truncated anchors in TokenURI #68

Closed tbergmueller closed 9 months ago

tbergmueller commented 9 months ago

Smart Contracts with versions < 0.4.0 truncate anchors in the tokenURI. For example, if the anchor is 0x000000000000000000000000000000000000dead, the tokenUri would be https://digitalsoul.metaanchor.io/api/v1/collection/MYCOLLECTION/0xdead instead of https://digitalsoul.metaanchor.io/api/v1/collection/MYCOLLECTION/0x000000000000000000000000000000000000dead`.

More practically, TokenId 60 of MetaAnchor-Community is effected; The anchor is actually 0x001034393813f7be865e48d56985c5a1beebdf8d566746cfed3433cca68c4790 But the returned tokenUri is https://digitalsoul.metaanchor.io/api/v1/collections/MACO/0x1034393813f7be865e48d56985c5a1beebdf8d566746cfed3433cca68c4790

The collection endpoint shall support such truncated Anchors and add leading zeros, until it is in 0x[64char] format.

This affects all smart contracts, which where deployed before TODO: Link to Smart-Contract fix commit in Ethereum repo