Skip to content

Commit

Permalink
Merge branch 'compound-finance:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
peersky authored Jun 27, 2024
2 parents c93a584 + 854ec58 commit d73e876
Show file tree
Hide file tree
Showing 10 changed files with 559 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-scenarios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
bases: [ development, mainnet, mainnet-weth, goerli, goerli-weth, sepolia-usdc, sepolia-weth, fuji, mumbai, polygon, arbitrum-usdc.e, arbitrum-usdc, arbitrum-goerli-usdc, arbitrum-goerli-usdc.e, base-usdbc, base-weth, base-usdc, base-goerli, base-goerli-weth, linea-goerli, optimism-usdc, optimism-usdt, scroll-goerli, scroll-usdc]
bases: [ development, mainnet, mainnet-weth, goerli, goerli-weth, sepolia-usdc, sepolia-weth, fuji, mumbai, polygon, arbitrum-usdc.e, arbitrum-usdc, arbitrum-weth, arbitrum-goerli-usdc, arbitrum-goerli-usdc.e, base-usdbc, base-weth, base-usdc, base-goerli, base-goerli-weth, linea-goerli, optimism-usdc, optimism-usdt, scroll-goerli, scroll-usdc]
name: Run scenarios
env:
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
Expand Down
54 changes: 54 additions & 0 deletions deployments/arbitrum/weth/configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "Compound WETH",
"symbol": "cWETHv3",
"baseToken": "WETH",
"baseTokenAddress": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
"borrowMin": "0.1e18",
"governor": "0x3fB4d38ea7EC20D91917c09591490Eeda38Cf88A",
"pauseGuardian": "0x78E6317DD6D43DdbDa00Dce32C2CbaFc99361a9d",
"rewardTokenAddress": "0x354A6dA3fcde098F8389cad84b0182725c6C91dE",
"storeFrontPriceFactor": 0.7,
"targetReserves": "5000e18",
"rates": {
"supplyKink": 0.85,
"supplySlopeLow": 0.0185,
"supplySlopeHigh": 1,
"supplyBase": 0,
"borrowKink": 0.85,
"borrowSlopeLow": 0.014,
"borrowSlopeHigh": 1.15,
"borrowBase": 0.01
},
"tracking": {
"indexScale": "1e15",
"baseSupplySpeed": "69444444444e0",
"baseBorrowSpeed": "46296296296e0",
"baseMinForRewards": "1000e18"
},
"assets": {
"weETH": {
"address": "0x35751007a407ca6FEFfE80b3cB397736D2cf4dbe",
"decimals": "18",
"borrowCF": 0.82,
"liquidateCF": 0.87,
"liquidationFactor": 0.92,
"supplyCap": "550e18"
},
"rETH": {
"address": "0xEC70Dcb4A1EFa46b8F2D97C310C9c4790ba5ffA8",
"decimals": "18",
"borrowCF": 0.90,
"liquidateCF": 0.93,
"liquidationFactor": 0.97,
"supplyCap": "800e18"
},
"wstETH": {
"address": "0x5979D7b546E38E414F7E9822514be443A4800529",
"decimals": "18",
"borrowCF": 0.88,
"liquidateCF": 0.93,
"liquidationFactor": 0.97,
"supplyCap": "2000e18"
}
}
}
71 changes: 71 additions & 0 deletions deployments/arbitrum/weth/deploy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
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 WETH = await deploymentManager.existing('WETH', '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', 'arbitrum');
const rETH = await deploymentManager.existing('rETH', '0xEC70Dcb4A1EFa46b8F2D97C310C9c4790ba5ffA8', 'arbitrum');
const wstETH = await deploymentManager.existing('wstETH', '0x5979D7b546E38E414F7E9822514be443A4800529', 'arbitrum');
const COMP = await deploymentManager.existing('COMP', '0x354A6dA3fcde098F8389cad84b0182725c6C91dE', 'arbitrum');

// Deploy WstETHPriceFeed
const wstETHPriceFeed = await deploymentManager.deploy(
'wstETH:priceFeed',
'pricefeeds/ScalingPriceFeed.sol',
[
'0xb523AE262D20A936BC152e6023996e46FDC2A95D', // wstETH / ETH price feed
8 // decimals
]
);

// 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 rETH
const rETHScalingPriceFeed = await deploymentManager.deploy(
'rETH:priceFeed',
'pricefeeds/ScalingPriceFeed.sol',
[
'0xD6aB2298946840262FcC278fF31516D39fF611eF', // rETH / ETH price feed
8 // decimals
]
);

// Deploy scaling price feed for weETH
const weETHScalingPriceFeed = await deploymentManager.deploy(
'weETH:priceFeed',
'pricefeeds/ScalingPriceFeed.sol',
[
'0xE141425bc1594b8039De6390db1cDaf4397EA22b', // weETH / ETH price feed
8 // decimals
]
);

// Import shared contracts from cUSDCv3
const cometAdmin = await deploymentManager.fromDep('cometAdmin', 'arbitrum', 'usdc.e');
const cometFactory = await deploymentManager.fromDep('cometFactory', 'arbitrum', 'usdc.e');
const $configuratorImpl = await deploymentManager.fromDep('configurator:implementation', 'arbitrum', 'usdc.e');
const configurator = await deploymentManager.fromDep('configurator', 'arbitrum', 'usdc.e');
const rewards = await deploymentManager.fromDep('rewards', 'arbitrum', 'usdc.e');
const bulker = await deploymentManager.fromDep('bulker', 'arbitrum', 'usdc.e');
const localTimelock = await deploymentManager.fromDep('timelock', 'arbitrum', 'usdc.e');
const bridgeReceiver = await deploymentManager.fromDep('bridgeReceiver', 'arbitrum', 'usdc.e');


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

return {
...deployed,
bridgeReceiver,
bulker,
rewards,
COMP
};
}
Loading

0 comments on commit d73e876

Please sign in to comment.