Skip to main content
A borrow or collateral withdrawal can leave an account below the minimum health factor. This template checks a stored health factor after selected lending calls.

Behavior

LendingHealthFactorAssertion registers supply, borrow, withdraw, and repay selectors with (uint256 marketId, uint256 amount) arguments. It reads a nested market/account mapping rooted at slot 0 and requires post-call health of at least 1e18.

Configuration

Replace the ABI, mapping layout, account selection, and scale. The current helper selects the first matching successful caller with a one-call limit; it does not resolve the caller by the triggering call ID. For batched or routed operations, use PostOperationSolvencyAssertion, which matches ctx.callStart.

Scenarios

Coverage limits

A blanket health floor on repayment and supply can block recovery. Select risk-increasing operations deliberately. The toy mapping is not an Aave, Euler, or other production storage layout; adapt the check to the deployed implementation.

Source

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