Ah I love this!!! I’d like to add some functionality that I think will make all of this “just work”.
May I recommend a new ERC-7730 function called getWalletDocsUri. Here is an example solidity implementation
string constant DOCS_URI = "...."; // string here
uint256 public latestDocsVersion = 0;
function getWalletDocsUri(uint256 docsVersion) external view returns(string memory) {
// Could easily add conditionals/mappings/etc here....
return DOCS_URI;
}
This would return a URI (similar to that of an NFT) which has the JSON object with all the data. There are a few nice things about this:
- The JSON could be base64 encoded, so the entire documentation could be placed on-chain.
- It could be easily updatable, and map new versions of the docs based on the
latestDocsVersion.
If you don’t wish to have your docs on-chain, then you could still host them on a site. Many tokens like ERC20s, could just point to another contract that already has the ERC20 ABI implemented, and would not have to spend any additional gas other than adding this additional function.