From 5c75787759f1a7b415512e9e4c47ab253ee07262 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Mon, 23 Dec 2024 14:35:33 +0200 Subject: [PATCH 1/6] fix: audit fixes --- contracts/AssetList.sol | 189 ++++++++++++++++-- contracts/AssetListFactory.sol | 5 + ... => CometFactoryWithExtendedAssetList.sol} | 6 +- ...ist.sol => CometWithExtendedAssetList.sol} | 4 +- contracts/IAssetList.sol | 1 + contracts/IAssetListFactory.sol | 5 + contracts/IAssetListFactoryHolder.sol | 4 + .../test/CometHarnessExtendedAssetList.sol | 6 +- test/helpers.ts | 25 ++- 9 files changed, 213 insertions(+), 32 deletions(-) rename contracts/{CometFactoryExtendedAssetList.sol => CometFactoryWithExtendedAssetList.sol} (51%) rename contracts/{CometExtendedAssetList.sol => CometWithExtendedAssetList.sol} (99%) diff --git a/contracts/AssetList.sol b/contracts/AssetList.sol index 467de215c..6ca5c74da 100644 --- a/contracts/AssetList.sol +++ b/contracts/AssetList.sol @@ -20,8 +20,54 @@ contract AssetList { /// @dev The max value for a collateral factor (1) uint64 internal constant MAX_COLLATERAL_FACTOR = FACTOR_SCALE; - uint256[] internal assets_a; - uint256[] internal assets_b; + uint256 internal immutable asset00_a; + uint256 internal immutable asset00_b; + uint256 internal immutable asset01_a; + uint256 internal immutable asset01_b; + uint256 internal immutable asset02_a; + uint256 internal immutable asset02_b; + uint256 internal immutable asset03_a; + uint256 internal immutable asset03_b; + uint256 internal immutable asset04_a; + uint256 internal immutable asset04_b; + uint256 internal immutable asset05_a; + uint256 internal immutable asset05_b; + uint256 internal immutable asset06_a; + uint256 internal immutable asset06_b; + uint256 internal immutable asset07_a; + uint256 internal immutable asset07_b; + uint256 internal immutable asset08_a; + uint256 internal immutable asset08_b; + uint256 internal immutable asset09_a; + uint256 internal immutable asset09_b; + uint256 internal immutable asset10_a; + uint256 internal immutable asset10_b; + uint256 internal immutable asset11_a; + uint256 internal immutable asset11_b; + uint256 internal immutable asset12_a; + uint256 internal immutable asset12_b; + uint256 internal immutable asset13_a; + uint256 internal immutable asset13_b; + uint256 internal immutable asset14_a; + uint256 internal immutable asset14_b; + uint256 internal immutable asset15_a; + uint256 internal immutable asset15_b; + uint256 internal immutable asset16_a; + uint256 internal immutable asset16_b; + uint256 internal immutable asset17_a; + uint256 internal immutable asset17_b; + uint256 internal immutable asset18_a; + uint256 internal immutable asset18_b; + uint256 internal immutable asset19_a; + uint256 internal immutable asset19_b; + uint256 internal immutable asset20_a; + uint256 internal immutable asset20_b; + uint256 internal immutable asset21_a; + uint256 internal immutable asset21_b; + uint256 internal immutable asset22_a; + uint256 internal immutable asset22_b; + uint256 internal immutable asset23_a; + uint256 internal immutable asset23_b; /// @notice The number of assets this contract actually supports uint8 public immutable numAssets; @@ -29,20 +75,38 @@ contract AssetList { constructor(CometConfiguration.AssetConfig[] memory assetConfigs) { uint8 _numAssets = uint8(assetConfigs.length); numAssets = _numAssets; - uint256[] memory _assets_a = new uint256[](_numAssets); - uint256[] memory _assets_b = new uint256[](_numAssets); - for (uint i = 0; i < _numAssets; ) { - (uint256 asset_a, uint256 asset_b) = getPackedAssetInternal(assetConfigs, i); - _assets_a[i] = asset_a; - _assets_b[i] = asset_b; - unchecked { i++; } - } - assets_a = _assets_a; - assets_b = _assets_b; + + (asset00_a, asset00_b) = getPackedAssetInternal(assetConfigs, 0); + (asset01_a, asset01_b) = getPackedAssetInternal(assetConfigs, 1); + (asset02_a, asset02_b) = getPackedAssetInternal(assetConfigs, 2); + (asset03_a, asset03_b) = getPackedAssetInternal(assetConfigs, 3); + (asset04_a, asset04_b) = getPackedAssetInternal(assetConfigs, 4); + (asset05_a, asset05_b) = getPackedAssetInternal(assetConfigs, 5); + (asset06_a, asset06_b) = getPackedAssetInternal(assetConfigs, 6); + (asset07_a, asset07_b) = getPackedAssetInternal(assetConfigs, 7); + (asset08_a, asset08_b) = getPackedAssetInternal(assetConfigs, 8); + (asset09_a, asset09_b) = getPackedAssetInternal(assetConfigs, 9); + (asset10_a, asset10_b) = getPackedAssetInternal(assetConfigs, 10); + (asset11_a, asset11_b) = getPackedAssetInternal(assetConfigs, 11); + (asset12_a, asset12_b) = getPackedAssetInternal(assetConfigs, 12); + (asset13_a, asset13_b) = getPackedAssetInternal(assetConfigs, 13); + (asset14_a, asset14_b) = getPackedAssetInternal(assetConfigs, 14); + (asset15_a, asset15_b) = getPackedAssetInternal(assetConfigs, 15); + (asset16_a, asset16_b) = getPackedAssetInternal(assetConfigs, 16); + (asset17_a, asset17_b) = getPackedAssetInternal(assetConfigs, 17); + (asset18_a, asset18_b) = getPackedAssetInternal(assetConfigs, 18); + (asset19_a, asset19_b) = getPackedAssetInternal(assetConfigs, 19); + (asset20_a, asset20_b) = getPackedAssetInternal(assetConfigs, 20); + (asset21_a, asset21_b) = getPackedAssetInternal(assetConfigs, 21); + (asset22_a, asset22_b) = getPackedAssetInternal(assetConfigs, 22); + (asset23_a, asset23_b) = getPackedAssetInternal(assetConfigs, 23); } /** * @dev Checks and gets the packed asset info for storage + * @param assetConfigs The asset configurations + * @param i The index of the asset info to get + * @return The packed asset info */ function getPackedAssetInternal(CometConfiguration.AssetConfig[] memory assetConfigs, uint i) internal view returns (uint256, uint256) { CometConfiguration.AssetConfig memory assetConfig; @@ -102,9 +166,104 @@ contract AssetList { */ function getAssetInfo(uint8 i) public view returns (CometCore.AssetInfo memory) { if (i >= numAssets) revert CometMainInterface.BadAsset(); - - uint256 word_a = assets_a[i]; - uint256 word_b = assets_b[i]; + uint256 word_a; + uint256 word_b; + if(i == 0){ + word_a = asset00_a; + word_b = asset00_b; + } + if(i == 1){ + word_a = asset01_a; + word_b = asset01_b; + } + if(i == 2){ + word_a = asset02_a; + word_b = asset02_b; + } + if(i == 3){ + word_a = asset03_a; + word_b = asset03_b; + } + if(i == 4){ + word_a = asset04_a; + word_b = asset04_b; + } + if(i == 5){ + word_a = asset05_a; + word_b = asset05_b; + } + if(i == 6){ + word_a = asset06_a; + word_b = asset06_b; + } + if(i == 7){ + word_a = asset07_a; + word_b = asset07_b; + } + if(i == 8){ + word_a = asset08_a; + word_b = asset08_b; + } + if(i == 9){ + word_a = asset09_a; + word_b = asset09_b; + } + if(i == 10){ + word_a = asset10_a; + word_b = asset10_b; + } + if(i == 11){ + word_a = asset11_a; + word_b = asset11_b; + } + if(i == 12){ + word_a = asset12_a; + word_b = asset12_b; + } + if(i == 13){ + word_a = asset13_a; + word_b = asset13_b; + } + if(i == 14){ + word_a = asset14_a; + word_b = asset14_b; + } + if(i == 15){ + word_a = asset15_a; + word_b = asset15_b; + } + if(i == 16){ + word_a = asset16_a; + word_b = asset16_b; + } + if(i == 17){ + word_a = asset17_a; + word_b = asset17_b; + } + if(i == 18){ + word_a = asset18_a; + word_b = asset18_b; + } + if(i == 19){ + word_a = asset19_a; + word_b = asset19_b; + } + if(i == 20){ + word_a = asset20_a; + word_b = asset20_b; + } + if(i == 21){ + word_a = asset21_a; + word_b = asset21_b; + } + if(i == 22){ + word_a = asset22_a; + word_b = asset22_b; + } + if(i == 23){ + word_a = asset23_a; + word_b = asset23_b; + } address asset = address(uint160(word_a & type(uint160).max)); uint64 rescale = FACTOR_SCALE / 1e4; diff --git a/contracts/AssetListFactory.sol b/contracts/AssetListFactory.sol index 52c190adc..ba3218ff0 100644 --- a/contracts/AssetListFactory.sol +++ b/contracts/AssetListFactory.sol @@ -10,6 +10,11 @@ import "./AssetList.sol"; contract AssetListFactory { event AssetListCreated(address indexed assetList, CometCore.AssetConfig[] assetConfigs); + /** + * @notice Create a new asset list + * @param assetConfigs The asset configurations + * @return assetList The address of the new asset list + */ function createAssetList(CometCore.AssetConfig[] memory assetConfigs) external returns (address assetList) { assetList = address(new AssetList(assetConfigs)); emit AssetListCreated(assetList, assetConfigs); diff --git a/contracts/CometFactoryExtendedAssetList.sol b/contracts/CometFactoryWithExtendedAssetList.sol similarity index 51% rename from contracts/CometFactoryExtendedAssetList.sol rename to contracts/CometFactoryWithExtendedAssetList.sol index 5d30705f7..d95244e2a 100644 --- a/contracts/CometFactoryExtendedAssetList.sol +++ b/contracts/CometFactoryWithExtendedAssetList.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.15; -import "./CometExtendedAssetList.sol"; +import "./CometWithExtendedAssetList.sol"; import "./CometConfiguration.sol"; -contract CometFactoryExtendedAssetList is CometConfiguration { +contract CometFactoryWithExtendedAssetList is CometConfiguration { function clone(Configuration calldata config) external returns (address) { - return address(new CometExtendedAssetList(config)); + return address(new CometWithExtendedAssetList(config)); } } \ No newline at end of file diff --git a/contracts/CometExtendedAssetList.sol b/contracts/CometWithExtendedAssetList.sol similarity index 99% rename from contracts/CometExtendedAssetList.sol rename to contracts/CometWithExtendedAssetList.sol index 71af9774d..8ca1e0735 100644 --- a/contracts/CometExtendedAssetList.sol +++ b/contracts/CometWithExtendedAssetList.sol @@ -13,7 +13,7 @@ import "./IAssetList.sol"; * @notice An efficient monolithic money market protocol * @author Compound */ -contract CometExtendedAssetList is CometMainInterface { +contract CometWithExtendedAssetList is CometMainInterface { /** General configuration constants **/ /// @notice The admin of the protocol @@ -1239,7 +1239,7 @@ contract CometExtendedAssetList is CometMainInterface { /** * @notice Fallback to calling the extension delegate for everything else */ - fallback() external payable { + fallback() external { address delegate = extensionDelegate; assembly { calldatacopy(0, 0, calldatasize()) diff --git a/contracts/IAssetList.sol b/contracts/IAssetList.sol index 584e6cc2b..bdc6b8aae 100644 --- a/contracts/IAssetList.sol +++ b/contracts/IAssetList.sol @@ -9,4 +9,5 @@ import "./CometCore.sol"; */ interface IAssetList { function getAssetInfo(uint8 i) external view returns (CometCore.AssetInfo memory); + function numAssets() external view returns (uint8); } \ No newline at end of file diff --git a/contracts/IAssetListFactory.sol b/contracts/IAssetListFactory.sol index 9f41c28a5..7e89c5da1 100644 --- a/contracts/IAssetListFactory.sol +++ b/contracts/IAssetListFactory.sol @@ -7,5 +7,10 @@ import "./CometCore.sol"; * @author Compound */ interface IAssetListFactory { + /** + * @notice Create a new asset list + * @param assetConfigs The asset configurations + * @return assetList The address of the new asset list + */ function createAssetList(CometCore.AssetConfig[] memory assetConfigs) external returns (address assetList); } \ No newline at end of file diff --git a/contracts/IAssetListFactoryHolder.sol b/contracts/IAssetListFactoryHolder.sol index 0691cada7..8ba2ab551 100644 --- a/contracts/IAssetListFactoryHolder.sol +++ b/contracts/IAssetListFactoryHolder.sol @@ -6,5 +6,9 @@ pragma solidity 0.8.15; * @author Compound */ interface IAssetListFactoryHolder { + /** + * @notice Get the asset list factory + * @return assetListFactory The asset list factory + */ function assetListFactory() external view returns (address); } \ No newline at end of file diff --git a/contracts/test/CometHarnessExtendedAssetList.sol b/contracts/test/CometHarnessExtendedAssetList.sol index 73bc27b94..0ab2845c8 100644 --- a/contracts/test/CometHarnessExtendedAssetList.sol +++ b/contracts/test/CometHarnessExtendedAssetList.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.15; -import "../CometExtendedAssetList.sol"; +import "../CometWithExtendedAssetList.sol"; -contract CometHarnessExtendedAssetList is CometExtendedAssetList { +contract CometHarnessExtendedAssetList is CometWithExtendedAssetList { uint public nowOverride; - constructor(Configuration memory config) CometExtendedAssetList(config) {} + constructor(Configuration memory config) CometWithExtendedAssetList(config) {} function getNowInternal() override internal view returns (uint40) { return nowOverride > 0 ? uint40(nowOverride) : super.getNowInternal(); diff --git a/test/helpers.ts b/test/helpers.ts index 8aba14fa8..535b4e178 100644 --- a/test/helpers.ts +++ b/test/helpers.ts @@ -7,6 +7,7 @@ import { BaseBulker, BaseBulker__factory, CometExt, + CometExt__factory, CometExtAssetList__factory, CometHarness__factory, CometHarnessInterface as Comet, @@ -35,7 +36,7 @@ import { AssetListFactory, AssetListFactory__factory, CometHarnessExtendedAssetList__factory, - CometHarnessInterfaceExtendedAssetList as CometExtendedAssetList, + CometHarnessInterfaceExtendedAssetList as CometWithExtendedAssetList, } from '../build/types'; import { BigNumber } from 'ethers'; import { TransactionReceipt, TransactionResponse } from '@ethersproject/abstract-provider'; @@ -102,7 +103,7 @@ export type Protocol = { base: string; reward: string; comet: Comet; - cometExtendedAssetList: CometExtendedAssetList; + cometWithExtendedAssetList: CometWithExtendedAssetList; assetListFactory: AssetListFactory; tokens: { [symbol: string]: FaucetToken | NonStandardFaucetFeeToken; @@ -282,8 +283,8 @@ export async function makeProtocol(opts: ProtocolOpts = {}): Promise { let extensionDelegate = opts.extensionDelegate; if (extensionDelegate === undefined) { - const CometExtFactory = (await ethers.getContractFactory('CometExtAssetList')) as CometExtAssetList__factory; - extensionDelegate = await CometExtFactory.deploy({ name32, symbol32 }, assetListFactory.address); + const CometExtFactory = (await ethers.getContractFactory('CometExt')) as CometExt__factory; + extensionDelegate = await CometExtFactory.deploy({ name32, symbol32 }); await extensionDelegate.deployed(); } @@ -310,7 +311,7 @@ export async function makeProtocol(opts: ProtocolOpts = {}): Promise { baseBorrowMin, targetReserves, assetConfigs: Object.entries(assets).reduce((acc, [symbol, config], _i) => { - if (symbol != base && _i < 12) { + if (symbol != base && _i <= 12) { acc.push({ asset: tokens[symbol].address, priceFeed: priceFeeds[symbol].address, @@ -341,7 +342,13 @@ export async function makeProtocol(opts: ProtocolOpts = {}): Promise { } return acc; }, []); - + let extensionDelegateAssetList = opts.extensionDelegate; + if (extensionDelegateAssetList === undefined) { + const CometExtFactory = (await ethers.getContractFactory('CometExtAssetList')) as CometExtAssetList__factory; + extensionDelegateAssetList = await CometExtFactory.deploy({ name32, symbol32 }, assetListFactory.address); + await extensionDelegateAssetList.deployed(); + } + config.extensionDelegate = extensionDelegateAssetList.address; const CometFactoryExtendedAssetList = (await ethers.getContractFactory('CometHarnessExtendedAssetList')) as CometHarnessExtendedAssetList__factory; const cometExtendedAssetList = await CometFactoryExtendedAssetList.deploy(config); @@ -367,7 +374,7 @@ export async function makeProtocol(opts: ProtocolOpts = {}): Promise { base, reward, comet: await ethers.getContractAt('CometHarnessInterface', comet.address) as Comet, - cometExtendedAssetList: await ethers.getContractAt('CometHarnessInterfaceExtendedAssetList', cometExtendedAssetList.address) as CometExtendedAssetList, + cometWithExtendedAssetList: await ethers.getContractAt('CometHarnessInterfaceExtendedAssetList', cometExtendedAssetList.address) as CometWithExtendedAssetList, assetListFactory: assetListFactory, tokens, unsupportedToken, @@ -387,7 +394,7 @@ export async function makeConfigurator(opts: ProtocolOpts = {}): Promise Date: Mon, 23 Dec 2024 15:25:10 +0200 Subject: [PATCH 2/6] fix --- contracts/CometWithExtendedAssetList.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/CometWithExtendedAssetList.sol b/contracts/CometWithExtendedAssetList.sol index 8ca1e0735..5e5659ec8 100644 --- a/contracts/CometWithExtendedAssetList.sol +++ b/contracts/CometWithExtendedAssetList.sol @@ -1239,7 +1239,7 @@ contract CometWithExtendedAssetList is CometMainInterface { /** * @notice Fallback to calling the extension delegate for everything else */ - fallback() external { + fallback() external payable { address delegate = extensionDelegate; assembly { calldatacopy(0, 0, calldatasize()) From 23818306add6af2b41fa3e210162c7b413844aa9 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Tue, 14 Jan 2025 15:48:25 +0200 Subject: [PATCH 3/6] fix: review fix --- contracts/AssetList.sol | 9 ++++++++- contracts/IAssetListFactoryHolder.sol | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/contracts/AssetList.sol b/contracts/AssetList.sol index 6ca5c74da..0165efcb2 100644 --- a/contracts/AssetList.sol +++ b/contracts/AssetList.sol @@ -103,7 +103,14 @@ contract AssetList { } /** - * @dev Checks and gets the packed asset info for storage + * @dev Checks and gets the packed asset info for storage in 2 variables + * - in first variable, the asset address is stored in the lower 160 bits (address can be interpreted as uint160), + * the borrow collateral factor in the next 16 bits, + * the liquidate collateral factor in the next 16 bits, + * and the liquidation factor in the next 16 bits + * - in the second variable, the price feed address is stored in the lower 160 bits, + * the asset decimals in the next 8 bits, + * and the supply cap in the next 64 bits * @param assetConfigs The asset configurations * @param i The index of the asset info to get * @return The packed asset info diff --git a/contracts/IAssetListFactoryHolder.sol b/contracts/IAssetListFactoryHolder.sol index 8ba2ab551..266bf3352 100644 --- a/contracts/IAssetListFactoryHolder.sol +++ b/contracts/IAssetListFactoryHolder.sol @@ -8,7 +8,7 @@ pragma solidity 0.8.15; interface IAssetListFactoryHolder { /** * @notice Get the asset list factory - * @return assetListFactory The asset list factory + * @return assetListFactory The asset list factory address */ function assetListFactory() external view returns (address); } \ No newline at end of file From 40e0370d94042e97567148e83fff0b1593c0a105 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Tue, 14 Jan 2025 16:37:26 +0200 Subject: [PATCH 4/6] fix: naming fix --- test/absorb-test.ts | 2 +- test/asset-info-test-asset-list-comet.ts | 6 +++--- test/bulker-test.ts | 4 ++-- test/helpers.ts | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/absorb-test.ts b/test/absorb-test.ts index 8b0fe708b..2ab6c1e80 100644 --- a/test/absorb-test.ts +++ b/test/absorb-test.ts @@ -580,7 +580,7 @@ describe('absorb', function () { }, reward: 'COMP', }); - const { cometExtendedAssetList : comet, tokens: { + const { cometWithExtendedAssetList : comet, tokens: { COMP, WETH, }, users: [absorber, underwater] } = protocol; diff --git a/test/asset-info-test-asset-list-comet.ts b/test/asset-info-test-asset-list-comet.ts index 14f511b31..5650f0203 100644 --- a/test/asset-info-test-asset-list-comet.ts +++ b/test/asset-info-test-asset-list-comet.ts @@ -2,7 +2,7 @@ import { expect, exp, makeConfigurator, ONE, makeProtocol } from './helpers'; describe('asset info', function () { it('initializes protocol', async () => { - const { cometExtendedAssetList: comet, tokens } = await makeConfigurator({ + const { cometWithExtendedAssetList: comet, tokens } = await makeConfigurator({ assets: { USDC: {}, ASSET1: {}, @@ -68,8 +68,8 @@ describe('asset info', function () { }); it('reverts if index is greater than numAssets', async () => { - const { cometExtendedAssetList } = await makeConfigurator(); - await expect(cometExtendedAssetList.getAssetInfo(3)).to.be.revertedWith("custom error 'BadAsset()'"); + const { cometWithExtendedAssetList } = await makeConfigurator(); + await expect(cometWithExtendedAssetList.getAssetInfo(3)).to.be.revertedWith("custom error 'BadAsset()'"); }); it('reverts if collateral factors are out of range', async () => { diff --git a/test/bulker-test.ts b/test/bulker-test.ts index ca5c380de..cfd5a9318 100644 --- a/test/bulker-test.ts +++ b/test/bulker-test.ts @@ -77,7 +77,7 @@ describe('bulker', function () { }, reward: 'COMP', }); - const { cometExtendedAssetList : comet, tokens: { + const { cometWithExtendedAssetList : comet, tokens: { COMP, WETH, USDC, @@ -392,7 +392,7 @@ describe('bulker', function () { }, reward: 'COMP', }); - const { cometExtendedAssetList : comet, tokens: { + const { cometWithExtendedAssetList : comet, tokens: { COMP, WETH, }, users: [alice] } = protocol; diff --git a/test/helpers.ts b/test/helpers.ts index 535b4e178..a6bfcd19f 100644 --- a/test/helpers.ts +++ b/test/helpers.ts @@ -351,13 +351,13 @@ export async function makeProtocol(opts: ProtocolOpts = {}): Promise { config.extensionDelegate = extensionDelegateAssetList.address; const CometFactoryExtendedAssetList = (await ethers.getContractFactory('CometHarnessExtendedAssetList')) as CometHarnessExtendedAssetList__factory; - const cometExtendedAssetList = await CometFactoryExtendedAssetList.deploy(config); - await cometExtendedAssetList.deployed(); + const cometWithExtendedAssetList = await CometFactoryExtendedAssetList.deploy(config); + await cometWithExtendedAssetList.deployed(); if (opts.start) await ethers.provider.send('evm_setNextBlockTimestamp', [opts.start]); await comet.initializeStorage(); - await cometExtendedAssetList.initializeStorage(); + await cometWithExtendedAssetList.initializeStorage(); const baseTokenBalance = opts.baseTokenBalance; if (baseTokenBalance) { @@ -374,7 +374,7 @@ export async function makeProtocol(opts: ProtocolOpts = {}): Promise { base, reward, comet: await ethers.getContractAt('CometHarnessInterface', comet.address) as Comet, - cometWithExtendedAssetList: await ethers.getContractAt('CometHarnessInterfaceExtendedAssetList', cometExtendedAssetList.address) as CometWithExtendedAssetList, + cometWithExtendedAssetList: await ethers.getContractAt('CometHarnessInterfaceExtendedAssetList', cometWithExtendedAssetList.address) as CometWithExtendedAssetList, assetListFactory: assetListFactory, tokens, unsupportedToken, From fb9f9b5ca53f8cd88639ac93a3d4b58c05d73a55 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Tue, 14 Jan 2025 17:05:11 +0200 Subject: [PATCH 5/6] fix: optimizer --- .github/workflows/run-forge-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-forge-tests.yaml b/.github/workflows/run-forge-tests.yaml index 6a10f7523..9a6d2b5b6 100644 --- a/.github/workflows/run-forge-tests.yaml +++ b/.github/workflows/run-forge-tests.yaml @@ -21,7 +21,7 @@ jobs: run: forge install - name: Run tests - run: forge test -vvv --via-ir + run: forge test -vvv --via-ir --optimizer-runs 1 env: ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }} SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} From f4860cf4c03b3618d1eba7efccd74daa76afcd13 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Tue, 14 Jan 2025 17:09:21 +0200 Subject: [PATCH 6/6] fix: second optimizer fix --- .github/workflows/run-forge-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-forge-tests.yaml b/.github/workflows/run-forge-tests.yaml index 9a6d2b5b6..126091154 100644 --- a/.github/workflows/run-forge-tests.yaml +++ b/.github/workflows/run-forge-tests.yaml @@ -33,4 +33,4 @@ jobs: - name: Build Comet with older solc versions run: | - forge build --contracts contracts/Comet.sol --use solc:0.8.15 --via-ir + forge build --contracts contracts/Comet.sol --use solc:0.8.15 --via-ir --optimizer-runs 1