Where we are with Contract Metadata. Note that there will be two separate types of metadata - one for the contract code, and one for the contract instance.
For Code Metadata (which will live in a WASM custom section) we'll need SDK support to compile information in. We could also save space by just compiling in the metadata hash, and the contract developer could distribute the metadata off chain, but this is a choice for the contract developer to make.
For Instance Metadata, we'll have to store additional information in the executables ContractData. The ContractExecutable xdr can be updated to include an optional metadata field. This does mean that metadata needs to be provided when the contract instance is created. The host can fill in metadata for the SAC executable. This metadata should contain read-only information relevant to the contract instance like token symbol and the number of decimals.
Some questions we still need to answer -
- What happens if a contract is nativized? What about the SAC's metadata?
- Should Instance metadata be mutable if we allow instances to be mutable for proxy support?
- What should the structure of both Code and Instance metadata look like? Arbitrary key value pairs? Do we even enforce a structure?