Skip to content

Commit 8c66ac7

Browse files
committed
for PR
1 parent 077c99e commit 8c66ac7

File tree

2 files changed

+28
-9
lines changed

2 files changed

+28
-9
lines changed

certora/basic/specs/EModeConfiguration.spec

+26-7
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,37 @@ methods {
66
}
77

88

9+
/*=====================================================================================
10+
Rule: setCollateralIntegrity / setBorrowableIntegrity:
11+
We check the integrity of the functions setReserveBitmapBit (which is a setter) and
12+
isReserveEnabledOnBitmap (which is a getter), simply by setting an arbitrary value to arbitrary
13+
location, and then reading it using the getter.
14+
15+
Note: the functions setCollateral and isCollateralAsset are envelopes to the above setter and getter
16+
and are implemented in the harness.
17+
18+
Status: PASS
19+
Link:
20+
=====================================================================================*/
921
rule setCollateralIntegrity(uint256 reserveIndex, bool collateral) {
1022
setCollateral(reserveIndex,collateral);
1123
assert isCollateralAsset(reserveIndex) == collateral;
1224
}
25+
rule setBorrowableIntegrity(uint256 reserveIndex, bool borrowable) {
26+
setBorrowable(reserveIndex,borrowable);
27+
assert isBorrowableAsset(reserveIndex) == borrowable;
28+
}
29+
30+
31+
32+
/*=====================================================================================
33+
Rule: independencyOfCollateralSetters / independencyOfBorrowableSetters:
34+
We check that when calling to setReserveBitmapBit(index,val) only the value at the given
35+
index may be altered.
1336

37+
Status: PASS
38+
Link:
39+
=====================================================================================*/
1440
rule independencyOfCollateralSetters(uint256 reserveIndex, bool collateral) {
1541
uint256 reserveIndex_other;
1642

@@ -20,13 +46,6 @@ rule independencyOfCollateralSetters(uint256 reserveIndex, bool collateral) {
2046

2147
assert (reserveIndex != reserveIndex_other => before == after);
2248
}
23-
24-
25-
rule setBorrowableIntegrity(uint256 reserveIndex, bool borrowable) {
26-
setBorrowable(reserveIndex,borrowable);
27-
assert isBorrowableAsset(reserveIndex) == borrowable;
28-
}
29-
3049
rule independencyOfBorrowableSetters(uint256 reserveIndex, bool borrowable) {
3150
uint256 reserveIndex_other;
3251

certora/basic/specs/stableRemoved.spec

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ rule stableFieldsUntouched(method f, env e, address _asset)
8989
uint128 __deprecatedStableBorrowRate_BEFORE = reserve.__deprecatedStableBorrowRate;
9090
address __deprecatedStableDebtTokenAddress_BEFORE = reserve.__deprecatedStableDebtTokenAddress;
9191
uint128 currentStableBorrowRate_BEFORE = reserveLegasy.currentStableBorrowRate;
92-
address stableDebtTokenAddress_BEFORE = reserveLegasy.stableDebtTokenAddress;
92+
// address stableDebtTokenAddress_BEFORE = reserveLegasy.stableDebtTokenAddress;
9393

9494
calldataarg args;
9595
f(e,args);
@@ -105,6 +105,6 @@ rule stableFieldsUntouched(method f, env e, address _asset)
105105
assert __deprecatedStableBorrowRate_BEFORE == __deprecatedStableBorrowRate_AFTER;
106106
assert __deprecatedStableDebtTokenAddress_BEFORE == __deprecatedStableDebtTokenAddress_AFTER;
107107
assert currentStableBorrowRate_BEFORE == currentStableBorrowRate_AFTER;
108-
assert stableDebtTokenAddress_BEFORE == stableDebtTokenAddress_AFTER;
108+
// assert stableDebtTokenAddress_BEFORE == stableDebtTokenAddress_AFTER;
109109

110110
}

0 commit comments

Comments
 (0)