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

Deploy Ronin WETH market #123

Open
wants to merge 137 commits into
base: squash-ronin
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
137 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
d3522dc
fix: extension delegate fix and linter fix
MishaShWoof Jan 23, 2025
e3ac068
feat: roninscan, deploy, relayer ccip, etc
artemwoofsoftware Jan 24, 2025
b2ddf00
feat: migrations and fixes
artemwoofsoftware Jan 25, 2025
c04e412
fix: roninscan constructor args fetch and deploy script
artemwoofsoftware Jan 28, 2025
d8ac7a5
feat: add force push for ext deployment
dmitriy-woof-software Jan 28, 2025
6addf47
Merge branch 'woof-software/fix-to-no-network' of github.com:woof-sof…
artemwoofsoftware Jan 28, 2025
370f22a
fix: clean up debug
MishaShWoof Jan 28, 2025
d4affd7
info: wip
artemwoofsoftware Jan 28, 2025
4351754
Modified migration from GitHub Actions
Jan 28, 2025
a6d4d3d
fix: actions
artemwoofsoftware Jan 28, 2025
ffef88b
feat: wip
artemwoofsoftware Jan 29, 2025
f79de73
feat: wip
artemwoofsoftware Jan 29, 2025
0f3cd57
fix: resolved merge conflicts in workflow files and plugins
artemwoofsoftware Jan 29, 2025
f011826
feat: finalized scenarios, added ronin bridge receiver, etc
artemwoofsoftware Jan 29, 2025
56e20cc
fix: fixes after audit
MishaShWoof Jan 30, 2025
6fda51a
fix: opcode fix
MishaShWoof Feb 6, 2025
344e8c0
fix: forge fix
MishaShWoof Feb 6, 2025
091c0bc
fix: forge test
MishaShWoof Feb 6, 2025
6cd2191
fix: forge test
MishaShWoof Feb 6, 2025
1eb737b
feat: wip
artemwoofsoftware Feb 6, 2025
2a59c3d
feat: merge
artemwoofsoftware Feb 6, 2025
e42a958
fix: conflict
artemwoofsoftware Feb 6, 2025
c99f563
fix: conflict
artemwoofsoftware Feb 6, 2025
02a96fa
fix: scenarios
MishaShWoof Feb 6, 2025
0707d18
Trigger actions
dmitriy-woof-software Feb 7, 2025
ff81ff3
fix: remove repeatable deployments issue
MishaShWoof Feb 7, 2025
a82a1b0
fix: base usds contract support and scroll prepare fix
MishaShWoof Feb 7, 2025
7b43a9a
feat: wip
artemwoofsoftware Feb 11, 2025
6788ac6
update Seacrest commit hash to support scroll network
dmitriy-woof-software Feb 11, 2025
f0db6dd
feat: update node version to 18 in enact script
dmitriy-woof-software Feb 11, 2025
6634200
feat: re-use 24 collaterals comet factory and asset list factory
dmitriy-woof-software Feb 11, 2025
acd8af0
feat: fix prepare
dmitriy-woof-software Feb 11, 2025
adfa49e
feat: wip
artemwoofsoftware Feb 11, 2025
295aeef
feat: ronin weth market
artemwoofsoftware Feb 12, 2025
47d0c10
fix: linter, boilerplate
artemwoofsoftware Feb 12, 2025
a8da9bf
fix: minors
artemwoofsoftware Feb 12, 2025
0bd1837
fix: lint
artemwoofsoftware Feb 12, 2025
5cae1ae
fix: scenarios
artemwoofsoftware Feb 12, 2025
4f61483
feat: updated configuration
artemwoofsoftware Feb 18, 2025
7f6b47e
feat: update seacrest version
dmitriy-woof-software Feb 21, 2025
d9d67cc
feat: update configuration
dmitriy-woof-software Feb 21, 2025
b0b2f8a
feat: updated oracles
artemwoofsoftware Feb 21, 2025
c9c9f39
fix: clone multisig script
artemwoofsoftware Feb 21, 2025
85a44fd
feat: pause guardian, additional verification
artemwoofsoftware Feb 21, 2025
004914e
fix: disabled set rewards
artemwoofsoftware Feb 21, 2025
f17a0a3
fix: rewards disabled
artemwoofsoftware Feb 22, 2025
1239ae7
fix: migrations, deploy script, scenarios
artemwoofsoftware Feb 22, 2025
6d0f217
fix: oracles
artemwoofsoftware Feb 24, 2025
71b16dc
fix: price feeds
artemwoofsoftware Feb 24, 2025
464e9a7
fix: comments
artemwoofsoftware Feb 24, 2025
7c7482d
fix: scenarios, comments
artemwoofsoftware Feb 24, 2025
342f788
feat: update description
dmitriy-woof-software Feb 24, 2025
93b7967
feat: update deploy-market.yaml
dmitriy-woof-software Feb 24, 2025
e6b5eac
feat: update hardhat.config
dmitriy-woof-software Feb 24, 2025
e69a8dc
feat: clean up
dmitriy-woof-software Feb 24, 2025
5f31cc3
fix: wip
artemwoofsoftware Feb 25, 2025
93ef360
Modified deployment roots from GitHub Actions
Feb 25, 2025
a8822e3
feat: update description and caps
dmitriy-woof-software Feb 25, 2025
a63bd77
feat: use tenderly RPC after deployment to run scenarios
dmitriy-woof-software Feb 26, 2025
b387e59
fix: bridge receiver deployment
artemwoofsoftware Feb 26, 2025
fcf8bcb
fix: bridge receiver
artemwoofsoftware Feb 26, 2025
dac9889
fix: deleted roots
artemwoofsoftware Feb 27, 2025
327fa10
Modified deployment roots from GitHub Actions
Feb 27, 2025
31016a7
feat: audit fixes
artemwoofsoftware Feb 27, 2025
1e3e0ef
fix: deployment
artemwoofsoftware Feb 27, 2025
bebd34e
Modified deployment roots from GitHub Actions
Feb 28, 2025
a467b27
fix: null caps
artemwoofsoftware Feb 28, 2025
38a86c9
Modified deployment roots from GitHub Actions
Feb 28, 2025
98eb392
feat: standalone config
artemwoofsoftware Feb 28, 2025
0ce2330
feat: update ENS list in verification
dmitriy-woof-software Feb 28, 2025
7a8fb7c
feat: add WBTC market into ENS
dmitriy-woof-software Feb 28, 2025
769b8e3
feat: debug ENS
dmitriy-woof-software Feb 28, 2025
020f21a
feat: debug ENS
dmitriy-woof-software Feb 28, 2025
94724ee
feat: debug ENS
dmitriy-woof-software Feb 28, 2025
7e3b161
feat: comment rewards config check
dmitriy-woof-software Feb 28, 2025
7f16bfc
fix: enact
artemwoofsoftware Mar 4, 2025
9d61762
feat: update ENS
dmitriy-woof-software Mar 5, 2025
560879e
fix: erased caps and roots
artemwoofsoftware Mar 12, 2025
93ee109
fix: tenderly provider
artemwoofsoftware Mar 12, 2025
9790f5d
fix: bridge receiver rollback
artemwoofsoftware Mar 12, 2025
d170677
fix: bridge receiver
artemwoofsoftware Mar 12, 2025
0108f65
Merge pull request #144 from woof-software/fix/bridge-receiver
artemwoofsoftware Mar 13, 2025
7aa3732
feat: updated existing addresses
artemwoofsoftware Mar 13, 2025
8616c13
Modified deployment roots from GitHub Actions
Mar 13, 2025
44ce31f
feat: updated caps
artemwoofsoftware Mar 13, 2025
8b51911
feat: updated caps
artemwoofsoftware Mar 13, 2025
538b21a
feat: updated description
artemwoofsoftware Mar 13, 2025
4313d3b
fix: updated bridge receiver address
artemwoofsoftware Mar 13, 2025
bbbf4b1
Modified deployment roots from GitHub Actions
Mar 13, 2025
d3131e2
feat: rollback caps
artemwoofsoftware Mar 13, 2025
3695e9d
feat: updated description
artemwoofsoftware Mar 13, 2025
c071830
Modified migration from GitHub Actions
Mar 19, 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
feat: move new cometExt to its own contract
  • Loading branch information
