Δ Sindi: Semantic Invariant Differencing for Solidity Smart Contracts
SInDi compares two Solidity boolean predicates (e.g., require guards) and decides whether they are equivalent, or one is stronger.
- Docs & source: GitHub → https://github.com/mojtaba-eshghie/SInDi
- Author: https://eshghie.com/
Install
pip install sindi
Quick usage
Library
from sindi import Comparator, ComparatorRulesOnly
cmp = Comparator()
print(cmp.compare("a > b", "a >= b"))
# "The first predicate is stronger."
light = ComparatorRulesOnly()
print(light.compare("a > b * 2", "a > b"))
# "The first predicate is stronger."
CLI
# Compare (full)
sindi compare "msg.sender == msg.origin && a >= b" "msg.sender == msg.origin"
# Light comparator (no SMT)
sindi compare "a > b * 2" "a > b" --light
# Rewrite / tokenize / parse / simplify
sindi rewrite "isOwner() && now >= 0"
sindi tokenize "..." --json
sindi parse "..." --tree
sindi simplify "..." --show-sympy --json
API (tiny)
-
Comparator().compare(p1: str, p2: str) -> strFull semantic differencing (SymPy + selective Z3 where needed). -
ComparatorRulesOnly().compare(p1: str, p2: str) -> strLightweight, solver-free structural/rewrites reasoning.
Notes: Functions & arrays are treated as uninterpreted symbols for reasoning. Division is modeled as a * b**-1. Variables are assumed non-negative in SMT checks.
Metadata
Release files for sindi 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sindi-0.2.1.tar.gz | 41.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sindi-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 74.9 kB
Release files / sindi-0.2.1.tar.gz
| Download URL | sindi-0.2.1.tar.gz |
|---|---|
| Size | 41.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3af8a63707d9b8087baea08868cce50dc6b5b166a04beff6f9dfaf01955a9158
|
|
BLAKE2b-256 checksum How to use checksums |
41feef853a0e422da80cc6ba9caa0f3f7fcfe2636d1670a02c31618c21dde5c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Release files / sindi-0.2.1-py3-none-any.whl
| Download URL | sindi-0.2.1-py3-none-any.whl |
|---|---|
| Size | 33.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9be604d965ec9e13f2b0417d94048949009280fb9c2353100be83f2ff9823514
|
|
BLAKE2b-256 checksum How to use checksums |
5f170eaa88ec47763122adef3318aa0ef4eeaa90bee932f31fdc424a6f12aae9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|