flashbots / suave-std

Collection of helpful smart contracts to build Suapps
The Unlicense
44 stars 13 forks source link

Add tool to validate the correctness of the Solidity code snippets #68

Closed ferranbt closed 7 months ago

ferranbt commented 7 months ago

This PR adds a new tool that can validate if a Solidity code snippet (that uses suave-std) is valid or not. It is intended to be used to verify that the examples in the README.md file are up to date with the implementation.

The tool reads the input file (in this case only the README.md) in Markdown, gets all the Solidity code blocks which do not have the [skip-check] tag (none so far though). It puts the contracts in an ad-hoc repo under tools/stdchecker and compiles it with forge. It uses remappings to map the suave-std libraries to the top of the repository.

It also includes a CI check to validate that REAMDE.md is correct.