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

fix: fixing fv failures after code update & upgrade ci (#76) #77

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
11 changes: 3 additions & 8 deletions .github/workflows/certora-basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Check key
env:
CERTORAKEY: ${{ secrets.CERTORAKEY }}
run: echo "key length" ${#CERTORAKEY}

- name: Install python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with: { python-version: 3.9 }

- name: Install java
uses: actions/setup-java@v1
with: { java-version: "11", java-package: jre }
uses: actions/setup-java@v4
with: { distribution: "zulu", java-version: "11", java-package: jre }

- name: Install certora cli
run: pip install certora-cli==7.14.2
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/certora-stata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ jobs:
github.ref == format('refs/heads/{0}', github.event.repository.default_branch))

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with: { python-version: 3.9 }

- name: Install java
uses: actions/setup-java@v1
with: { java-version: "11", java-package: jre }
uses: actions/setup-java@v4
with: { distribution: "zulu", java-version: "11", java-package: jre }

- name: Install certora cli
run: pip install certora-cli==7.14.2
Expand Down
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
4 changes: 2 additions & 2 deletions certora/basic/specs/stableRemoved.spec
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ rule stableFieldsUntouched(method f, env e, address _asset)
uint128 __deprecatedStableBorrowRate_BEFORE = reserve.__deprecatedStableBorrowRate;
address __deprecatedStableDebtTokenAddress_BEFORE = reserve.__deprecatedStableDebtTokenAddress;
uint128 currentStableBorrowRate_BEFORE = reserveLegasy.currentStableBorrowRate;
address stableDebtTokenAddress_BEFORE = reserveLegasy.stableDebtTokenAddress;
// address stableDebtTokenAddress_BEFORE = reserveLegasy.stableDebtTokenAddress;

calldataarg args;
f(e,args);
Expand All @@ -105,6 +105,6 @@ rule stableFieldsUntouched(method f, env e, address _asset)
assert __deprecatedStableBorrowRate_BEFORE == __deprecatedStableBorrowRate_AFTER;
assert __deprecatedStableDebtTokenAddress_BEFORE == __deprecatedStableDebtTokenAddress_AFTER;
assert currentStableBorrowRate_BEFORE == currentStableBorrowRate_AFTER;
assert stableDebtTokenAddress_BEFORE == stableDebtTokenAddress_AFTER;
// assert stableDebtTokenAddress_BEFORE == stableDebtTokenAddress_AFTER;

}
12 changes: 6 additions & 6 deletions certora/stata/applyHarness.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ diff -ruN src/core/instances/ATokenInstance.sol src/core/instances/ATokenInstanc
--- src/contracts/instances/ATokenInstance.sol 2024-09-05 19:01:54
+++ src/contracts/instances/ATokenInstance.sol 2024-09-05 11:33:23
@@ -35,15 +35,15 @@

_domainSeparator = _calculateDomainSeparator();

- emit Initialized(
- underlyingAsset,
- address(POOL),
Expand All @@ -34,12 +34,12 @@ diff -ruN src/core/instances/ATokenInstance.sol src/core/instances/ATokenInstanc
+ // );
}
}
diff -ruN src/periphery/contracts/static-a-token/ERC20AaveLMUpgradeable.sol src/periphery/contracts/static-a-token/ERC20AaveLMUpgradeable.sol
--- src/contracts/extensions/static-a-token/ERC20AaveLMUpgradeable.sol 2024-09-05 19:01:54
+++ src/contracts/extensions/static-a-token/ERC20AaveLMUpgradeable.sol 2024-09-05 13:48:31
diff -ruN src/periphery/contracts/static-a-token/ERC20AaveLMUpgradeable.sol src/periphery/contracts/stata-token/ERC20AaveLMUpgradeable.sol
--- src/contracts/extensions/stata-token/ERC20AaveLMUpgradeable.sol 2024-09-05 19:01:54
+++ src/contracts/extensions/stata-token/ERC20AaveLMUpgradeable.sol 2024-09-05 13:48:31
@@ -147,7 +147,7 @@
}

///@inheritdoc IERC20AaveLM
- function rewardTokens() external view returns (address[] memory) {
+ function rewardTokens() public view returns (address[] memory) {
Expand Down
2 changes: 1 addition & 1 deletion certora/stata/harness/StataTokenV2Harness.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.10;

import {IERC20} from 'openzeppelin-contracts/contracts/interfaces/IERC20.sol';
import {StataTokenV2, IPool, IRewardsController} from '../munged/src/contracts/extensions/static-a-token/StataTokenV2.sol';
import {StataTokenV2, IPool, IRewardsController} from '../munged/src/contracts/extensions/stata-token/StataTokenV2.sol';
import {SymbolicLendingPool} from './pool/SymbolicLendingPool.sol';

contract StataTokenV2Harness is StataTokenV2 {
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/extensions/stata-token/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# stataToken - Static aToken vault/wrapper

<p align="center">
<img src="../../../../resources/static-a-token-wrapping.jpeg" width="300">
<img src="../../../../resources/stata-token-wrapping.jpeg" width="300">
</p>

## About
Expand Down
Loading