MishaShWoof committed Aug 12, 2024
commit fc16ae0e756e7bf4dd7daea053850fc60b1c64df
5 changes: 1 addition & 4 deletions contracts/CometExt.sol
Original file line number Diff line number Diff line change
@@ -29,16 +29,13 @@ contract CometExt is CometExtInterface {
/// @dev The ERC20 symbol for wrapped base token
bytes32 internal immutable symbol32;

address immutable public assetListFactory;

/**
* @notice Construct a new protocol instance
* @param config The mapping of initial/constant parameters
**/
constructor(ExtConfiguration memory config, address assetListFactoryAddress) {
constructor(ExtConfiguration memory config) {
name32 = config.name32;
symbol32 = config.symbol32;
assetListFactory = assetListFactoryAddress;
}

/** External getters for internal constants **/
17 changes: 17 additions & 0 deletions contracts/CometExtAssetList.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.15;

import "./CometExt.sol";

contract CometExtAssetList is CometExt {

address immutable public assetListFactory;

/**
* @notice Construct a new protocol instance
* @param config The mapping of initial/constant parameters
**/
constructor(ExtConfiguration memory config, address assetListFactoryAddress) CometExt(config) {
assetListFactory = assetListFactoryAddress;
}

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: compound.solidity.missing-constructor-sanity-checks Warning

There're no sanity checks for the constructor argument assetListFactoryAddress.

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: compound.solidity.missing-constructor-sanity-checks Warning

There're no sanity checks for the constructor argument config.

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.non-payable-constructor Note

Consider making costructor payable to save gas.
}
3 changes: 2 additions & 1 deletion contracts/CometExtendedAssetList.sol
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
import "./IERC20NonStandard.sol";
import "./IPriceFeed.sol";
import "./IAssetListFactory.sol";
import "./IAssetListFactoryHolder.sol";
import "./IAssetList.sol";

/**
@@ -155,7 +156,7 @@
// Set asset info
numAssets = uint8(config.assetConfigs.length);

assetList = IAssetListFactory(IAssetListFactory(extensionDelegate).assetListFactory()).createAssetList(config.assetConfigs);
assetList = IAssetListFactory(IAssetListFactoryHolder(extensionDelegate).assetListFactory()).createAssetList(config.assetConfigs);
}

/**
@@ -175,12 +176,12 @@
function nonReentrantBefore() internal {
bytes32 slot = REENTRANCY_GUARD_FLAG_SLOT;
uint256 status;
assembly ("memory-safe") {

Check warning on line 179 in contracts/CometExtendedAssetList.sol

GitHub Actions / Contract linter

Avoid to use inline assembly. It is acceptable only in rare cases
status := sload(slot)
}

if (status == REENTRANCY_GUARD_ENTERED) revert ReentrantCallBlocked();
assembly ("memory-safe") {

Check warning on line 184 in contracts/CometExtendedAssetList.sol

GitHub Actions / Contract linter

Avoid to use inline assembly. It is acceptable only in rare cases
sstore(slot, REENTRANCY_GUARD_ENTERED)
}
}
@@ -190,8 +191,8 @@
*/
function nonReentrantAfter() internal {
bytes32 slot = REENTRANCY_GUARD_FLAG_SLOT;
uint256 status;

Check warning on line 194 in contracts/CometExtendedAssetList.sol

GitHub Actions / Contract linter

Variable "status" is unused
assembly ("memory-safe") {

Check warning on line 195 in contracts/CometExtendedAssetList.sol

GitHub Actions / Contract linter

Avoid to use inline assembly. It is acceptable only in rare cases
sstore(slot, REENTRANCY_GUARD_NOT_ENTERED)
}
}
@@ -634,7 +635,7 @@
uint256 preTransferBalance = IERC20NonStandard(asset).balanceOf(address(this));
IERC20NonStandard(asset).transferFrom(from, address(this), amount);
bool success;
assembly ("memory-safe") {

Check warning on line 638 in contracts/CometExtendedAssetList.sol

GitHub Actions / Contract linter

Avoid to use inline assembly. It is acceptable only in rare cases
switch returndatasize()
case 0 { // This is a non-standard ERC-20
success := not(0) // set success to true
@@ -658,7 +659,7 @@
function doTransferOut(address asset, address to, uint amount) internal {
IERC20NonStandard(asset).transfer(to, amount);
bool success;
assembly ("memory-safe") {

Check warning on line 662 in contracts/CometExtendedAssetList.sol

GitHub Actions / Contract linter

Avoid to use inline assembly. It is acceptable only in rare cases
switch returndatasize()
case 0 { // This is a non-standard ERC-20
success := not(0) // set success to true
@@ -1007,9 +1008,9 @@

uint startGas = gasleft();
accrueInternal();
for (uint i = 0; i < accounts.length; ) {

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.array-length-outside-loop Note

Caching the array length outside a loop saves reading it on each iteration, as long as the array's length is not changed during the loop.
absorbInternal(absorber, accounts[i]);
unchecked { i++; }

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.use-prefix-increment-not-postfix Note

Consider using the prefix increment expression whenever the return value is not needed.
The prefix increment expression is cheaper in terms of gas.
}
uint gasUsed = startGas - gasleft();

@@ -1018,7 +1019,7 @@
// Using gas price instead of base fee would more accurately reflect spend,
// but is also subject to abuse if refunds were to be given automatically.
LiquidatorPoints memory points = liquidatorPoints[absorber];
points.numAbsorbs++;

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.use-prefix-increment-not-postfix Note

Consider using the prefix increment expression whenever the return value is not needed.
The prefix increment expression is cheaper in terms of gas.
points.numAbsorbed += safe64(accounts.length);
points.approxSpend += safe128(gasUsed * block.basefee);
liquidatorPoints[absorber] = points;
@@ -1036,7 +1037,7 @@
uint16 assetsIn = accountUser.assetsIn;

uint256 basePrice = getPrice(baseTokenPriceFeed);
uint256 deltaValue = 0;

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.init-variables-with-default-value Note

Uninitialized variables are assigned with the types default value.
Explicitly initializing a variable with its default value costs unnecessary gas.

for (uint8 i = 0; i < numAssets; ) {
if (isInAsset(assetsIn, i)) {
@@ -1051,7 +1052,7 @@

emit AbsorbCollateral(absorber, account, asset, seizeAmount, value);
}
unchecked { i++; }

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.use-prefix-increment-not-postfix Note

Consider using the prefix increment expression whenever the return value is not needed.
The prefix increment expression is cheaper in terms of gas.
}

uint256 deltaBalance = divPrice(deltaValue, basePrice, uint64(baseScale));
@@ -1095,7 +1096,7 @@
if (isBuyPaused()) revert Paused();

int reserves = getReserves();
if (reserves >= 0 && uint(reserves) >= targetReserves) revert NotForSale();

Check notice

Code scanning / Semgrep OSS

Semgrep Finding: rules.solidity.performance.use-nested-if Note

Using nested is cheaper than using && multiple check combinations.
There are more advantages, such as easier to read code and better coverage reports.

// Note: Re-entrancy can skip the reserves check above on a second buyCollateral call.
baseAmount = doTransferIn(baseToken, msg.sender, baseAmount);
@@ -1211,9 +1212,9 @@
/**
* @notice Fallback to calling the extension delegate for everything else
*/
fallback() external payable {

Check warning on line 1215 in contracts/CometExtendedAssetList.sol

GitHub Actions / Contract linter

Fallback function must be simple
address delegate = extensionDelegate;
assembly {

Check warning on line 1217 in contracts/CometExtendedAssetList.sol

GitHub Actions / Contract linter

Avoid to use inline assembly. It is acceptable only in rare cases
calldatacopy(0, 0, calldatasize())
let result := delegatecall(gas(), delegate, 0, calldatasize(), 0, 0)
returndatacopy(0, 0, returndatasize())
2 changes: 0 additions & 2 deletions contracts/IAssetListFactory.sol
Original file line number Diff line number Diff line change
@@ -8,6 +8,4 @@ import "./CometCore.sol";
*/
interface IAssetListFactory {
function createAssetList(CometCore.AssetConfig[] memory assetConfigs) external returns (address assetList);
// add it here to save space in Comet
function assetListFactory() external view returns (address);
}
10 changes: 10 additions & 0 deletions contracts/IAssetListFactoryHolder.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.15;

/**
* @title Compound's Asset List Factory Holder Interface
* @author Compound
*/
interface IAssetListFactoryHolder {
function assetListFactory() external view returns (address);
}
Original file line number Diff line number Diff line change
@@ -20,14 +20,28 @@ export default migration('1723198576_update_comet_to_support_more_collaterals',
'CometFactoryExtendedAssetList.sol',
[]
);
const {
comet
} = await deploymentManager.getContracts();

const extensionDelegate = new Contract(
await comet.extensionDelegate(),
[
'function name() external view returns (string)',
'function symbol() external view returns (string)',
],
deploymentManager.hre.ethers.provider
);
const name = await extensionDelegate.name();
const symbol = await extensionDelegate.symbol();

const _newCometExt = await deploymentManager.deploy(
'CometExt',
'CometExt.sol',
'CometExtAssetList',
'CometExtAssetList.sol',
[
{
name32: ethers.utils.formatBytes32String('Compound WETH'),
symbol32: ethers.utils.formatBytes32String('cWETHv3')
name32: ethers.utils.formatBytes32String(name),
symbol32: ethers.utils.formatBytes32String(symbol)
},
_assetListFactory.address
]
4 changes: 1 addition & 3 deletions src/deploy/Network.ts
Original file line number Diff line number Diff line change
@@ -119,8 +119,6 @@ export async function deployNetworkComet(
rewardTokenAddress
} = await getConfiguration(deploymentManager, configOverrides);

const assetListFactory = await deploymentManager.deploy('assetListFactory', 'AssetListFactory.sol', [], maybeForce());

/* Deploy contracts */

const cometAdmin = await deploymentManager.deploy(
@@ -137,7 +135,7 @@ export async function deployNetworkComet(
const cometExt = await deploymentManager.deploy(
'comet:implementation:implementation',
'CometExt.sol',
[extConfiguration, assetListFactory.address],
[extConfiguration],
maybeForce(deploySpec.cometExt)
);

10 changes: 8 additions & 2 deletions test/asset-info-test-asset-list-comet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { expect, exp, makeConfigurator, ONE } from './helpers';
import { SimplePriceFeed__factory, FaucetToken__factory, CometExt__factory, CometExtendedAssetList__factory, AssetListFactory__factory } from '../build/types';
import {
SimplePriceFeed__factory,
FaucetToken__factory,
CometExtAssetList__factory,
CometExtendedAssetList__factory,
AssetListFactory__factory
} from '../build/types';

import { ethers } from 'hardhat';
describe('asset info', function () {
@@ -105,7 +111,7 @@ describe('asset info', function () {
const assetListFactory = await AssetListFactory.deploy();
await assetListFactory.deployed();

const CometExtFactory = (await ethers.getContractFactory('CometExt')) as CometExt__factory;
const CometExtFactory = (await ethers.getContractFactory('CometExtAssetList')) as CometExtAssetList__factory;
const extensionDelegate = await CometExtFactory.deploy({ name32, symbol32 }, assetListFactory.address);
await extensionDelegate.deployed();

7 changes: 1 addition & 6 deletions test/constructor-test.ts
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ import {
CometHarness__factory,
FaucetToken__factory,
SimplePriceFeed__factory,
AssetListFactory__factory,
} from '../build/types';

describe('constructor', function () {
@@ -17,16 +16,12 @@ describe('constructor', function () {

it('verifies asset scales', async function () {
const [governor, pauseGuardian] = await ethers.getSigners();
const AssetListFactory = (await ethers.getContractFactory('AssetListFactory')) as AssetListFactory__factory;
const assetListFactory = await AssetListFactory.deploy();
await assetListFactory.deployed();

// extension delegate
const CometExtFactory = (await ethers.getContractFactory('CometExt')) as CometExt__factory;
const extensionDelegate = await CometExtFactory.deploy({
name32: ethers.utils.formatBytes32String('Compound Comet'),
symbol32: ethers.utils.formatBytes32String('📈BASE'),
}, assetListFactory.address);
});
await extensionDelegate.deployed();

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

let extensionDelegate = opts.extensionDelegate;
if (extensionDelegate === undefined) {
const CometExtFactory = (await ethers.getContractFactory('CometExt')) as CometExt__factory;
const CometExtFactory = (await ethers.getContractFactory('CometExtAssetList')) as CometExtAssetList__factory;
extensionDelegate = await CometExtFactory.deploy({ name32, symbol32 }, assetListFactory.address);
await extensionDelegate.deployed();
}
6 changes: 1 addition & 5 deletions test/liquidation/makeLiquidatableProtocol.ts
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@ import {
CometHarness__factory,
CometHarnessInterface,
OnChainLiquidator__factory,
AssetListFactory__factory,
} from '../../build/types';
import {
BALANCER_VAULT,
@@ -52,15 +51,12 @@ export enum Exchange {
}

export async function makeProtocol() {
const AssetListFactory = (await ethers.getContractFactory('AssetListFactory')) as AssetListFactory__factory;
const assetListFactory = await AssetListFactory.deploy();
await assetListFactory.deployed();

// build Comet
const CometExtFactory = (await ethers.getContractFactory('CometExt')) as CometExt__factory;
const name32 = ethers.utils.formatBytes32String('Compound Comet');
const symbol32 = ethers.utils.formatBytes32String('📈BASE');
const extensionDelegate = await CometExtFactory.deploy({ name32, symbol32 }, assetListFactory.address);
const extensionDelegate = await CometExtFactory.deploy({ name32, symbol32 });
await extensionDelegate.deployed();

const CometFactory = (await ethers.getContractFactory('CometHarness')) as CometHarness__factory;
8 changes: 4 additions & 4 deletions test/tracking-index-bounds-test.ts
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ describe('total tracking index bounds', function () {
totalSupplyBase: BigNumber.from(baseMinForRewards), // 10k USDC base units
});

await fastForward(secondsUntilOverflow-1);
await fastForward(secondsUntilOverflow-2);

// First accrue is successful without overflow
await comet.accrue();
@@ -58,7 +58,7 @@ describe('total tracking index bounds', function () {
totalBorrowBase: BigNumber.from(baseMinForRewards), // 10k USDC base units
});

await fastForward(secondsUntilOverflow-1);
await fastForward(secondsUntilOverflow-2);

// First accrue is successful without overflow
await comet.accrue();
@@ -153,7 +153,7 @@ describe('total tracking index bounds', function () {
totalSupplyBase: BigNumber.from(baseMinForRewards), // 100 WETH base units
});

await fastForward(secondsUntilOverflow-1);
await fastForward(secondsUntilOverflow-2);

// First accrue is successful without overflow
await comet.accrue();
@@ -186,7 +186,7 @@ describe('total tracking index bounds', function () {
totalBorrowBase: BigNumber.from(baseMinForRewards), // 10k USDC base units
});

await fastForward(secondsUntilOverflow-1);
await fastForward(secondsUntilOverflow-2);

// First accrue is successful without overflow
await comet.accrue();
Loading