Skip to content
Crypto.world

The Ledger

Morpho details Certora verification of Midnight lending protocol

Morpho says its formal verification work with Certora covers five areas of the Midnight fixed-rate credit protocol. The published verification materials describe the properties checked and the assumptions used in the model.

Morpho details Certora verification of Midnight lending protocol

Morpho has detailed formal verification work with Certora covering five areas of its Midnight fixed-rate credit protocol, from accounting and liquidations to permissions and fee handling. In a Nov. 24 post, Morpho said the work was conducted throughout development, with Certora engineers working alongside its protocol team.

Midnight is a fixed-rate, fixed-term credit protocol that launched in July 2026. Morpho said Midnight had more than $200 million in deposits as of its post.

What the checks cover

Formal verification uses mathematical methods to check specified properties against possible inputs and transaction sequences covered by a model. Morpho said that differs from checking only the cases covered by audits and unit tests, which can miss edge cases.

The accounting checks cover whether credit, debt and collateral remain consistent, whether the relevant parties can change them as expected, and whether tokens move to and from the appropriate parties. Other checks address liquidation eligibility, incentives and bad-debt accounting.

Offers and fees are checked against their limits, while split settlements are checked for accounting consistency and specified rounding allowances. The work also covers authorization for sensitive changes, the scope of privileged roles, arithmetic and price conversions, and whether external calls can observe an inconsistent intermediate state.

Model assumptions

The published verification materials describe individual properties and the conventions used to model the protocol. They include a solvency check that the contract's balance for each token covers recorded collateral, withdrawable liquidity and claimable settlement fees.

The materials also describe checks on who can change user positions, how offers are consumed and what happens to debt and withdrawable liquidity after maturity. One set of checks addresses whether external calls can observe an intermediate state during an entry point.

The repository also lists assumptions used in the verification. Loops are modeled as bounded, tokens are assumed to behave as specified in the verification files, and external calls are assumed not to re-enter Midnight unless a property specifically concerns callbacks.

The model removes multicall so that each rule reasons about a single entry point. The repository says that approach is sound because multicall can only call functions of the current contract.

Development and review

Morpho said its engineers retained ownership of the specifications while working with Certora from the start of Midnight's design. It used verification during development to refine specifications, understand the effects of design changes and help find bugs.

The protocol's core smart contracts are immutable, meaning their core code cannot be changed after deployment. Morpho said the same continuous-verification practice had been used for Morpho Blue, which it said had more than $17 billion in deposits as of the post.

The company previously said Midnight had undergone four external audits, conducted by Spearbit, Stermi, Trust Security and Blackthorn, after internal testing. A subsequent public audit competition on Cantina offered up to $400,000 in prizes for original findings.

Sources

  1. Original source · Blog post Morpho “Formally Verifying Morpho Midnight with Certora” morpho.org

Other pages read

  1. Morpho · page 2 github.com
  2. Morpho “Securing Morpho Midnight” morpho.org

Related stories

Explore

More articles