Potential API for this: an ERC721 extension ERC721DefaultURI with a base URI parameter, which overrides ERC721Metadata's tokenURI() with the concatenation. What I don’t like about this is that ERC721Metadata also has name and symbol and this gets into the unintuitive nastiness of multiple inheritance. We can avoid that by making the default URI extension only provide the URI, and not name and symbol, but then if people do combine it with the metadata extension the behavior would depend on the order of inheritance and that is nasty. I think this can be fixed by adding a common ancestor in the hierarchy, which sounds reasonable to me.
Ohhh, nice. This would also mean finally developing some sort of string management library. @abcoathup what do you think about opening an initial PR with this String.concat library, so we can get started?
@frangio Hmm I see what you mean, a common ancestor with the URI field may be the way to go, but it introduces a lot of artificial complexity. We should experiment a bit with this.
As a side note, our revert reasons share a prefix: I wonder if there are gas gains to be had by generating the revert reason string on the fly, as opposed to having repeated copies of the prefix stored in the blockchain. My intuition is that the Strings code would offset any gains, but I’ve been wrong before.
Ohh that is very cool! I personally would consider removing concatenate altogether then. abi.encodePacked is superior in that it can receive a variable number of arguments.
I think you can start working on a PR for this using abi.encodePacked