Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certora Review #7

Open
wants to merge 129 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
70b1e2c
Certora Report After Reintroduction Of Permissioned Rescue
MichaelMorami Sep 15, 2024
6345f33
Merge remote-tracking branch 'bgd-labs/v3.2.0' into certora
nisnislevi Sep 19, 2024
9297533
Merge remote-tracking branch 'bgd-labs/v3.2.0' into certora
nisnislevi Sep 22, 2024
63a2cc3
update stata to fit the new directories arrangment of the solidity
nisnislevi Sep 23, 2024
3a199ba
re-organization of the basic rules
nisnislevi Sep 23, 2024
03ac790
Merge remote-tracking branch 'bgd-labs/v3.2.0' into certora
nisnislevi Sep 23, 2024
0deedec
fix bug in conf
nisnislevi Sep 23, 2024
ccabc06
fix yml
nisnislevi Sep 23, 2024
44bd40d
fix yml again
nisnislevi Sep 23, 2024
67b7e19
fix yml again
nisnislevi Sep 23, 2024
f04eef0
add the get/set rules for EMode
nisnislevi Sep 23, 2024
0795456
Merge remote-tracking branch 'bgd-labs/main' into certora
nisnislevi Sep 30, 2024
9fcfd66
add to pool-harness: getConfiguration
nisnislevi Sep 30, 2024
3e5648f
add to pool-harness: getVirtualUnderlyingBalance
nisnislevi Sep 30, 2024
cc658f6
some fixes
nisnislevi Oct 6, 2024
c0b7228
Merge branch 'certora-squashed' into certora
nisnislevi Oct 6, 2024
bff7ce3
fix: apply gas & codesize savings
sakulstra Sep 26, 2024
969ee04
refactor: aggregator interface cleanup
sakulstra Sep 26, 2024
1b56764
perf: optimize bitmap for access instead of writes
sakulstra Sep 26, 2024
9302038
feat: deficit tracking and excess debt removal (#61)
ianflexa Sep 26, 2024
2ea3e77
fix: patch imports
sakulstra Sep 26, 2024
7e582b0
feat: getReserveAToken getter (#64)
sakulstra Sep 28, 2024
802924b
docs: refine docs (#67)
sakulstra Oct 1, 2024
f5389a4
fix: access cache not storage (#68)
sakulstra Oct 7, 2024
c4c438e
chore: add comment in `_burnBadDebt` + lint
ianflexa Oct 7, 2024
26b632d
feat: use addresses provider instead of acl (#66)
sakulstra Oct 7, 2024
da89365
fix: use cache.lastUpdatedTimestamp (#70)
sakulstra Oct 10, 2024
95bf29b
fix: debt cleanup review & liquidation improvements (#69)
sakulstra Oct 16, 2024
6e4a93b
refactor: improvements (#82)
sakulstra Oct 16, 2024
ae74fad
fix: add note about breaking change
sakulstra Oct 16, 2024
07c1da7
refactor: reuse _burnDebt (#83)
kyzia551 Oct 17, 2024
f910b01
feat: make weth and pool public for easier validation (#85)
sakulstra Oct 21, 2024
51c3f44
Merge remote-tracking branch 'bgd-labs/main' into certora
nisnislevi Oct 22, 2024
dd00c6a
docs: 3.3 docs & GHO improvements (#84)
sakulstra Oct 22, 2024
0c6fac8
fix: remove incomplete properties
sakulstra Oct 22, 2024
0e195bb
finding: remove unused error
sakulstra Oct 23, 2024
95fc118
finding: Validationlogic was imported but never used
sakulstra Oct 23, 2024
a473403
finding: unnecessary calculations in LiquiationLogic
sakulstra Oct 23, 2024
69baa1d
fix: allow 100% vf liquidations if collateral is below threshold
sakulstra Oct 23, 2024
677173c
fix: add test for 100% close factor
sakulstra Oct 23, 2024
027aaed
fix: resolve conflicts
sakulstra Oct 24, 2024
21f2616
Merge branch 'stermi/unused-import' into v3.3.3-certora
sakulstra Oct 24, 2024
86d07df
Merge branch 'stermi/unused-error' into v3.3.3-certora
sakulstra Oct 24, 2024
a223bed
finding: not considering fee when validating min_leftover
sakulstra Oct 23, 2024
57411c9
fix: conflicts
sakulstra Oct 24, 2024
b1f7f58
finding: unnecessary IAccessControl import
sakulstra Oct 29, 2024
17444f6
finding: misc natspec issues
sakulstra Oct 29, 2024
8fe1aa6
fix: apply stermies suggestions to eliminateReserveDeficit
sakulstra Oct 29, 2024
c21a2d2
fix: improve tests
sakulstra Oct 29, 2024
5e489ba
fix: remove obsolete comment
sakulstra Oct 29, 2024
cd4d59d
fix: move is collateral logic
sakulstra Oct 29, 2024
d4ae764
finding: cache lastUpdated
sakulstra Oct 29, 2024
ab8066b
fix: dont disable collateral
sakulstra Oct 29, 2024
a2180ee
fix: call handleRepayment when clearing deficit
sakulstra Oct 31, 2024
181577b
fix: gho accounting
sakulstra Oct 31, 2024
3aaee60
fix: docs
sakulstra Oct 31, 2024
dbfd840
fix: logic patch
sakulstra Oct 31, 2024
3fba8d0
fix: comment out test as doesn't make sense with the mock
sakulstra Oct 31, 2024
4f101ba
test: add tests
sakulstra Oct 31, 2024
05a2b55
fix: add comment
sakulstra Oct 31, 2024
f344197
sync to new EModeConfiguration.spec
nisnislevi Nov 4, 2024
6f9c5f7
Merge branch 'audit/certora-3.3.0' into certora
nisnislevi Nov 4, 2024
2d5ec46
Update src/contracts/protocol/libraries/logic/LiquidationLogic.sol
sakulstra Nov 4, 2024
73a23b9
fix: suppl 1 wei surplus
sakulstra Nov 4, 2024
f340a75
updating the rules for 3.3
nisnislevi Nov 4, 2024
c39cff3
in yml: move to certora-cli=7.17.2
nisnislevi Nov 4, 2024
ffe466d
fix: remove non functional test
sakulstra Nov 5, 2024
104a288
Update src/contracts/protocol/libraries/logic/LiquidationLogic.sol
sakulstra Nov 6, 2024
b516363
Update src/contracts/protocol/libraries/logic/LiquidationLogic.sol
sakulstra Nov 6, 2024
5ca633b
docs: add explanatory comment
sakulstra Nov 6, 2024
0b21084
refactor: better remove test
sakulstra Nov 6, 2024
707d652
fix: clearify it's the interest on the bad debt only
sakulstra Nov 6, 2024
1eb834b
docs: add a sentence to docs
sakulstra Nov 6, 2024
d45702a
docs: improve docs
sakulstra Nov 6, 2024
ab07809
Merge branch 'main' into certora
nisnislevi Nov 6, 2024
a07d6c7
small fix due to failure in CI
nisnislevi Nov 6, 2024
8c66ac7
for PR
nisnislevi Nov 6, 2024
bacdbf0
fix: dont disable collateral alternative
sakulstra Nov 13, 2024
b67fa3c
working on solvency for LiquidationCAll
nisnislevi Nov 14, 2024
905ade8
Merge branch 'stermi/IAccessControl' into v3.3.0
sakulstra Nov 18, 2024
9cfb2fc
Merge branch 'stermi/natspec' into v3.3.0
sakulstra Nov 18, 2024
e2315b3
Merge branch 'fix/cache-lastUpdated' into v3.3.0
sakulstra Nov 18, 2024
d9450ad
Merge branch 'fix/dont-disable-collateral-alternative' into v3.3.0
sakulstra Nov 18, 2024
38e0b15
docs: clearify docs
sakulstra Nov 18, 2024
2a59531
fix: address comments by stermi
sakulstra Nov 18, 2024
91ed89b
fix: resolve conflicts
sakulstra Nov 18, 2024
9d0ee8d
Merge branch 'fix/call-handleRepayment-when-clearing-deficit' into v3…
sakulstra Nov 18, 2024
ddb3ad0
fix: resolve conflicts
sakulstra Nov 18, 2024
e741c4d
lint: lint markdown
sakulstra Nov 18, 2024
ebd958b
fixing fv failures after code update
MichaelMorami Nov 18, 2024
44ca6db
Merge branch 'certora-squashed' into certora
MichaelMorami Nov 18, 2024
4b8ab37
fixing fv failures after code update (#76)
MichaelMorami Nov 18, 2024
4e79789
fix: harness
sakulstra Nov 19, 2024
6db6f6e
fix: patch harness
sakulstra Nov 19, 2024
5f6b1de
Merge remote-tracking branch 'origin/certora-squashed' into certora-s…
nisnislevi Nov 20, 2024
7e56424
Merge branch 'certora-squashed' into certora
nisnislevi Nov 20, 2024
10b8bdb
Merge branch 'certora-patch' into certora
nisnislevi Nov 20, 2024
a57b013
remove rule_sanity from 4 rules, and move to 7.17.2
nisnislevi Nov 20, 2024
9d3383a
end of 20/11
nisnislevi Nov 20, 2024
d3bf92e
fix: resolve conflicts
sakulstra Nov 20, 2024
af4bfb0
fix: properly resolve conflicts
sakulstra Nov 20, 2024
3008691
fix: adjust to new rescuable
sakulstra Nov 20, 2024
1918263
before updating to the fixed 3.3
nisnislevi Nov 21, 2024
b5a01ec
before updating to the fixed 3.3
nisnislevi Nov 21, 2024
61885f9
Merge branch 'v3.3.0' into pool-solvency
nisnislevi Nov 21, 2024
37f118f
end of 24/11
nisnislevi Nov 24, 2024
1101d98
end of 25/11
nisnislevi Nov 25, 2024
8b94bae
refactor: move logic to liquidationlogic (#122)
sakulstra Nov 25, 2024
b21b164
docs: add properties (#94)
sakulstra Nov 26, 2024
38b0cdd
fix: func visibility (#123)
brotherlymite Nov 26, 2024
12e529b
Fix: validationLogic and BridgeLogic titles (#127)
ianflexa Nov 27, 2024
0160ab5
fix: filtering reserves aTokens (#128)
ianflexa Nov 27, 2024
784d7f3
Merge branch 'main' into v3.3.0
sakulstra Nov 27, 2024
bc5ec02
end of 28.11
nisnislevi Nov 28, 2024
d15e4dd
add directory certora/solvency
nisnislevi Dec 1, 2024
56363df
trying alpha-master
nisnislevi Dec 4, 2024
7aabb1b
docs: update example to not overlap with other mechanics
sakulstra Dec 9, 2024
80d3454
fix: rsolve conflicts
sakulstra Dec 10, 2024
1fa3d57
fix: consider deficit as part of unbacked
sakulstra Dec 10, 2024
002a2b1
Update src/contracts/interfaces/IPool.sol
sakulstra Dec 11, 2024
487f19a
chore: bump revisions fix typos (#41)
sakulstra Dec 11, 2024
385287d
Apply suggestions from code review
sakulstra Dec 11, 2024
28d1cde
closing pool-solvency work before moving to public repo
nisnislevi Dec 12, 2024
bfdf50b
Merge remote-tracking branch 'bgd-public/v3.3.0' into certora
nisnislevi Dec 12, 2024
7871726
Merge remote-tracking branch 'certora-private/pool-solvency' into cer…
nisnislevi Dec 12, 2024
976577d
cli vertion to 7.20.3
nisnislevi Dec 12, 2024
ecc0cd6
remove solvency files, and prepare for PR
nisnislevi Dec 12, 2024
2750091
cosmetics in .yml
nisnislevi Dec 12, 2024
5985a89
fix nonpassing tests
nisnislevi Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/certora-basic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: certora
name: certora-basic

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
with: { distribution: "zulu", java-version: "11", java-package: jre }

- name: Install certora cli
run: pip install certora-cli==7.17.2
run: pip install certora-cli==7.20.3

- name: Install solc
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/certora-stata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with: { distribution: "zulu", java-version: "11", java-package: jre }

- name: Install certora cli
run: pip install certora-cli==7.17.2
run: pip install certora-cli==7.20.3
- name: Install solc
run: |
wget https://github.com/ethereum/solidity/releases/download/v0.8.20/solc-static-linux
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ permissions:
checks: read
statuses: read
pull-requests: write
contents: write

jobs:
comment:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@ jobs:
run: npm ci --prefer-offline --no-audit

- name: Run Foundry setup
uses: bgd-labs/github-workflows/.github/actions/foundry-setup@d738561b5afce35ca3752b28236c9dd68a3fa822
uses: bgd-labs/github-workflows/.github/actions/foundry-setup@4f16d15e380bbcf7e3933698c08b9fd34e967f78

- name: Run Forge tests
uses: bgd-labs/github-workflows/.github/actions/foundry-test@d738561b5afce35ca3752b28236c9dd68a3fa822
uses: bgd-labs/github-workflows/.github/actions/foundry-test@4f16d15e380bbcf7e3933698c08b9fd34e967f78

- name: Run Gas report
uses: bgd-labs/github-workflows/.github/actions/foundry-gas-report@d738561b5afce35ca3752b28236c9dd68a3fa822
uses: bgd-labs/github-workflows/.github/actions/foundry-gas-report@4f16d15e380bbcf7e3933698c08b9fd34e967f78

- name: Cleanup
# This test will currently fail on coverage due to the gas limit beaing breached with optimizer disabled
run: rm tests/deployments/DeploymentsGasLimits.t.sol

- name: Run Lcov report
uses: bgd-labs/github-workflows/.github/actions/foundry-lcov-report@d738561b5afce35ca3752b28236c9dd68a3fa822
uses: bgd-labs/github-workflows/.github/actions/foundry-lcov-report@4f16d15e380bbcf7e3933698c08b9fd34e967f78

- name: Save PR number
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test-contract :; forge test --match-contract ${filter} -vvv
test-watch :; forge test --watch -vvv --no-match-contract DeploymentsGasLimits

# Coverage
coverage-base :; forge coverage --report lcov --no-match-coverage "(scripts|tests|deployments|mocks)"
coverage-base :; forge coverage --fuzz-runs 50 --report lcov --no-match-coverage "(scripts|tests|deployments|mocks)"
coverage-clean :; lcov --rc derive_function_end_line=0 --remove ./lcov.info -o ./lcov.info.p \
'src/contracts/extensions/v3-config-engine/*' \
'src/contracts/treasury/*' \
Expand All @@ -37,7 +37,7 @@ coverage :
download :; cast etherscan-source --chain ${chain} -d src/etherscan/${chain}_${address} ${address}
git-diff :
@mkdir -p diffs
@npx prettier ${before} ${after} --write
# @npx prettier ${before} ${after} --write
@printf '%s\n%s\n%s\n' "\`\`\`diff" "$$(git diff --no-index --ignore-space-at-eol ${before} ${after})" "\`\`\`" > diffs/${out}.md

# Deploy
Expand All @@ -51,3 +51,5 @@ deploy-libs :
npx catapulta-verify -b broadcast/LibraryPreCompileOne.sol/${chainId}/run-latest.json
make deploy-libs-two chain=${chain}
npx catapulta-verify -b broadcast/LibraryPreCompileTwo.sol/${chainId}/run-latest.json

gas-report :; forge test --fuzz-runs 50 --gas-report
14 changes: 7 additions & 7 deletions certora/basic/conf/NEW-pool-no-summarizations.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"certora/basic/harness/ATokenHarness.sol",
"certora/basic/harness/PoolHarness.sol",
"certora/basic/harness/SimpleERC20.sol",
"src/contracts/instances/VariableDebtTokenInstance.sol",
"src/contracts/helpers/AaveProtocolDataProvider.sol",
"src/contracts/misc/DefaultReserveInterestRateStrategyV2.sol",
"src/contracts/protocol/configuration/ACLManager.sol",
"src/contracts/misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol",
"src/contracts/misc/PriceOracleSentinel.sol",
"src/contracts/protocol/configuration/PoolAddressesProvider.sol",
"certora/basic/munged/contracts/instances/VariableDebtTokenInstance.sol",
"certora/basic/munged/contracts/helpers/AaveProtocolDataProvider.sol",
"certora/basic/munged/contracts/misc/DefaultReserveInterestRateStrategyV2.sol",
"certora/basic/munged/contracts/protocol/configuration/ACLManager.sol",
"certora/basic/munged/contracts/misc/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol",
"certora/basic/munged/contracts/misc/PriceOracleSentinel.sol",
"certora/basic/munged/contracts/protocol/configuration/PoolAddressesProvider.sol",
],
"link": [
"ATokenHarness:POOL=PoolHarness",
Expand Down
10 changes: 5 additions & 5 deletions certora/basic/conf/NEW-pool-simple-properties.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"certora/basic/harness/ATokenHarness.sol",
"certora/basic/harness/PoolHarness.sol",
"certora/basic/harness/SimpleERC20.sol",
"src/contracts/instances/VariableDebtTokenInstance.sol",
"src/contracts/helpers/AaveProtocolDataProvider.sol",
"src/contracts/misc/DefaultReserveInterestRateStrategyV2.sol",
"src/contracts/protocol/libraries/types/DataTypes.sol",
"src/contracts/protocol/configuration/PoolAddressesProvider.sol",
"certora/basic/munged/contracts/instances/VariableDebtTokenInstance.sol",
"certora/basic/munged/contracts/helpers/AaveProtocolDataProvider.sol",
"certora/basic/munged/contracts/misc/DefaultReserveInterestRateStrategyV2.sol",
"certora/basic/munged/contracts/protocol/libraries/types/DataTypes.sol",
"certora/basic/munged/contracts/protocol/configuration/PoolAddressesProvider.sol",
],
"link": [
"ATokenHarness:POOL=PoolHarness",
Expand Down
4 changes: 2 additions & 2 deletions certora/basic/scripts/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ certoraRun $CMN certora/basic/conf/stableRemoved.conf \
--msg "6: Stable fields are un-touched"

echo
echo "******** Running: 6 EModeConfiguration ***************"
echo "******** Running: 7 EModeConfiguration ***************"
certoraRun $CMN certora/basic/conf/EModeConfiguration.conf \
--msg "6: EModeConfiguration"
--msg "7: EModeConfiguration"


echo
Expand Down
2 changes: 0 additions & 2 deletions certora/basic/specs/EModeConfiguration.spec
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,3 @@ rule independencyOfBorrowableSetters(uint256 reserveIndex, bool borrowable) {
assert (reserveIndex != reserveIndex_other => before == after);
}



10 changes: 5 additions & 5 deletions certora/basic/specs/NEW-pool-base.spec
Original file line number Diff line number Diff line change
Expand Up @@ -99,36 +99,36 @@ function calculateCompoundedInterestSummary(uint256 rate, uint40 t0, uint256 t1)
}

function isActiveReserve(env e, address asset) returns bool {
DataTypes.ReserveData data = getReserveDataExtended(e, asset);
DataTypes.ReserveDataLegacy data = getReserveData(e, asset);
DataTypes.ReserveConfigurationMap configuration = data.configuration;
bool isActive = getActive(e, configuration);

return isActive;
}

function isFrozenReserve(env e, address asset) returns bool {
DataTypes.ReserveData data = getReserveDataExtended(e, asset);
DataTypes.ReserveDataLegacy data = getReserveData(e, asset);
DataTypes.ReserveConfigurationMap configuration = data.configuration;
bool isFrozen = getFrozen(e, configuration);

return isFrozen;
}

function isEnabledForBorrow(env e, address asset) returns bool {
DataTypes.ReserveData data = getReserveDataExtended(e, asset);
DataTypes.ReserveDataLegacy data = getReserveData(e, asset);
DataTypes.ReserveConfigurationMap configuration = data.configuration;
bool isBorrowEnabled = getBorrowingEnabled(e, configuration);

return isBorrowEnabled;
}

function getCurrentLiquidityRate(env e, address asset) returns mathint {
DataTypes.ReserveData data = getReserveDataExtended(e, asset);
DataTypes.ReserveDataLegacy data = getReserveData(e, asset);
return data.currentLiquidityRate;
}

function getLiquidityIndex(env e, address asset) returns mathint {
DataTypes.ReserveData data = getReserveDataExtended(e, asset);
DataTypes.ReserveDataLegacy data = getReserveData(e, asset);
return data.liquidityIndex;
}

Expand Down
2 changes: 1 addition & 1 deletion certora/basic/specs/NEW-pool-no-summarizations.spec
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ rule liquidityIndexNonDecresingFor_cumulateToLiquidityIndex() {


function get_AToken_of_asset(env e, address asset) returns address {
DataTypes.ReserveData data = getReserveDataExtended(e, asset);
DataTypes.ReserveDataLegacy data = getReserveData(e, asset);
return data.aTokenAddress;
}

Expand Down
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
63 changes: 37 additions & 26 deletions certora/basic/specs/stableRemoved.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "aux/aToken.spec";
//import "AddressProvider.spec";

methods {
function getReserveDataExtended(address) external returns (DataTypes.ReserveData memory) envfree;
// function getReserveDataExtended(address) external returns (DataTypes.ReserveData memory) envfree;
function getReserveData(address) external returns (DataTypes.ReserveDataLegacy memory) envfree;

function ValidationLogic.validateLiquidationCall(
Expand All @@ -21,22 +21,43 @@ methods {
DataTypes.CalculateUserAccountDataParams memory params
) internal returns (uint256, uint256, uint256, uint256, uint256, bool) => NONDET;

function LiquidationLogic._calculateDebt(
/* function LiquidationLogic._calculateDebt(
DataTypes.ReserveCache memory debtReserveCache,
DataTypes.ExecuteLiquidationCallParams memory params,
uint256 healthFactor
) internal returns (uint256, uint256) => NONDET;
) internal returns (uint256, uint256) => NONDET;*/

function LiquidationLogic._calculateAvailableCollateralToLiquidate(
DataTypes.ReserveData storage collateralReserve,
DataTypes.ReserveCache memory debtReserveCache,
address collateralAsset,
address debtAsset,
uint256 debtToCover,
uint256 userCollateralBalance,
uint256 liquidationBonus,
address // IPriceOracleGetter
) internal returns (uint256,uint256,uint256) => NONDET;
DataTypes.ReserveConfigurationMap memory collateralReserveConfiguration,
uint256 collateralAssetPrice,
uint256 collateralAssetUnit,
uint256 debtAssetPrice,
uint256 debtAssetUnit,
uint256 debtToCover,
uint256 userCollateralBalance,
uint256 liquidationBonus
) internal returns (uint256, uint256, uint256, uint256) => NONDET;
}


// 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;
}


Expand All @@ -55,9 +76,9 @@ function init_state() {
}


hook Sstore _reserves[KEY address a].__deprecatedStableBorrowRate uint128 rate (uint128 old_rate) {
assert false, "writing the field __deprecatedStableBorrowRate";
}
//hook Sstore _reserves[KEY address a].__deprecatedStableBorrowRate uint128 rate (uint128 old_rate) {
// assert false, "writing the field __deprecatedStableBorrowRate";
//}

hook Sstore _reserves[KEY address a].__deprecatedStableDebtTokenAddress address stable (address old_stable) {
assert false, "writing the field __deprecatedStableDebtTokenAddress";
Expand All @@ -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;

}
24 changes: 0 additions & 24 deletions certora/deprecated/Makefile

This file was deleted.

56 changes: 0 additions & 56 deletions certora/deprecated/README.md

This file was deleted.

Loading
Loading