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

Add tETH to cWETHv3 and cWstETHv3 on Mainnet #955

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
bba7d99
feat: create comet with extended asset list
MishaShWoof Aug 9, 2024
fc16ae0
feat: move new cometExt to its own contract
MishaShWoof Aug 12, 2024
6b62ee6
fix: clean up
MishaShWoof Aug 12, 2024
d06a3f6
fix: gas optimization
MishaShWoof Aug 12, 2024
d2873ad
fix: more gas optimization
MishaShWoof Aug 12, 2024
5e867a0
fix: linter fix
MishaShWoof Aug 12, 2024
8ab1786
fix: natspec
MishaShWoof Aug 12, 2024
171eb7a
fix: more natspec
MishaShWoof Aug 12, 2024
53f1513
Update index.ts
MishaShWoof Aug 23, 2024
8df38e6
fix: remove unused iterface
MishaShWoof Aug 26, 2024
70e8a73
feat: add prepare and enact for simulation
MishaShWoof Aug 26, 2024
4c0a8f4
fix: fix to workflow
MishaShWoof Aug 26, 2024
c29f4b9
Update enact-migration.yaml
MishaShWoof Aug 26, 2024
cf08c19
fix: reverse
MishaShWoof Aug 26, 2024
71fee7b
feat: add prepare and enact workflow
MishaShWoof Aug 26, 2024
57d04f7
feat: update enact migration script
dmitriy-woof-software Aug 26, 2024
f0c33a1
feat: update enact migration script
dmitriy-woof-software Aug 26, 2024
df2d152
feat: update enact migration script
dmitriy-woof-software Aug 26, 2024
92937aa
feat: update enact migration script
dmitriy-woof-software Aug 26, 2024
b72092c
fix: remove verification from simulatative migration
MishaShWoof Aug 27, 2024
ea15450
Merge branch 'main' of github.com:woof-software/comet into woof-softw…
MishaShWoof Sep 17, 2024
dfe98c9
feat: fixes after audit
MishaShWoof Sep 19, 2024
4f2ba04
fix: working tests
MishaShWoof Sep 19, 2024
e641f95
fix: no network issue resolved
MishaShWoof Dec 13, 2024
986efa2
Merge branch 'main' into woof-software/collateral-extension
MishaShWoof Dec 20, 2024
5c75787
fix: audit fixes
MishaShWoof Dec 23, 2024
4e41a94
fix
MishaShWoof Dec 23, 2024
547e934
Merge branch 'woof-software/fix-to-no-network' of github.com:woof-sof…
MishaShWoof Dec 23, 2024
6635049
feat: working scenarios
MishaShWoof Dec 26, 2024
4ba3b92
feat: migrations and working scenarios
MishaShWoof Dec 27, 2024
c792011
fix
MishaShWoof Dec 27, 2024
9d67b33
fix: secret fix for scroll
MishaShWoof Dec 27, 2024
978dec0
fix: increase arbitrary number
MishaShWoof Dec 27, 2024
b6fb6a2
fix: scroll scan fix
MishaShWoof Dec 27, 2024
6a7f18a
feat: migrations and descriptions
MishaShWoof Jan 6, 2025
d7d9c2c
fix
MishaShWoof Jan 6, 2025
262fb3b
update descriptions
dmitriy-woof-software Jan 14, 2025
1b4307b
fix
MishaShWoof Jan 14, 2025
2381830
fix: review fix
MishaShWoof Jan 14, 2025
40e0370
fix: naming fix
MishaShWoof Jan 14, 2025
fb9f9b5
fix: optimizer
MishaShWoof Jan 14, 2025
f4860cf
fix: second optimizer fix
MishaShWoof Jan 14, 2025
94131ad
fix: optimization
MishaShWoof Jan 15, 2025
b6ff78e
Merge pull request #100 from woof-software/woof-software/collateral-e…
MishaShWoof Jan 17, 2025
5fe26a2
fix: merge fix
MishaShWoof Jan 17, 2025
d4dad32
feat: add tETH to mainnet-weth and neccesary chnages for the scenario…
MishaShWoof Jan 22, 2025
d3522dc
fix: extension delegate fix and linter fix
MishaShWoof Jan 23, 2025
6b35ee5
feat: migration for wstETH market
MishaShWoof Jan 23, 2025
d8ac7a5
feat: add force push for ext deployment
dmitriy-woof-software Jan 28, 2025
370f22a
fix: clean up debug
MishaShWoof Jan 28, 2025
4351754
Modified migration from GitHub Actions
Jan 28, 2025
2041a2a
Squashed 24 Collaterals
MishaShWoof Jan 29, 2025
f8afea6
Merge branch 'woof-software/collateral-extension' of github.com:woof-…
MishaShWoof Jan 29, 2025
8b17ce3
Merge branch 'woof-software/squash-teth-to-mainnet-weth-wsteth' of gi…
MishaShWoof Jan 29, 2025
3be23e1
fix: skip proposal
MishaShWoof Jan 29, 2025
d85b648
Update ProposalConstraint.ts
MishaShWoof Jan 29, 2025
74cb7f9
fix: new governance fix
MishaShWoof Feb 7, 2025
f2d824d
fear: remove impersonate
dmitriy-woof-software Feb 20, 2025
9ed075b
fix
MishaShWoof Feb 20, 2025
de8c79c
Modified migration from GitHub Actions
Feb 20, 2025
2e70ced
Update hardhat.config.ts
MishaShWoof Feb 20, 2025
768585d
fix
MishaShWoof Mar 4, 2025
f2fc2ad
fix: remove unsuccessful proposals
MishaShWoof Mar 10, 2025
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
Prev Previous commit
Next Next commit
fix: working tests
  • Loading branch information
