Validate a contract

Clarinet provides syntax and semantics checkers for the smart contract language Clarity.

To verify your contracts, run the clarinet check command inside your project.

Terminal
clarinet check

Configuration

Clarinet uses the Clarinet.toml file to locate and analyze all the contracts in the project. If the Clarity code is valid, the command will indicate success with the response below.

Terminal
✔ 2 contracts checked
Note

The clarinet check command may also report warnings indicating the code is valid.

If you want to check the syntax of just a single file in your project, you can use the command below.

Terminal
clarinet check <path/to/file.clar>

With this command, Clarinet will report syntactical errors, but it does not perform type-checking or other semantic checks as that would require the full context for a comprehensive analysis.

On this page