I am quite new to smart contract development so apologies in advance if this seems like a silly question.
I'm looking for some guidance on a usable pattern for the following use case.
I need to dynamically generate an ERC-1155 token's metadata upon minting (1 of several random images, stats etc). The metadata needs to also be able to change based off on-chain interactions. I'm struggling to think of a way to do it on the blockchain given my lack of experience.
As I understand it, I may need to leverage the use of oracles and IPFS? Possibly a custom server (which I would prefer to avoid if at all possible to keep things as non-custodial as possible)?
Is there a standard pattern for this sort of use case?
My initial thinking is:
- Factory contract uses oraclize to generate random number stats.
- TokenURI points to a custom server that receives stats via URI params.
- Token is minted with this URI.
- Custom server generates JSON metadata and returns it when that URI is called.
This will keep the necessary on-chain data and off-chain metadata in sync. If on-chain stats change then so too will the JSON returned from the URI.
Would this be considered an acceptable pattern?