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
31 changes: 5 additions & 26 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,24 @@ on:
types: [opened, reopened, synchronize]

env:
CI: true
FORK_RPC_URL: ${{ secrets.MAINNET_TESTS_FORK }}
FOUNDRY_ETH_RPC_URL: https://eth-mainnet.g.alchemy.com/v2/${{ secrets.ALCHEMY_KEY_CI }}

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Use Latest Corepack
run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
pnpm --version

- name: Setup node.js
uses: actions/setup-node@v4
with:
cache: "pnpm"
node-version-file: ".nvmrc"

- name: Install node dependencies
run: pnpm install --frozen-lockfile

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
version: v1.5.1

- name: Install forge dependencies
run: forge i
run: forge install

- name: Build project
run: forge b
run: forge build

- name: Run tests
run: forge test --fork-url ${{ secrets.MAINNET_TESTS_FORK }}
run: forge test
11 changes: 5 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ name: Release

on:
push:
branches:
- "master"
- "next"
branches: [master, next]

env:
HUSKY: 0
CI: true
permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
Expand Down
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

8 changes: 7 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
[
"@semantic-release/github",
{
"successComment": false,
"failTitle": false
}
]
]
}
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["JuanBlanco.solidity"]
}
23 changes: 14 additions & 9 deletions contracts/test/RateKeeperFactoryPatchV311.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,31 @@ contract RateKeeperFactoryPatchV311Test is AttachTestBase {
address pool;

function setUp() public {
_attachCore();

vm.skip(block.chainid != 1, "Not Ethereum mainnet");
_setUp();
vm.skip(
bytecodeRepository.getLatestPatchVersion("RATE_KEEPER_FACTORY", 3_10) != 3_10,
"RateKeeperFactory is already patched"
);

_uploadContract("RATE_KEEPER_FACTORY", 3_11, type(RateKeeperFactory).creationCode);

_attachMarketConfigurator();
pool = _createMockMarket(WETH, WETH_PRICE_FEED);
_allowPriceFeed(WETH, WETH_PRICE_FEED);
_allowPriceFeed(USDC, USDC_PRICE_FEED);

deal({token: WETH, to: address(marketConfigurator), give: 1e5});
MarketParams memory marketParams = _getDefaultMarketParams(WETH);
marketParams.underlyingPriceFeed = WETH_PRICE_FEED;
pool = _createMockMarket(WETH, marketParams);

vm.prank(riskCurator);
marketConfigurator.addToken({pool: pool, token: USDC, priceFeed: USDC_PRICE_FEED});
TokenParams memory tokenParams = _getDefaultTokenParams(USDC);
tokenParams.priceFeed = USDC_PRICE_FEED;
_addToken(pool, tokenParams);
}

function test_rate_keeper_update_fails_with_old_rate_keeper_factory() public {
vm.expectRevert(TokenIsNotQuotedException.selector);
vm.prank(riskCurator);
_omniPrank(riskCurator);
marketConfigurator.updateRateKeeper(
pool, DeployParams({postfix: "TUMBLER", salt: "NEW SALT", constructorParams: abi.encode(pool, 1 days)})
);
Expand All @@ -47,7 +52,7 @@ contract RateKeeperFactoryPatchV311Test is AttachTestBase {
function test_rate_keeper_update_succeeds_with_patched_rate_keeper_factory() public {
_upgradeRateKeeperFactory();

vm.prank(riskCurator);
_omniPrank(riskCurator);
marketConfigurator.updateRateKeeper(
pool, DeployParams({postfix: "TUMBLER", salt: "NEW SALT", constructorParams: abi.encode(pool, 1 days)})
);
Expand All @@ -57,7 +62,7 @@ contract RateKeeperFactoryPatchV311Test is AttachTestBase {
vm.prank(crossChainGovernance);
instanceManager.deploySystemContract("RATE_KEEPER_FACTORY", 3_11, true);

vm.prank(riskCurator);
_omniPrank(riskCurator);
marketConfigurator.upgradeRateKeeperFactory(pool);
}
}
Loading
Loading