@@ -16,7 +16,7 @@ methods {
16
16
function libId (MorphoHarness .MarketParams ) external returns MorphoHarness .Id envfree ;
17
17
}
18
18
19
- // Check that it 's not possible to withdraw more assets than what the user has supplied .
19
+ // Check that it 's not possible to withdraw more assets than what the user owns .
20
20
rule withdrawLiquidity (MorphoHarness .MarketParams marketParams , uint256 assets , uint256 shares , address onBehalf , address receiver ) {
21
21
env e ;
22
22
MorphoHarness .Id id = libId (marketParams );
@@ -27,27 +27,27 @@ rule withdrawLiquidity(MorphoHarness.MarketParams marketParams, uint256 assets,
27
27
uint256 initialShares = supplyShares (id , onBehalf );
28
28
uint256 initialTotalSupply = virtualTotalSupplyAssets (id );
29
29
uint256 initialTotalSupplyShares = virtualTotalSupplyShares (id );
30
- uint256 owedAssets = libMulDivDown (initialShares , initialTotalSupply , initialTotalSupplyShares );
30
+ uint256 ownedAssets = libMulDivDown (initialShares , initialTotalSupply , initialTotalSupplyShares );
31
31
32
32
uint256 withdrawnAssets ;
33
33
withdrawnAssets , _ = withdraw (e , marketParams , assets , shares , onBehalf , receiver );
34
34
35
- assert withdrawnAssets <= owedAssets ;
35
+ assert withdrawnAssets <= ownedAssets ;
36
36
}
37
37
38
- // Check that it 's not possible to withdraw more collateral than what the user has supplied .
39
- rule withdrawCollateralLiquidity (MorphoHarness .MarketParams marketParams , uint256 assets , address onBehalf , address receiver ) {
38
+ // Check that it 's not possible to withdraw more collateral than what the user owns .
39
+ rule withdrawCollateralLiquidity (MorphoHarness .MarketParams marketParams , uint256 withdrawnAssets , address onBehalf , address receiver ) {
40
40
env e ;
41
41
MorphoHarness .Id id = libId (marketParams );
42
42
43
- uint256 initialCollateral = collateral (id , onBehalf );
43
+ uint256 ownedAssets = collateral (id , onBehalf );
44
44
45
- withdrawCollateral (e , marketParams , assets , onBehalf , receiver );
45
+ withdrawCollateral (e , marketParams , withdrawnAssets , onBehalf , receiver );
46
46
47
- assert assets <= initialCollateral ;
47
+ assert withdrawnAssets <= ownedAssets ;
48
48
}
49
49
50
- // Check than when repaying the full outstanding debt requires more assets than what was borrowed .
50
+ // Check than when repaying the full outstanding debt requires more assets than what the user owes .
51
51
rule repayLiquidity (MorphoHarness .MarketParams marketParams , uint256 assets , uint256 shares , address onBehalf , bytes data ) {
52
52
env e ;
53
53
MorphoHarness .Id id = libId (marketParams );
@@ -58,13 +58,13 @@ rule repayLiquidity(MorphoHarness.MarketParams marketParams, uint256 assets, uin
58
58
uint256 initialShares = borrowShares (id , onBehalf );
59
59
uint256 initialTotalBorrow = virtualTotalBorrowAssets (id );
60
60
uint256 initialTotalBorrowShares = virtualTotalBorrowShares (id );
61
- uint256 assetsDue = libMulDivUp (initialShares , initialTotalBorrow , initialTotalBorrowShares );
61
+ uint256 owedAssets = libMulDivUp (initialShares , initialTotalBorrow , initialTotalBorrowShares );
62
62
63
63
uint256 repaidAssets ;
64
64
repaidAssets , _ = repay (e , marketParams , assets , shares , onBehalf , data );
65
65
66
66
// Assume a full repay .
67
67
require borrowShares (id , onBehalf ) == 0 ;
68
68
69
- assert repaidAssets >= assetsDue ;
69
+ assert repaidAssets >= owedAssets ;
70
70
}
0 commit comments