Skip to content

Commit

Permalink
Merge branch 'certora-squashed' into certora
Browse files Browse the repository at this point in the history
  • Loading branch information
nisnislevi committed Oct 6, 2024
2 parents 3e5648f + cc658f6 commit c0b7228
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions certora/basic/specs/EModeConfiguration.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,37 @@ methods {
}


/*=====================================================================================
Rule: setCollateralIntegrity / setBorrowableIntegrity:
We check the integrity of the functions setReserveBitmapBit (which is a setter) and
isReserveEnabledOnBitmap (which is a getter), simply by setting an arbitrary value to arbitrary
location, and then reading it using the getter.

Note: the functions setCollateral and isCollateralAsset are envelopes to the above setter and getter
and are implemented in the harness.

Status: PASS
Link:
=====================================================================================*/
rule setCollateralIntegrity(uint256 reserveIndex, bool collateral) {
setCollateral(reserveIndex,collateral);
assert isCollateralAsset(reserveIndex) == collateral;
}
rule setBorrowableIntegrity(uint256 reserveIndex, bool borrowable) {
setBorrowable(reserveIndex,borrowable);
assert isBorrowableAsset(reserveIndex) == borrowable;
}



/*=====================================================================================
Rule: independencyOfCollateralSetters / independencyOfBorrowableSetters:
We check that when calling to setReserveBitmapBit(index,val) only the value at the given
index may be altered.

Status: PASS
Link:
=====================================================================================*/
rule independencyOfCollateralSetters(uint256 reserveIndex, bool collateral) {
uint256 reserveIndex_other;

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

assert (reserveIndex != reserveIndex_other => before == after);
}


rule setBorrowableIntegrity(uint256 reserveIndex, bool borrowable) {
setBorrowable(reserveIndex,borrowable);
assert isBorrowableAsset(reserveIndex) == borrowable;
}

rule independencyOfBorrowableSetters(uint256 reserveIndex, bool borrowable) {
uint256 reserveIndex_other;

Expand Down

0 comments on commit c0b7228

Please sign in to comment.