ricardian-template-toolkit icon indicating copy to clipboard operation
ricardian-template-toolkit copied to clipboard

Static analysis tool for Ricardian contracts and clauses

Open arhag opened this issue 5 years ago • 0 comments

I think it would be very helpful to have a static analysis tool that given only an ABI does its best to validate all Ricardian contracts and clauses contained within.

At a minimum it would do the following for each Ricardian contract:

  • Enforce the title length limit of 50 characters.
  • Ensure the metadata section is properly formatted and includes all necessary fields.
  • Verify that the summary string can be properly parsed and no unsupported Handlebar helpers are used.
  • Verify that the body can be properly parsed and no unsupported Handlebar helpers are used.

It should also verify that each Ricardian clause can be properly parsed and no unsupported Handlebar helpers are used.

This would really help with automatically checking for common errors like missing curly braces or using unsupported helpers (say due to a typo).

The tool could go even further and ensure all referenced variables are valid, which it can determine via the struct definitions contained in the ABI.

The goal would be to integrate such a tool into the CICD process of EOSIO smart contract repositories to catch certain classes of errors in Ricardians early and automatically.

arhag avatar Jun 03 '19 16:06 arhag