Skip to content

Commit

Permalink
fix nonpassing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nisnislevi committed Dec 12, 2024
1 parent 2750091 commit 5985a89
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
1 change: 1 addition & 0 deletions certora/basic/specs/aux/aToken.spec
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ function indexForToken(address token, env e) returns uint256 {

// todo: adjust for stable debt token
function aTokenBalanceOfCVL(address token, address user, env e) returns uint256 {
require token != 0;
uint storedBalance = balanceOfCVL(token, user);
if (aTokenToUnderlying[token] == 0) {
// not a properly initialized aToken, return the regular ERC20 balance
Expand Down
33 changes: 22 additions & 11 deletions certora/basic/specs/stableRemoved.spec
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,27 @@ methods {
}


// For flashloan
methods {
function _.executeOperation(
address[] assets,
uint256[] amounts,
uint256[] premiums,
address initiator,
bytes params
) external => NONDET; // expect bool;

// simple receiver
function _.executeOperation(
address asset,
uint256 amount,
uint256 premium,
address initiator,
bytes params
) external => NONDET; // expect bool;
}




function init_state() {
Expand Down Expand Up @@ -82,29 +103,19 @@ rule stableFieldsUntouched(method f, env e, address _asset)
aTokenToUnderlying[currentContract._reserves[asset].aTokenAddress]==asset
&&
aTokenToUnderlying[currentContract._reserves[asset].variableDebtTokenAddress]==asset;


//DataTypes.ReserveData reserve = getReserveDataExtended(_asset);
DataTypes.ReserveDataLegacy reserveLegasy = getReserveData(_asset);

//uint128 __deprecatedStableBorrowRate_BEFORE = reserve.__deprecatedStableBorrowRate;
//address __deprecatedStableDebtTokenAddress_BEFORE = reserve.__deprecatedStableDebtTokenAddress;
uint128 currentStableBorrowRate_BEFORE = reserveLegasy.currentStableBorrowRate;
// address stableDebtTokenAddress_BEFORE = reserveLegasy.stableDebtTokenAddress;

calldataarg args;
f(e,args);

// DataTypes.ReserveData reserve2 = getReserveDataExtended(_asset);
DataTypes.ReserveDataLegacy reserveLegasy2 = getReserveData(_asset);

//uint128 __deprecatedStableBorrowRate_AFTER = reserve2.__deprecatedStableBorrowRate;
//address __deprecatedStableDebtTokenAddress_AFTER = reserve2.__deprecatedStableDebtTokenAddress;
uint128 currentStableBorrowRate_AFTER = reserveLegasy2.currentStableBorrowRate;
address stableDebtTokenAddress_AFTER = reserveLegasy2.stableDebtTokenAddress;

// assert __deprecatedStableBorrowRate_BEFORE == __deprecatedStableBorrowRate_AFTER;
//assert __deprecatedStableDebtTokenAddress_BEFORE == __deprecatedStableDebtTokenAddress_AFTER;
assert currentStableBorrowRate_BEFORE == currentStableBorrowRate_AFTER;
// assert stableDebtTokenAddress_BEFORE == stableDebtTokenAddress_AFTER;

}

0 comments on commit 5985a89

Please sign in to comment.