@@ -4,7 +4,7 @@ import "aux/aToken.spec";
44// import "AddressProvider.spec" ;
55
66methods {
7- function getReserveDataExtended (address ) external returns (DataTypes .ReserveData memory ) envfree ;
7+ // function getReserveDataExtended (address ) external returns (DataTypes .ReserveData memory ) envfree ;
88 function getReserveData (address ) external returns (DataTypes .ReserveDataLegacy memory ) envfree ;
99
1010 function ValidationLogic .validateLiquidationCall (
@@ -21,22 +21,43 @@ methods {
2121 DataTypes .CalculateUserAccountDataParams memory params
2222 ) internal returns (uint256 , uint256 , uint256 , uint256 , uint256 , bool ) = > NONDET ;
2323
24- function LiquidationLogic ._calculateDebt (
24+ / * function LiquidationLogic ._calculateDebt (
2525 DataTypes .ReserveCache memory debtReserveCache ,
2626 DataTypes .ExecuteLiquidationCallParams memory params ,
2727 uint256 healthFactor
28- ) internal returns (uint256 , uint256 ) = > NONDET ;
28+ ) internal returns (uint256 , uint256 ) = > NONDET ;* /
2929
3030 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 ;
4061}
4162
4263
@@ -55,9 +76,9 @@ function init_state() {
5576}
5677
5778
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+ // }
6182
6283hook Sstore _reserves [KEY address a ].__deprecatedStableDebtTokenAddress address stable (address old_stable ) {
6384 assert false , "writing the field __deprecatedStableDebtTokenAddress" ;
@@ -82,29 +103,19 @@ rule stableFieldsUntouched(method f, env e, address _asset)
82103 aTokenToUnderlying [currentContract ._reserves [asset ].aTokenAddress ]== asset
83104 & &
84105 aTokenToUnderlying [currentContract ._reserves [asset ].variableDebtTokenAddress ]== asset ;
106+
85107
86- DataTypes .ReserveData reserve = getReserveDataExtended (_asset );
87108 DataTypes .ReserveDataLegacy reserveLegasy = getReserveData (_asset );
88109
89- uint128 __deprecatedStableBorrowRate_BEFORE = reserve .__deprecatedStableBorrowRate ;
90- address __deprecatedStableDebtTokenAddress_BEFORE = reserve .__deprecatedStableDebtTokenAddress ;
91110 uint128 currentStableBorrowRate_BEFORE = reserveLegasy .currentStableBorrowRate ;
92- // address stableDebtTokenAddress_BEFORE = reserveLegasy .stableDebtTokenAddress ;
93111
94112 calldataarg args ;
95113 f (e ,args );
96114
97- DataTypes .ReserveData reserve2 = getReserveDataExtended (_asset );
98115 DataTypes .ReserveDataLegacy reserveLegasy2 = getReserveData (_asset );
99116
100- uint128 __deprecatedStableBorrowRate_AFTER = reserve2 .__deprecatedStableBorrowRate ;
101- address __deprecatedStableDebtTokenAddress_AFTER = reserve2 .__deprecatedStableDebtTokenAddress ;
102117 uint128 currentStableBorrowRate_AFTER = reserveLegasy2 .currentStableBorrowRate ;
103118 address stableDebtTokenAddress_AFTER = reserveLegasy2 .stableDebtTokenAddress ;
104119
105- assert __deprecatedStableBorrowRate_BEFORE == __deprecatedStableBorrowRate_AFTER ;
106- assert __deprecatedStableDebtTokenAddress_BEFORE == __deprecatedStableDebtTokenAddress_AFTER ;
107120 assert currentStableBorrowRate_BEFORE == currentStableBorrowRate_AFTER ;
108- // assert stableDebtTokenAddress_BEFORE == stableDebtTokenAddress_AFTER ;
109-
110121}
0 commit comments