ERC721 "automatic" token URI
See original GitHub issue🧐 Motivation Current ERC721 minting with token URI requires manually specifying the URI per token.
To reduce gas cost, the OpenSea example uses concatenation of a base token URI and the tokenID. (TradeableERC721Token.sol
)
📝 Details
We want to provide an ERC721 extension ERC721DefaultURI
with a base URI parameter, which overrides ERC721Metadata
’s tokenURI()
with the concatenation. To discuss the API please comment on the forum thread about this.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:19 (14 by maintainers)
Top Results From Across the Web
ERC 721 - OpenZeppelin Docs
Internal function to set the base URI for all token IDs. It is automatically added as a prefix to the value returned in...
Read more >Showing a Token URI - Ethereum Blockchain Developer
To make this a complete example, the last thing that's missing is the TokenURI. ... contract MinimalERC721 is ERC721, Ownable, ...
Read more >Best way to set metadata in ERC721 contract on production
ERC721 contract provides a method called _setBaseURI(baseURI_) . Internal function to set the base URI for all token IDs. It is automatically ......
Read more >ERC721 Example | Shimmer Wiki
Create and deploy a Solidity smart contract to mint NFTs using the ERC721 ... Since this contract uses auto-incremental token ids, your token...
Read more >How to create and deploy an ERC-721 (NFT) - QuickNode
1. Digital collectibles compatible with the ERC-721 standard have become very popular since the launch o... 2. Fungible means to be the same...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
To put in here what we thought (omit non-changed code):
It continues following the
_INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;
.The idea is not only to use the
tokenId
as thepath
for the URI as used here but just to have full control of what to save._setBaseTokenURI
should be exposed to authorized users.I’m wondering if we should emit an event once the
baseTokenURI
is changed. Indexers can be reactive to this, updating all the metadata references.@nachomazzara from Decentraland commented that it is currently not possible for users to easily implement this feature (which they need) due to
tokenURI()
beingexternal
, which makes it impossible to call the base implementation viasuper
. The workaround they’ve found is to override_setTokenURI
and use a separate mapping, which is far from ideal and will probably be disallowed once Solidity 0.6.0 comes out.If @logeekal will not end up tackling this, someone else should do it: we already have a concrete design proposal, and many users would be benefited by this feature.