Skip to main content
A lending market records more borrowed tokens than supplied tokens. This template rejects that aggregate state.

Behavior

TokensBorrowedInvariant reads total supply from slot 0 and total borrowed from slot 1 at transaction end. It requires supply to be greater than or equal to borrowing.

Configuration

Replace the slots and normalize both quantities to the same asset and scale. Receipt-token supply, indexed debt shares, and underlying assets are not interchangeable. Apply accrued indices consistently if the deployed protocol stores scaled balances.

Scenarios

Coverage limits

The bound does not check collateral value, account health, interest accrual correctness, or available liquidity. It cannot establish solvency by itself. Use operation-level lending checks for borrower health.

Source

The reviewed source is a teaching template. The example setup guide provides the pinned checkout and test procedure.