@@ -4,7 +4,7 @@ import "aux/aToken.spec";
4
4
// import "AddressProvider.spec" ;
5
5
6
6
methods {
7
- function getReserveDataExtended (address ) external returns (DataTypes .ReserveData memory ) envfree ;
7
+ // function getReserveDataExtended (address ) external returns (DataTypes .ReserveData memory ) envfree ;
8
8
function getReserveData (address ) external returns (DataTypes .ReserveDataLegacy memory ) envfree ;
9
9
10
10
function ValidationLogic .validateLiquidationCall (
@@ -21,22 +21,43 @@ methods {
21
21
DataTypes .CalculateUserAccountDataParams memory params
22
22
) internal returns (uint256 , uint256 , uint256 , uint256 , uint256 , bool ) = > NONDET ;
23
23
24
- function LiquidationLogic ._calculateDebt (
24
+ / * function LiquidationLogic ._calculateDebt (
25
25
DataTypes .ReserveCache memory debtReserveCache ,
26
26
DataTypes .ExecuteLiquidationCallParams memory params ,
27
27
uint256 healthFactor
28
- ) internal returns (uint256 , uint256 ) = > NONDET ;
28
+ ) internal returns (uint256 , uint256 ) = > NONDET ;* /
29
29
30
30
function LiquidationLogic ._calculateAvailableCollateralToLiquidate (
31
- DataTypes .ReserveData storage collateralReserve ,
32
- DataTypes .ReserveCache memory debtReserveCache ,
33
- address collateralAsset ,
34
- address debtAsset ,
35
- uint256 debtToCover ,
36
- uint256 userCollateralBalance ,
37
- uint256 liquidationBonus ,
38
- address // IPriceOracleGetter
39
- ) internal returns (uint256 ,uint256 ,uint256 ) = > NONDET ;
31
+ DataTypes .ReserveConfigurationMap memory collateralReserveConfiguration ,
32
+ uint256 collateralAssetPrice ,
33
+ uint256 collateralAssetUnit ,
34
+ uint256 debtAssetPrice ,
35
+ uint256 debtAssetUnit ,
36
+ uint256 debtToCover ,
37
+ uint256 userCollateralBalance ,
38
+ uint256 liquidationBonus
39
+ ) internal returns (uint256 , uint256 , uint256 , uint256 ) = > NONDET ;
40
+ }
41
+
42
+
43
+ // For flashloan
44
+ methods {
45
+ function _ .executeOperation (
46
+ address [] assets ,
47
+ uint256 [] amounts ,
48
+ uint256 [] premiums ,
49
+ address initiator ,
50
+ bytes params
51
+ ) external = > NONDET ; // expect bool ;
52
+
53
+ // simple receiver
54
+ function _ .executeOperation (
55
+ address asset ,
56
+ uint256 amount ,
57
+ uint256 premium ,
58
+ address initiator ,
59
+ bytes params
60
+ ) external = > NONDET ; // expect bool ;
40
61
}
41
62
42
63
@@ -55,9 +76,9 @@ function init_state() {
55
76
}
56
77
57
78
58
- hook Sstore _reserves [KEY address a ].__deprecatedStableBorrowRate uint128 rate (uint128 old_rate ) {
59
- assert false , "writing the field __deprecatedStableBorrowRate" ;
60
- }
79
+ // hook Sstore _reserves [KEY address a ].__deprecatedStableBorrowRate uint128 rate (uint128 old_rate ) {
80
+ // assert false , "writing the field __deprecatedStableBorrowRate" ;
81
+ // }
61
82
62
83
hook Sstore _reserves [KEY address a ].__deprecatedStableDebtTokenAddress address stable (address old_stable ) {
63
84
assert false , "writing the field __deprecatedStableDebtTokenAddress" ;
@@ -82,29 +103,19 @@ rule stableFieldsUntouched(method f, env e, address _asset)
82
103
aTokenToUnderlying [currentContract ._reserves [asset ].aTokenAddress ]== asset
83
104
& &
84
105
aTokenToUnderlying [currentContract ._reserves [asset ].variableDebtTokenAddress ]== asset ;
106
+
85
107
86
- DataTypes .ReserveData reserve = getReserveDataExtended (_asset );
87
108
DataTypes .ReserveDataLegacy reserveLegasy = getReserveData (_asset );
88
109
89
- uint128 __deprecatedStableBorrowRate_BEFORE = reserve .__deprecatedStableBorrowRate ;
90
- address __deprecatedStableDebtTokenAddress_BEFORE = reserve .__deprecatedStableDebtTokenAddress ;
91
110
uint128 currentStableBorrowRate_BEFORE = reserveLegasy .currentStableBorrowRate ;
92
- // address stableDebtTokenAddress_BEFORE = reserveLegasy .stableDebtTokenAddress ;
93
111
94
112
calldataarg args ;
95
113
f (e ,args );
96
114
97
- DataTypes .ReserveData reserve2 = getReserveDataExtended (_asset );
98
115
DataTypes .ReserveDataLegacy reserveLegasy2 = getReserveData (_asset );
99
116
100
- uint128 __deprecatedStableBorrowRate_AFTER = reserve2 .__deprecatedStableBorrowRate ;
101
- address __deprecatedStableDebtTokenAddress_AFTER = reserve2 .__deprecatedStableDebtTokenAddress ;
102
117
uint128 currentStableBorrowRate_AFTER = reserveLegasy2 .currentStableBorrowRate ;
103
118
address stableDebtTokenAddress_AFTER = reserveLegasy2 .stableDebtTokenAddress ;
104
119
105
- assert __deprecatedStableBorrowRate_BEFORE == __deprecatedStableBorrowRate_AFTER ;
106
- assert __deprecatedStableDebtTokenAddress_BEFORE == __deprecatedStableDebtTokenAddress_AFTER ;
107
120
assert currentStableBorrowRate_BEFORE == currentStableBorrowRate_AFTER ;
108
- // assert stableDebtTokenAddress_BEFORE == stableDebtTokenAddress_AFTER ;
109
-
110
121
}
0 commit comments