Skip to content

Commit

Permalink
Sepolia-Base cWETHv3 Deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
ajb413 committed Mar 27, 2024
1 parent 2d0f500 commit 6c31c3c
Show file tree
Hide file tree
Showing 5 changed files with 161 additions and 1 deletion.
38 changes: 38 additions & 0 deletions deployments/base-sepolia/weth/configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "Compound WETH",
"symbol": "cWETHv3",
"baseToken": "WETH",
"baseTokenAddress": "0x4200000000000000000000000000000000000006",
"baseTokenPriceFeed": "",
"pauseGuardian": "0x6106DA3AcFdEB341808f4DC3D2483eC67c98E728",
"borrowMin": "1e0",
"storeFrontPriceFactor": 1,
"targetReserves": "5000e18",
"rates": {
"supplyKink": 0.9,
"supplySlopeLow": 0.0283824,
"supplySlopeHigh": 0.6066567706,
"supplyBase": 0,
"borrowKink": 0.9,
"borrowSlopeLow": 0.037,
"borrowSlopeHigh": 0.5171500339,
"borrowBase": 0.009945209674
},
"tracking": {
"indexScale": "1e15",
"baseSupplySpeed": "231_481_481_481e0",
"baseBorrowSpeed": "0e15",
"baseMinForRewards": "100e18"
},
"rewardToken": "COMP",
"assets": {
"cbETH": {
"address": "0x7c6b91D9Be155A6Db01f749217d76fF02A7227F2",
"decimals": "18",
"borrowCF": 0.90,
"liquidateCF": 0.93,
"liquidationFactor": 0.975,
"supplyCap": "7500e18"
}
}
}
70 changes: 70 additions & 0 deletions deployments/base-sepolia/weth/deploy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import { Deployed, DeploymentManager } from '../../../plugins/deployment_manager';
import { DeploySpec, deployComet, exp } from '../../../src/deploy';

export default async function deploy(deploymentManager: DeploymentManager, deploySpec: DeploySpec): Promise<Deployed> {
const deployed = await deployContracts(deploymentManager, deploySpec);
return deployed;
}

async function deployContracts(
deploymentManager: DeploymentManager,
deploySpec: DeploySpec
): Promise<Deployed> {
const trace = deploymentManager.tracer();

// Deploy constant price feed for WETH
const wethConstantPriceFeed = await deploymentManager.deploy(
'WETH:priceFeed',
'pricefeeds/ConstantPriceFeed.sol',
[
8, // decimals
exp(1, 8) // constantPrice
]
);

// Deploy scaling price feed for cbETH
// XXX There is no cbETH / ETH pricefeed on testnet. Remember to change this for mainnet.
// const cbETHScalingPriceFeed = await deploymentManager.deploy(
// 'cbETH:priceFeed',
// 'ScalingPriceFeed.sol',
// [
// '0xcD2A119bD1F7DF95d706DE6F2057fDD45A0503E2', // cbETH / ETH price feed
// 8 // decimals
// ]
// );
const cbETHConstantPriceFeed = await deploymentManager.deploy(
'cbETH:priceFeed',
'pricefeeds/ConstantPriceFeed.sol',
[
8, // decimals
exp(1, 8) // constantPrice
]
);

// Import shared contracts from cUSDCv3
const cometAdmin = await deploymentManager.fromDep('cometAdmin', 'base-sepolia', 'usdc');
const cometFactory = await deploymentManager.fromDep('cometFactory', 'base-sepolia', 'usdc');
const $configuratorImpl = await deploymentManager.fromDep('configurator:implementation', 'base-sepolia', 'usdc');
const configurator = await deploymentManager.fromDep('configurator', 'base-sepolia', 'usdc');
const rewards = await deploymentManager.fromDep('rewards', 'base-sepolia', 'usdc');
const bulker = await deploymentManager.fromDep('bulker', 'base-sepolia', 'usdc');
const fauceteer = await deploymentManager.fromDep('fauceteer', 'base-sepolia', 'usdc');
const l2CrossDomainMessenger = await deploymentManager.fromDep('l2CrossDomainMessenger', 'base-sepolia', 'usdc');
const l2StandardBridge = await deploymentManager.fromDep('l2StandardBridge', 'base-sepolia', 'usdc');
const localTimelock = await deploymentManager.fromDep('timelock', 'base-sepolia', 'usdc');
const bridgeReceiver = await deploymentManager.fromDep('bridgeReceiver', 'base-sepolia', 'usdc');

// Deploy Comet
const deployed = await deployComet(deploymentManager, deploySpec);

// XXX We will need to deploy a new bulker only if need to support wstETH

return {
...deployed,
bridgeReceiver,
l2CrossDomainMessenger,
l2StandardBridge,
bulker,
fauceteer
};
}
34 changes: 34 additions & 0 deletions deployments/base-sepolia/weth/relations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import baseRelationConfig from '../../relations';

