New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

contract-shield-cli

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contract-shield-cli

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

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

contract-shield-cli

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 preserving their integrity.

Features

  • Precondition Validation (@pre) – Ensures input conditions are met before execution.
  • Postcondition Verification (@post) – Confirms expected results after execution.
  • Invariant Checking (@invariant) – Maintains logical consistency across operations.
  • Source Code Integrity – Works externally without modifying the original code.

Installation

To install contract-shield-cli, use:

npm install -g contract-shield-cli

Example

Given the following contract source code:

/**
 * Example function with validation tags
 * @pre amount > 0
 * @post balance == previousBalance - amount
 * @post balance >= 0
 */
function withdraw(amount) {
}

The tool will generate a modified version of the contract that enforces these conditions

Contributing

  • Fork the repository.
  • Create a feature branch (git checkout -b feature-branch).
  • Commit changes (git commit -m "Add feature").
  • Push to GitHub (git push origin feature-branch).
  • Open a Pull Request.

License

This project is licensed under the MIT License. See LICENSE for details.

Keywords

static-analysis

FAQs

Package last updated on 12 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts