[Certora] Created obligations#374
Merged
Merged
Conversation
bhargavbh
approved these changes
Feb 23, 2026
bhargavbh
left a comment
Contributor
There was a problem hiding this comment.
LGTM.
potentially we also are interested that obligation can be created only by touchObligation, take, withdraw, repay, supplyCollateral, withdrawCollateral, liquidate: Prover Link
rule onlyTouchObligationCreates(env e, method f, calldataarg args, bytes20 id)
filtered { f -> f.selector != sig:touchObligation(MorphoV2.Obligation).selector
|| f.selector != sig:take(uint256,uint256,uint256,uint256,address,address,bytes,address,MorphoV2.Offer,MorphoV2.Signature,bytes32,bytes32[]).selector
|| f.selector != sig:withdraw(MorphoV2.Obligation,uint256,uint256,address,address).selector
|| f.selector != sig:repay(MorphoV2.Obligation,uint256,address).selector
|| f.selector != sig:supplyCollateral(MorphoV2.Obligation,uint256,uint256,address).selector
|| f.selector != sig:withdrawCollateral(MorphoV2.Obligation,uint256,uint256,address,address).selector
|| f.selector != sig:liquidate(MorphoV2.Obligation,uint256,uint256,uint256,address,bytes).selector
} {
require !MorphoV2.obligationCreated(id);
f(e, args);
assert !MorphoV2.obligationCreated(id);
}
The roundtrip property (toObligation(toId(obligation)) == obligation ) also is interesting but involves a lot more summarise. can be proved later.
QGarchery
commented
Feb 23, 2026
MathisGD
reviewed
Feb 24, 2026
MathisGD
reviewed
Feb 24, 2026
MathisGD
reviewed
Feb 24, 2026
MathisGD
approved these changes
Feb 24, 2026
MathisGD
left a comment
Collaborator
There was a problem hiding this comment.
LGTM except one question on one rule
Co-authored-by: MathisGD <74971347+MathisGD@users.noreply.github.com> Signed-off-by: Quentin Garchery <garchery.quentin@gmail.com>
QGarchery
commented
Feb 24, 2026
| require(index <= 5, "Invalid index"); | ||
| require(newTradingFee <= MAX_FEE, "Trading fee too high"); | ||
| require(newTradingFee % FEE_STEP == 0, "fee should be a multiple of FEE_STEP"); | ||
| require(obligationState[id].created, "Obligation not created"); |
Collaborator
Author
There was a problem hiding this comment.
This was the only function that was changing the state before the obligation is created. Without this require, the fee would switch back to the default fees when the obligation will indeed be created
MathisGD
reviewed
Feb 24, 2026
MathisGD
approved these changes
Feb 26, 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.
See description of the rules.
This verification will not go through after #367, but it can be adapted (modulo some summary)