export default {
...baseRelationConfig,
governor: {
artifact: 'contracts/bridges/optimism/OptimismBridgeReceiver.sol:OptimismBridgeReceiver'
},

// cbETH
'0x774ed9edb0c5202df9a86183804b5d9e99dc6ca3': {
artifact: 'contracts/ERC20.sol:ERC20',
},

// COMP
'0x2f535da74048c0874400f0371fba20df983a56e2': {
artifact: 'contracts/ERC20.sol:ERC20',
},

l2CrossDomainMessenger: {
delegates: {
field: {
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc'
}
}
},

l2StandardBridge: {
delegates: {
field: {
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc'
}
}
}
};
10 changes: 10 additions & 0 deletions deployments/base-sepolia/weth/roots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"comet": "0x571621Ce60Cebb0c1D442B5afb38B1663C6Bf017",
"configurator": "0x090a2b1fc84d0b5141d5D5608b12Db19201aE5a6",
"rewards": "0x3394fa1baCC0b47dd0fF28C8573a476a161aF7BC",
"bridgeReceiver": "0x80c116493DB619560e3380D0fF195e749D8857D7",
"l2CrossDomainMessenger": "0x4200000000000000000000000000000000000007",
"l2StandardBridge": "0x4200000000000000000000000000000000000010",
"bulker": "0x7D25b2AecF07B5CB87B05e17Aa5cecbA8BCfDBD1",
"fauceteer": "0xD76cB57d8B097B80a6eE4D1b4d5ef872bfBa6051"
}
10 changes: 9 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import baseWethRelationConfigMap from './deployments/base/weth/relations';
import baseUsdcRelationConfigMap from './deployments/base/usdc/relations';
import baseGoerliRelationConfigMap from './deployments/base-goerli/usdc/relations';
import baseSepoliaRelationConfigMap from './deployments/base-sepolia/usdc/relations';
import baseSepoliaWethRelationConfigMap from './deployments/base-sepolia/weth/relations';
import baseGoerliWethRelationConfigMap from './deployments/base-goerli/weth/relations';
import lineaGoerliRelationConfigMap from './deployments/linea-goerli/usdc/relations';

Expand Down Expand Up @@ -343,7 +344,8 @@ const config: HardhatUserConfig = {
weth: baseGoerliWethRelationConfigMap
},
'base-sepolia': {
usdc: baseSepoliaRelationConfigMap
usdc: baseSepoliaRelationConfigMap,
weth: baseSepoliaWethRelationConfigMap
},
'linea-goerli': {
usdc: lineaGoerliRelationConfigMap
Expand Down Expand Up @@ -466,6 +468,12 @@ const config: HardhatUserConfig = {
deployment: 'usdc',
auxiliaryBase: 'sepolia-usdc'
},
{
name: 'base-sepolia-weth',
network: 'base-sepolia',
deployment: 'weth',
auxiliaryBase: 'sepolia-weth'
},
{
name: 'linea-goerli',
network: 'linea-goerli',
Expand Down

0 comments on commit 6c31c3c

Please sign in to comment.