Skip to content

Fix unsound require assumptions in Liveness spec (#781)#784

Open
claude[bot] wants to merge 13 commits into
mainfrom
fix/781-liveness-assert-soundness
Open

Fix unsound require assumptions in Liveness spec (#781)#784
claude[bot] wants to merge 13 commits into
mainfrom
fix/781-liveness-assert-soundness

Conversation

@claude

@claude claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Requested by Mathis GD · Slack thread

Fixes #781.

Before: the transfer summary in certora/specs/Liveness.spec used require_uint256 to update the ghost balance, silently assuming no under/overflow — unsound in the liveness rules, which assert !lastReverted and so must not assume away the very no-revert precondition.

After: the summary uses assert_uint256, making no-under/overflow a proof obligation. The balance ghost (a mathint) is bounded two-sided (0 <= balance[token] < 2^128) in the summary as a structural fact, and each rule that sends tokens out carries an explicit lower bound (balance >= totalSupplyAssets(id) / >= assets / >= collateral) as the "singleton holds enough tokens" liveness assumption. Rules that lacked it also assume Morpho is not the caller (currentContract != e.msg.sender).

claude added 5 commits July 23, 2026 10:26
In summarySafeTransferFrom, the ghost balance under/overflow was silenced
with require_uint256, which is unsound in liveness rules (@withrevert +
assert !lastReverted): it assumes away the very no-revert precondition the
rules aim to prove.

Switch both branches to assert_uint256, turning the hidden assumption into
a proof obligation, and add the explicit, justified assumptions each rule
now needs (singleton solvency for out-transfers, bounded supply for
in-transfers).

Fixes #781

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Kx6WMx5o6emArfUMRXERr
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Kx6WMx5o6emArfUMRXERr
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Kx6WMx5o6emArfUMRXERr
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Kx6WMx5o6emArfUMRXERr
@claude
claude Bot marked this pull request as ready for review July 23, 2026 16:40
Comment thread certora/specs/Liveness.spec Outdated
Comment thread certora/specs/Liveness.spec Outdated
Comment thread certora/specs/Liveness.spec Outdated
Comment thread certora/specs/Liveness.spec Outdated
Comment thread certora/specs/Liveness.spec Outdated
Comment thread certora/specs/Liveness.spec Outdated
Signed-off-by: MathisGD <74971347+MathisGD@users.noreply.github.com>
Comment thread certora/specs/Liveness.spec Outdated
Signed-off-by: MathisGD <74971347+MathisGD@users.noreply.github.com>
Comment thread certora/specs/Liveness.spec Outdated
Comment thread certora/specs/Liveness.spec Outdated
Comment thread certora/specs/Liveness.spec Outdated
Comment thread certora/specs/Liveness.spec Outdated
Comment thread certora/specs/Liveness.spec Outdated
claude added 4 commits July 23, 2026 17:48
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Kx6WMx5o6emArfUMRXERr
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Kx6WMx5o6emArfUMRXERr
…r-amount bound holds

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Kx6WMx5o6emArfUMRXERr
MathisGD
MathisGD previously approved these changes Jul 23, 2026

@MathisGD MathisGD left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@MathisGD
MathisGD requested a review from QGarchery July 23, 2026 18:50
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.

[Certora] unsound assumptions in Liveness

2 participants