damlisk reads the Daml-LF inside a .dar through
dazl, walks every template, choice and value,
and runs detectors over it. It needs no Daml source and no running ledger: what damlc
compiled is what gets checked.
How it works
1. Install damlisk (Python 3.11 or newer):
pip install damlisk
2. Build your Daml project with dpm build. This choice uses a fetched value after its
contract was replaced:
nonconsuming choice PayOut : ContractId Receipt
with
cid : ContractId Account
controller owner
do
acc <- fetch cid
_ <- exercise cid Withdraw with amt = 10.0
create Receipt with bank; owner; remaining = acc.amount
3. Scan the DAR:
$ damlisk scan examples/vulnerable/stale-fetch/stale-fetch.dar --detect stale-fetch
[Medium] stale-fetch Main.daml:29
Main:Desk.PayOut: `acc` is used after `Withdraw`
[Medium] stale-fetch Main.daml:38
Main:Desk.PayTwice: `acc` is used after `Withdraw`
2 finding(s).
Documentation
Each page explains its detectors: what they report, why it matters, an example with the scan output, and how the check works and what it misses.
| # | Page | Detectors |
|---|---|---|
| 1 | Authorization | controller-from-argument, hardcoded-party, unprotected-archive, over-disclosure, delegated-authority-leak |
| 2 | Assets | stuck-asset, value-to-arbitrary-party |
| 3 | Contracts | unsafe-primitive, untrusted-interface-exercise, stale-fetch |
| 4 | Validation | missing-amount-check, partial-function, nonconsuming-create, unchecked-fetch, time-from-argument, amount-tolerance, divide-before-multiply, unconsumed-input, hash-concat-collision, time-equality, missing-ensure, ignored-optional |
| 5 | Time | time-dependence, weak-randomness |
| 6 | Loops | ledger-op-in-loop, unbounded-input-loop |
| 7 | Hygiene | boolean-cst, boolean-equal, unused-template-field, discarded-update, aborting-choice, tautological-compare, debug-trace, rtlo |
| 8 | Upgrade | sdk-version |
All detectors with impact and confidence
| Detector | Impact | Confidence | What it finds |
|---|---|---|---|
boolean-cst |
Medium | Medium | Boolean constants used as conditions |
boolean-equal |
Informational | High | Comparison to True / False |
controller-from-argument |
High | Medium | Consuming choice controlled only by an unchecked argument party |
missing-amount-check |
Low | Medium | Decimal template field not constrained by ensure |
unused-template-field |
Informational | Medium | Template field that no ledger code reads |
hardcoded-party |
Medium | High | Party identity built from or compared with a text literal |
partial-function |
Low | Medium | Choice argument passed to head, fromSome, !!, ... |
discarded-update |
Medium | High | Ledger actions wrapped in pure and never run |
nonconsuming-create |
High | Medium | Nonconsuming choice creates its own template without archiving self |
unchecked-fetch |
High | Medium | Contract fetched from a choice argument and used without validation |
time-from-argument |
Medium | Medium | Deadline logic on a caller-supplied Time instead of ledger time |
amount-tolerance |
Medium | High | Decimal amounts compared with abs (a - b) < eps instead of exactly |
divide-before-multiply |
Medium | Medium | Result of a division multiplied, compounding its rounding error |
unconsumed-input |
High | Medium | Input contract of the same template read but not archived |
aborting-choice |
Informational | High | Choice whose body always aborts |
hash-concat-collision |
Medium | Medium | sha256 of texts joined without a separator |
time-equality |
Medium | High | Ledger time compared with == or /= |
tautological-compare |
Medium | High | Value compared with itself (payer == payer) |
unprotected-archive |
High | Medium | Consuming choice controlled by a non-signatory |
missing-ensure |
Medium | High | Template with amount or time fields and no or trivial ensure |
over-disclosure |
Medium | Medium | Choice observers taken from the choice argument |
unsafe-primitive |
High | High | Unchecked cast of a contract id, interface or Any value |
debug-trace |
Informational | High | Debug trace left in production code |
stuck-asset |
Medium | Medium | Asset its owner cannot move: no owner-controlled consuming choice |
sdk-version |
Informational | High | DAR built for a Daml-LF 1.x target |
rtlo |
High | High | Bidirectional control character (right-to-left override) in source or Text |
delegated-authority-leak |
High | Medium | Non-signatory controller passes parties or amounts into a create or exercise |
untrusted-interface-exercise |
High | Medium | Interface contract id from the choice argument is exercised or fetched |
value-to-arbitrary-party |
High | Medium | Asset created for an owner from the choice argument by a non-owner controller |
time-dependence |
Low | Medium | Ledger time decides a branch |
weak-randomness |
High | Medium | Ledger time or a hash picks a list element or map entry |
ledger-op-in-loop |
Low | Medium | Create, exercise or fetch inside a loop |
unbounded-input-loop |
Medium | Medium | Loop over a list from the choice argument with no length check |
stale-fetch |
Medium | Medium | Fetched value used after the contract was replaced by a successor |
ignored-optional |
Medium | Medium | Optional result discarded or forced with fromSome |
Commands
damlisk --help # top-level usage and command list
damlisk --version # installed version
damlisk list-detectors # every detector with impact and confidence
damlisk info path/to/project.dar # packages, Daml-LF versions and declarations
damlisk scan path/to/project.dar # run all detectors on the main package
damlisk report examples/dars --name digitalasset # Markdown report for many DARs
report takes DAR files and folders (searched recursively) and writes a summary page with
one row per DAR, linking to a page with that DAR's findings:
reports/digitalasset/report-2026-11-10.md
reports/digitalasset/report-2026-11-10/splice-amulet-0.1.24.md
It also takes --out (default reports), --date (default today), --detect and --exclude.
scan options:
| Option | Meaning |
|---|---|
--detect a,b |
Run only these detectors |
--exclude a,b |
Skip these detectors |
--json / --pretty-json |
Print findings as JSON |
--fail-on <impact> |
Exit with code 1 on a finding of this impact or higher (high, medium, low, informational, none) |
--traceback |
Show a Python traceback on error |
Examples
examples/vulnerable/ has one small Daml project per detector. Each
holds the cases that are reported and the look-alikes that are not. examples/dars/ holds the
Splice DARs used as a real-world baseline in the tests. No DAR is committed: make dars
builds every example with dpm build and downloads every published Splice version from the
official Splice repository.
Local development
python -m venv .venv
source .venv/bin/activate
make dev-init # editable install with the dev dependency group
make dars # build the example DARs and download the Splice DARs (needs dpm)
Run the tests and linters, and build the wheel:
make test # pytest
make lint # mypy, black, flake8, isort
make build # dist/damlisk-<version>-py3-none-any.whl
CI (.github/workflows/ci.yml) is started by hand from the Actions
tab (Run workflow). It runs the same steps inside the Nix dev shell from
flake.nix: it installs dpm and the Daml SDK, runs make dars, then lint and
tests. Run it locally with:
nix develop --command make ci
Publishing to PyPI
Pushing a v*.*.* tag runs .github/workflows/workflow.yml.
It first runs the CI workflow (DAR builds, lint, tests); only if that passes does it build
the sdist and wheel with the tag as the version (v0.2.0 gives damlisk --version
= 0.2.0), checks that, and uploads to PyPI through trusted publishing, so no API token is
stored in the repository:
git tag v0.2.0
git push origin v0.2.0
License
damlisk is licensed under the Apache License, Version 2.0.
Copyright 2026 DIGIAPP LLC.
Metadata
Release files for damlisk 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| damlisk-0.0.2.tar.gz | 177.9 kB | With provenance | Details for damlisk-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| damlisk-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for damlisk-0.0.2-py3-none-any.whl |
Total release size: 286.9 kB
Release files / damlisk-0.0.2.tar.gz
| Download URL | damlisk-0.0.2.tar.gz |
|---|---|
| Size | 177.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35a5819d9205c5375eef219f71a9ab2e6c0a225bd3b65dfe649fa71c72c2b79f
|
|
BLAKE2b-256 checksum How to use checksums |
226d36110854b7db328e3a4ccdaf6f92ca5570eed0a34d557e556391ffc24097
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logRelease files / damlisk-0.0.2-py3-none-any.whl
| Download URL | damlisk-0.0.2-py3-none-any.whl |
|---|---|
| Size | 109.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cef5672bc92b0e8d3742f6317be526b4e638dfcad3ec4a54b7b90459f0a39ba1
|
|
BLAKE2b-256 checksum How to use checksums |
13253f6fab23da403b225925d3fb9b5bb79f6860d29d7df1a98c18b95eaa2339
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logSecurity for damlisk 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for damlisk-0.0.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.