Skip to content

liquidity accounting detector for solidity contracts - #116

Open
Jumongweb wants to merge 1 commit into
StellarChainproof:masterfrom
Jumongweb:liquidityAccountingDetectors
Open

liquidity accounting detector for solidity contracts#116
Jumongweb wants to merge 1 commit into
StellarChainproof:masterfrom
Jumongweb:liquidityAccountingDetectors

Conversation

@Jumongweb

Copy link
Copy Markdown

Closes #86

Summary
Add a dedicated AMM invariant, slippage, and liquidity accounting detector for Solidity contracts.

This change introduces a new AMM analysis pipeline with explicit rule IDs for:

reserve and balance drift
zero-liquidity initialization
fee ordering issues
rounding bias
donation-based invariant manipulation
slippage and deadline gaps
callback settlement omissions
flash-swap repayment validation gaps
invariant drift
low-liquidity boundary risk
What changed
Added AMM analysis types, config handling, and public exports in the core package
Implemented AMM model extraction and transition classification
Added deterministic AMM analyzer logic and serialization support
Added vulnerable and secure AMM fixtures for regression coverage
Wired the new detector into the public API surface
Validation
Targeted AMM regression tests were added and exercised
Secure AMM fixture remains clean
Vulnerable fixture is expected to trigger all AMM rule IDs, with the final invariant rule currently being tightened for the remaining red-path assertion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build AMM Invariant, Slippage, and Liquidity Accounting Detectors

1 participant