Skip to content

Commit

Permalink
Merge pull request #653 from morpho-org/refactor/improve-rounding-liq…
Browse files Browse the repository at this point in the history
…uidate

Rounding liquidate fix
  • Loading branch information
MerlinEgalite authored Dec 20, 2023
2 parents e1dc2e2 + 90fb045 commit 5afa588
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions certora/confs/AccrueInterest.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
],
"verify": "MorphoHarness:certora/specs/AccrueInterest.spec",
"prover_args": [
"-depth 3",
"-smt_hashingScheme plaininjectivity",
"-mediumTimeout 30"
],
"rule_sanity": "basic",
"server": "production",
"msg": "Morpho Blue Accrue Interest"
}
1 change: 1 addition & 0 deletions certora/confs/AssetsAccounting.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
],
"verify": "MorphoHarness:certora/specs/AssetsAccounting.spec",
"rule_sanity": "basic",
"server": "production",
"msg": "Morpho Blue Assets Accounting"
}
1 change: 1 addition & 0 deletions certora/confs/ConsistentState.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
],
"verify": "MorphoHarness:certora/specs/ConsistentState.spec",
"rule_sanity": "basic",
"server": "production",
"msg": "Morpho Blue Consistent State"
}
1 change: 1 addition & 0 deletions certora/confs/ExactMath.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"-smt_hashingScheme plaininjectivity",
"-mediumTimeout 30"
],
"server": "production",
"msg": "Morpho Blue Exact Math"
}
1 change: 1 addition & 0 deletions certora/confs/Health.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"prover_args": [
"-smt_hashingScheme plaininjectivity"
],
"server": "production",
"msg": "Morpho Blue Health"
}
1 change: 1 addition & 0 deletions certora/confs/LibSummary.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
],
"verify": "MorphoHarness:certora/specs/LibSummary.spec",
"rule_sanity": "basic",
"server": "production",
"msg": "Morpho Blue Lib Summary"
}
1 change: 1 addition & 0 deletions certora/confs/Liveness.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
],
"verify": "MorphoInternalAccess:certora/specs/Liveness.spec",
"rule_sanity": "basic",
"server": "production",
"msg": "Morpho Blue Liveness"
}
1 change: 1 addition & 0 deletions certora/confs/RatioMath.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"-mediumTimeout 30",
"-timeout 3600"
],
"server": "production",
"msg": "Morpho Blue Ratio Math"
}
1 change: 1 addition & 0 deletions certora/confs/Reentrancy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"prover_args": [
"-enableStorageSplitting false"
],
"server": "production",
"msg": "Morpho Blue Reentrancy"
}
1 change: 1 addition & 0 deletions certora/confs/Reverts.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
],
"verify": "MorphoHarness:certora/specs/Reverts.spec",
"rule_sanity": "basic",
"server": "production",
"msg": "Morpho Blue Reverts"
}
1 change: 1 addition & 0 deletions certora/confs/Transfer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
],
"verify": "TransferHarness:certora/specs/Transfer.spec",
"rule_sanity": "basic",
"server": "production",
"msg": "Morpho Blue Transfer"
}
2 changes: 1 addition & 1 deletion src/Morpho.sol
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ contract Morpho is IMorphoStaticTyping {
if (seizedAssets > 0) {
uint256 seizedAssetsQuoted = seizedAssets.mulDivUp(collateralPrice, ORACLE_PRICE_SCALE);

repaidShares = seizedAssetsQuoted.wDivUp(liquidationIncentiveFactor).toSharesDown(
repaidShares = seizedAssetsQuoted.wDivUp(liquidationIncentiveFactor).toSharesUp(
market[id].totalBorrowAssets, market[id].totalBorrowShares
);
} else {
Expand Down

0 comments on commit 5afa588

Please sign in to comment.