A CLI tool that verifies preconditions, postconditions, and invariants in contracts without altering their original source code. `contract-shield-cli` enforces Design by Contract principles externally, ensuring contracts behave as expected while preservin
npm install contract-shield-clicontract-shield-cli enforces Design by Contract principles externally, ensuring contracts behave as expected while preserving their integrity.
@pre) – Ensures input conditions are met before execution.
@post) – Confirms expected results after execution.
@invariant) – Maintains logical consistency across operations.
contract-shield-cli, use:
sh
npm install -g contract-shield-cli
`
Example
Given the following contract source code:
`js
/**
* Example function with validation tags
* @pre amount > 0
* @post balance == previousBalance - amount
* @post balance >= 0
*/
function withdraw(amount) {
}
``