Skip to content

Commit

Permalink
merge: merge main branch with op usdt deployment and resolve confilicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriy-woof-software committed Jun 22, 2024
2 parents cb82505 + caa66a3 commit 81e544b
Show file tree
Hide file tree
Showing 8 changed files with 500 additions and 3 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-weth, arbitrum-goerli-usdc, arbitrum-goerli-usdc.e, base-usdbc, base-weth, base-usdc, base-goerli, base-goerli-weth, linea-goerli, optimism-usdc, 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
57 changes: 57 additions & 0 deletions deployments/optimism/usdt/configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "Compound USDT",
"symbol": "cUSDTv3",
"baseToken": "USDT",
"baseTokenAddress": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",
"baseTokenPriceFeed": "0xECef79E109e997bCA29c1c0897ec9d7b03647F5E",
"pauseGuardian": "0x3fFd6c073a4ba24a113B18C8F373569640916A45",
"borrowMin": "1e5",
"storeFrontPriceFactor": 0.6,
"targetReserves": "20000000e6",
"rates": {
"supplyKink": 0.9,
"supplySlopeLow": 0.059,
"supplySlopeHigh": 2.9,
"supplyBase": 0,
"borrowKink": 0.9,
"borrowSlopeLow": 0.061,
"borrowSlopeHigh": 3.2,
"borrowBase": 0.015
},
"tracking": {
"indexScale": "1e15",
"baseSupplySpeed": "0e15",
"baseBorrowSpeed": "0e15",
"baseMinForRewards": "1000e6"
},
"assets": {
"OP": {
"address": "0x4200000000000000000000000000000000000042",
"priceFeed": "0x0D276FC14719f9292D5C1eA2198673d1f4269246",
"decimals": "18",
"borrowCF": 0.65,
"liquidateCF": 0.7,
"liquidationFactor": 0.8,
"supplyCap": "0e18"
},
"WETH": {
"address": "0x4200000000000000000000000000000000000006",
"priceFeed": "0x13e3Ee699D1909E989722E753853AE30b17e08c5",
"decimals": "18",
"borrowCF": 0.83,
"liquidateCF": 0.9,
"liquidationFactor": 0.95,
"supplyCap": "0e18"
},
"WBTC": {
"address": "0x68f180fcCe6836688e9084f035309E29Bf0A2095",
"priceFeed": "0x718A5788b89454aAE3A028AE9c111A29Be6c2a6F",
"decimals": "8",
"borrowCF": 0.8,
"liquidateCF": 0.85,
"liquidationFactor": 0.95,
"supplyCap": "0e8"
}
}
}

71 changes: 71 additions & 0 deletions deployments/optimism/usdt/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 } from '../../../src/deploy';

const HOUR = 60 * 60;
const DAY = 24 * HOUR;

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

const USDT = await deploymentManager.existing(
'USDT',
'0x94b008aA00579c1307B0EF2c499aD98a8ce58e58',
'optimism'
);
const WETH = await deploymentManager.existing(
'WETH',
'0x4200000000000000000000000000000000000006',
'optimism'
);
const WBTC = await deploymentManager.existing(
'WBTC',
'0x68f180fcCe6836688e9084f035309E29Bf0A2095',
'optimism'
);
const OP = await deploymentManager.existing(
'OP',
'0x4200000000000000000000000000000000000042',
'optimism'
);

const COMP = await deploymentManager.existing(
'COMP',
'0x7e7d4467112689329f7E06571eD0E8CbAd4910eE',
'optimism'
);

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

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

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

0 comments on commit 81e544b

Please sign in to comment.