Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 6 additions & 6 deletions .github/workflows/certora-basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ concurrency:
on:
pull_request:
branches:
- main
- certora
- "**"
push:
branches:
- main
Expand All @@ -18,13 +17,14 @@ on:
jobs:
verify:
runs-on: ubuntu-latest
if:
github.event.pull_request.head.repo.full_name == github.repository || (github.event_name == 'push' &&
github.ref == format('refs/heads/{0}', github.event.repository.default_branch))
# if:
# github.event.pull_request.head.repo.full_name == github.repository || (github.event_name == 'push' &&
# github.ref == format('refs/heads/{0}', github.event.repository.default_branch))
permissions:
contents: read
statuses: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -36,7 +36,7 @@ jobs:
touch applyHarness.patch
make munged

- uses: Certora/certora-run-action@v1
- uses: Certora/certora-run-action@v2
with:
cli-version: 7.29.1
configurations: |-
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/certora-stata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ concurrency:
on:
pull_request:
branches:
- main
- certora
- "**"
push:
branches:
- main
Expand All @@ -18,13 +17,14 @@ on:
jobs:
verify:
runs-on: ubuntu-latest
if:
github.event.pull_request.head.repo.full_name == github.repository || (github.event_name == 'push' &&
github.ref == format('refs/heads/{0}', github.event.repository.default_branch))
# if:
# github.event.pull_request.head.repo.full_name == github.repository || (github.event_name == 'push' &&
# github.ref == format('refs/heads/{0}', github.event.repository.default_branch))
permissions:
contents: read
statuses: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -36,7 +36,7 @@ jobs:
touch applyHarness.patch
make munged

- uses: Certora/certora-run-action@v1
- uses: Certora/certora-run-action@v2
with:
cli-version: 7.29.1
configurations: |-
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Dependency Review'
name: "Dependency Review"
on: [pull_request]

permissions:
Expand All @@ -9,9 +9,9 @@ jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
- name: "Checkout Repository"
uses: actions/checkout@v5
- name: 'Dependency Review'
- name: "Dependency Review"
uses: actions/dependency-review-action@v4
with:
comment-summary-in-pr: on-failure
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ deploy-phase-one-update-payload :;
--sig "run()" \
--verify --broadcast

# Deploy liquidation data provider. `make deploy-liquidation-data-provider CHAIN=mainnet ACCOUNT=<account>`
deploy-liquidation-data-provider :;
FOUNDRY_PROFILE=${CHAIN} forge script scripts/misc/DeployLiquidationDataProvider.sol:DeployLiquidationDataProvider \
--rpc-url ${CHAIN} --account ${ACCOUNT} --slow --gas-estimate-multiplier 150 \
--chain ${CHAIN} --verifier-url ${VERIFIER_URL} \
--sig "run(address,address)" ${pool} ${addressesProvider} \
--verify --broadcast

# Invariants
echidna:
echidna tests/invariants/Tester.t.sol --contract Tester --config ./tests/invariants/_config/echidna_config.yaml --corpus-dir ./tests/invariants/_corpus/echidna/default/_data/corpus
Expand Down
17 changes: 17 additions & 0 deletions scripts/misc/DeployLiquidationDataProvider.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import {LiquidationDataProvider} from '../../src/contracts/helpers/LiquidationDataProvider.sol';
import {Script} from 'forge-std/Script.sol';

contract DeployLiquidationDataProvider is Script {
function run(address pool, address addressesProvider) public returns (address) {
vm.startBroadcast();
LiquidationDataProvider liquidationDataProvider = new LiquidationDataProvider(
pool,
addressesProvider
);
vm.stopBroadcast();
return address(liquidationDataProvider);
}
}
44 changes: 44 additions & 0 deletions tests/deployments/DeployLiquidationDataProvider.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import {Test} from 'forge-std/Test.sol';
import {DeployLiquidationDataProvider} from '../../scripts/misc/DeployLiquidationDataProvider.sol';
import {ILiquidationDataProvider} from '../../src/contracts/helpers/interfaces/ILiquidationDataProvider.sol';

contract DeployLiquidationDataProviderForkTest is Test {
address public constant POOL = 0xAe05Cd22df81871bc7cC2a04BeCfb516bFe332C8;
address public constant ADDRESSES_PROVIDER = 0x5D39E06b825C1F2B80bf2756a73e28eFAA128ba0;

DeployLiquidationDataProvider internal deployLiquidationDataProvider;
ILiquidationDataProvider internal liquidationDataProvider;

function setUp() public virtual {
vm.createSelectFork('mainnet', 23420687);

deployLiquidationDataProvider = new DeployLiquidationDataProvider();
liquidationDataProvider = ILiquidationDataProvider(
deployLiquidationDataProvider.run(POOL, ADDRESSES_PROVIDER)
);
}

function test_getUserPositionFullInfo() public view {
address user = 0xFf09aAD651888ceFAd81271a79b4Ef7dEC245F49; // sample user with USDC debt
address USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
ILiquidationDataProvider.UserPositionFullInfo memory userInfo = liquidationDataProvider
.getUserPositionFullInfo(user);

assertGt(userInfo.healthFactor, 1e18); // healthy health factor

ILiquidationDataProvider.DebtFullInfo memory debtInfo = liquidationDataProvider.getDebtFullInfo(
user,
USDC
);

assertGt(debtInfo.debtBalanceInBaseCurrency, 0);
}

function test_deployLiquidationDataProvider() public view {
assertEq(address(liquidationDataProvider.POOL()), POOL);
assertEq(address(liquidationDataProvider.ADDRESSES_PROVIDER()), ADDRESSES_PROVIDER);
}
}
1 change: 1 addition & 0 deletions tests/deployments/HorizonPhaseOneListing.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@ abstract contract HorizonListingMainnetTest is HorizonListingBaseTest {
});

function setUp() public virtual {
vm.skip(true);
vm.createSelectFork('mainnet');
initEnvironment();
}
Expand Down
1 change: 1 addition & 0 deletions tests/deployments/HorizonPhaseOneUpdate.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ contract HorizonPhaseOneUpdateTest is HorizonPhaseOneListingTest {
}

function setUp() public virtual override {
vm.skip(true);
super.setUp();
loadUpdatedParams();
}
Expand Down
Loading