Fix unsound require assumptions in Liveness spec (#781)#784
Open
claude[bot] wants to merge 13 commits into
Open
Fix unsound require assumptions in Liveness spec (#781)#784claude[bot] wants to merge 13 commits into
claude[bot] wants to merge 13 commits into
Conversation
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
MathisGD
reviewed
Jul 23, 2026
MathisGD
reviewed
Jul 23, 2026
MathisGD
reviewed
Jul 23, 2026
MathisGD
reviewed
Jul 23, 2026
MathisGD
reviewed
Jul 23, 2026
… require, drop redundant per-rule bounds
MathisGD
reviewed
Jul 23, 2026
Signed-off-by: MathisGD <74971347+MathisGD@users.noreply.github.com>
MathisGD
reviewed
Jul 23, 2026
Signed-off-by: MathisGD <74971347+MathisGD@users.noreply.github.com>
MathisGD
reviewed
Jul 23, 2026
MathisGD
reviewed
Jul 23, 2026
MathisGD
reviewed
Jul 23, 2026
MathisGD
reviewed
Jul 23, 2026
MathisGD
reviewed
Jul 23, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Kx6WMx5o6emArfUMRXERr
…liveness-assert-soundness
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
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Mathis GD · Slack thread
Fixes #781.
Before: the transfer summary in
certora/specs/Liveness.specusedrequire_uint256to update the ghostbalance, silently assuming no under/overflow — unsound in the liveness rules, which assert!lastRevertedand so must not assume away the very no-revert precondition.After: the summary uses
assert_uint256, making no-under/overflow a proof obligation. Thebalanceghost (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).