Skip to content

Commit

Permalink
feat: add migration
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriy-woof-software committed Jun 9, 2024
1 parent 9874c6b commit 22ad8a1
Show file tree
Hide file tree
Showing 5 changed files with 453 additions and 0 deletions.
74 changes: 74 additions & 0 deletions deployments/arbitrum/usdt/configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"name": "Compound USDT",
"symbol": "cUSDTv3",
"baseToken": "USDT",
"baseTokenAddress": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
"baseTokenPriceFeed": "0x3f3f5dF88dC9F13eac63DF89EC16ef6e7E25DdE7",
"borrowMin": "1e0",
"pauseGuardian": "0x78E6317DD6D43DdbDa00Dce32C2CbaFc99361a9d",
"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": "10000e6"
},
"assets": {
"ARB": {
"address": "0x912ce59144191c1204e64559fe8253a0e49e6548",
"priceFeed": "0xb2A824043730FE05F3DA2efaFa1CBbe83fa548D6",
"decimals": "18",
"borrowCF": 0.7,
"liquidateCF": 0.8,
"liquidationFactor": 0.9,
"supplyCap": "0e18"
},
"WETH": {
"address": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
"priceFeed": "0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612",
"decimals": "18",
"borrowCF": 0.78,
"liquidateCF": 0.85,
"liquidationFactor": 0.95,
"supplyCap": "0e18"
},
"wstETH": {
"address": "0x5979D7b546E38E414F7E9822514be443A4800529",
"priceFeed": "0xb523AE262D20A936BC152e6023996e46FDC2A95D",
"decimals": "18",
"borrowCF": 0.7,
"liquidateCF": 0.8,
"liquidationFactor": 0.9,
"supplyCap": "0e18"
},
"WBTC": {
"address": "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f",
"priceFeed": "0xd0C7101eACbB49F3deCcCc166d238410D6D46d57",
"decimals": "8",
"borrowCF": 0.7,
"liquidateCF": 0.8,
"liquidationFactor": 0.9,
"supplyCap": "0e8"
},
"GMX": {
"address": "0xfc5a1a6eb076a2c7ad06ed22c90d7e710e35ad0a",
"priceFeed": "0xDB98056FecFff59D032aB628337A4887110df3dB",
"decimals": "18",
"borrowCF": 0.6,
"liquidateCF": 0.7,
"liquidationFactor": 0.8,
"supplyCap": "0e18"
}
}
}
37 changes: 37 additions & 0 deletions deployments/arbitrum/usdt/deploy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Deployed, DeploymentManager } from '../../../plugins/deployment_manager';
import { DeploySpec, deployComet } from '../../../src/deploy';

export default async function deploy(deploymentManager: DeploymentManager, deploySpec: DeploySpec): Promise<Deployed> {
const trace = deploymentManager.tracer()
const ethers = deploymentManager.hre.ethers;

// pull in existing assets
// USDC native
const WETH = await deploymentManager.existing('WETH', '0x82af49447d8a07e3bd95bd0d56f35241523fbab1', 'arbitrum');
const WBTC = await deploymentManager.existing('WBTC', '0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f', 'arbitrum');
//wstETH
const wstETH = await deploymentManager.existing('wstETH', '0x5979D7b546E38E414F7E9822514be443A4800529', 'arbitrum');
const USDT = await deploymentManager.existing('USDT', '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9', 'arbitrum');
const ARB = await deploymentManager.existing('ARB', '0x912ce59144191c1204e64559fe8253a0e49e6548', 'arbitrum');
const GMX = await deploymentManager.existing('GMX', '0xfc5a1a6eb076a2c7ad06ed22c90d7e710e35ad0a', 'arbitrum');

// Import shared contracts from the USDC.e market
const cometAdmin = await deploymentManager.fromDep('cometAdmin', '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');
// should use this bulker, not MainnetBulker
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,
};
}
Loading

0 comments on commit 22ad8a1

Please sign in to comment.