MishaShWoof committed Sep 19, 2024
commit 4f2ba04a2ea5ea09b5eaedc6dd7e4391cf8e2225
107 changes: 85 additions & 22 deletions test/asset-info-test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { expect, exp, makeProtocol, ONE } from './helpers';
import { ethers } from 'hardhat';
import {
SimplePriceFeed__factory,
FaucetToken__factory,
CometHarness__factory
} from '../build/types';

describe('asset info', function () {
it('initializes protocol', async () => {
Expand Down Expand Up @@ -34,29 +40,86 @@ describe('asset info', function () {
});

it('reverts if too many assets are passed', async () => {
let priceFeeds = {};
const assets = {
USDC: {},
ASSET1: {},
ASSET2: {},
ASSET3: {},
ASSET4: {},
ASSET5: {},
ASSET6: {},
ASSET7: {},
ASSET8: {},
ASSET9: {},
ASSET10: {},
ASSET11: {},
ASSET12: {},
ASSET13: {},
ASSET14: {},
ASSET15: {},
ASSET16: {},
};
const base = 'USDC';
const PriceFeedFactory = (await ethers.getContractFactory('SimplePriceFeed')) as SimplePriceFeed__factory;
for (const asset in assets) {
const initialPrice = exp(assets[asset].initialPrice || 1, 8);
const priceFeedDecimals = assets[asset].priceFeedDecimals || 8;
const priceFeed = await PriceFeedFactory.deploy(initialPrice, priceFeedDecimals);
await priceFeed.deployed();
priceFeeds[asset] = priceFeed;
}
const FaucetFactory = (await ethers.getContractFactory('FaucetToken')) as FaucetToken__factory;
const tokens = {};
for (const symbol in assets) {
const config = assets[symbol];
const decimals = config.decimals || 18;
const initial = config.initial || 1e6;
const name = config.name || symbol;
const factory = config.factory || FaucetFactory;
let token;
token = (tokens[symbol] = await factory.deploy(initial, name, decimals, symbol));
await token.deployed();
}
const config = {
governor: ethers.constants.AddressZero,
pauseGuardian: ethers.constants.AddressZero,
extensionDelegate: ethers.constants.AddressZero,
baseToken: tokens[base].address,
baseTokenPriceFeed: priceFeeds[base].address,
supplyKink: 0,
supplyPerYearInterestRateBase: 0,
supplyPerYearInterestRateSlopeLow: 0,
supplyPerYearInterestRateSlopeHigh: 0,
borrowKink: 0,
borrowPerYearInterestRateBase: 0,
borrowPerYearInterestRateSlopeLow: 0,
borrowPerYearInterestRateSlopeHigh: 0,
storeFrontPriceFactor: 8,
trackingIndexScale: 0,
baseTrackingSupplySpeed: 0,
baseTrackingBorrowSpeed: 0,
baseMinForRewards: 0,
baseBorrowMin: 0,
targetReserves: 0,
assetConfigs: Object.entries(assets).reduce((acc, [symbol], _i) => {
if (symbol != base) {
acc.push({
asset: tokens[symbol].address,
priceFeed: priceFeeds[symbol].address,
decimals: 18,
borrowCollateralFactor: ONE - 1n,
liquidateCollateralFactor: ONE,
liquidationFactor: ONE,
supplyCap: exp(100, 18),
});
}
return acc;
}, []),
};
const CometFactory = (await ethers.getContractFactory('CometHarness')) as CometHarness__factory;
await expect(
makeProtocol({
assets: {
USDC: {},
ASSET1: {},
ASSET2: {},
ASSET3: {},
ASSET4: {},
ASSET5: {},
ASSET6: {},
ASSET7: {},
ASSET8: {},
ASSET9: {},
ASSET10: {},
ASSET11: {},
ASSET12: {},
ASSET13: {},
ASSET14: {},
ASSET15: {},
ASSET16: {},
},
reward: 'ASSET1',
})
CometFactory.deploy(config)
).to.be.revertedWith("custom error 'TooManyAssets()'");
});

Expand Down
15 changes: 11 additions & 4 deletions test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
BaseBulker,
BaseBulker__factory,
CometExt,
CometExt__factory,
CometExtAssetList__factory,
CometHarness__factory,
CometHarnessInterface as Comet,
Expand Down Expand Up @@ -282,8 +283,8 @@ export async function makeProtocol(opts: ProtocolOpts = {}): Promise<Protocol> {

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();
}

Expand All @@ -310,7 +311,7 @@ export async function makeProtocol(opts: ProtocolOpts = {}): Promise<Protocol> {
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,
Expand Down Expand Up @@ -341,7 +342,13 @@ export async function makeProtocol(opts: ProtocolOpts = {}): Promise<Protocol> {
}
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);
Expand Down