Auto generation of TZIP16 source metadata
Why
We want to be able to determine which deployed contracts are written in JsLIGO or CameLIGO. It can be disabled with a flag
When
When ligo compile a contract -> Metadata is automatically added to the type When ligo compile a storage -> Metadata is filled
How
Tzip-16 got the following object :
"source": An object { "tools": [], "location": } describing the source code which was transformed or generated the Michelson code of > the contract. "tools" is an informal list of compilers/code-generators/libraries/post-processors used to generate the originated code, if possible with version information. The goal is to attempt to provide enough information for interested parties to reproduce the Michelson from its source, or at least to inspect it.
Rules :
- If a flag is passed to the cli, the feature is disabled (flag have to be determined)
- If metadata field is already in storage and doesn't have the tzip16 type, the feature is disabled
- If metadata is already in storage, have the tzip16 type and source is already here, the feature is disabled
- If metadata is already in storage and have the tzip16 type, the feature will generate "source" field with
tools: [LIGO, JsLIGO]
ortools: [LIGO, CameLIGO]
- If metadata is not in storage, the feature will generate metadata field and "source" field with
tools: [LIGO, JsLIGO]
ortools: [LIGO, CameLIGO]
Resources
The tzip16 standard : https://tzip.tezosagora.org/proposal/tzip-16/ (ctrl+F "source":
to find )