From d3215a96a363e0b34bfa095e213e15966e7559d4 Mon Sep 17 00:00:00 2001 From: traceurl <25892474+traceurl@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:03:26 +0800 Subject: [PATCH] deploy to bsc and polygon --- config/bsc-config.ts | 7 ++++++ config/polygon-config.ts | 2 ++ .../DODOV3MM/D3PoolNoBorrow/D3MMNoBorrow.sol | 2 +- .../D3PoolNoBorrow/D3MakerFreeSlot.sol | 2 +- deploy/bsc/000_deploy_contracts.ts | 22 +++++++++++++++++++ 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/config/bsc-config.ts b/config/bsc-config.ts index 3fb468d..f7c8452 100644 --- a/config/bsc-config.ts +++ b/config/bsc-config.ts @@ -7,9 +7,12 @@ const BSC_CONFIG = { BTCB: "0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c", // decimals 18 ETH: "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", USDT: "0x55d398326f99059fF775485246999027B3197955", // decimals 18 + USDC: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", // decimals 18 + CAKE: "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82", }, deployedAddress: { D3Oracle: "0x829Ea84E6bfc67821971C0E1B55981efcE6A7550", + // D3Oracle: "0x6d1da78C87C76f340dC36Ef96A925f3FB4b0a165", // no borrow version D3RateManager: "0xE43A0452C9f701A465Ece610e1f300D73088F29A", D3MMLiquidationRouter: "0x30352E6d2BD3D29D2151E4750CC96B1bEE4c2114", D3Vault: "0x3f4eF3763E0b6edB2b3237e29BD7e23Bd168bD46", @@ -17,6 +20,8 @@ const BSC_CONFIG = { D3PoolQuota: "0xE3C6a9C1fCF1091b45901222Eba0849ab551248E", D3MMTemplate: "0xf592B231A92c53d9039b23b5ae280c895BD2DB32", D3MakerTemplate: "0x2252033E2cE653e652E23CD88207016706F0d308", + D3MMNoBorrowTemplate: "0x769cF285e0b3609CE82830634654Ab19ce963062", + D3MakerFreeSlotTemplate: "0xAa82c20D7c5c11b4a29419939ECbab3579043aB4", D3TokenTemplate: "0x132c4945090f98c56689D0E4509B1801C02f3c80", CloneFactory: "0x03E2427859119E497EB856a166F616a2Ce5f8c88", Maintainer: "0xf12A8888f6c8448aAf5D7968359a1Cc827E44cEF", @@ -30,6 +35,8 @@ const BSC_CONFIG = { ETH_USD: "0x9ef1B8c0E4F7dc8bF5719Ea496883DC6401d5b2e", BNB_USD: "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE", USDT_USD: "0xB97Ad0E74fa7d920791E90258A6E2085088b4320", + USDC_USD: "0x51597f405303C4377E36123cBc172b13269EA163", + CAKE_USD: "0xB6064eD41d4f67e353768aA239cA86f4F73665a1", }, }; diff --git a/config/polygon-config.ts b/config/polygon-config.ts index 4fdba33..d6ef6b8 100644 --- a/config/polygon-config.ts +++ b/config/polygon-config.ts @@ -20,6 +20,8 @@ const POLYGON_CONFIG = { D3PoolQuota: "0x27f5021961C731abD6849a91e58Aa6cb3e42C03A", D3MMTemplate: "0x5168a07e121554E8417C181e32f49e66EAC88e19", D3MakerTemplate: "0x3B8B82441b907947e88Ef92473A4FDa06224b618", + D3MMNoBorrowTemplate: "0x6019C1596679eDE8828Cc65b35951E9638726E19", + D3MakerFreeSlotTemplate: "0xBAf350b14ed48429A7772F7D05B2CFc6620744D9", D3TokenTemplate: "0x6990254C0Dcae91e2FD93C493D33570cDaBC3dC6", CloneFactory: "0x729f7f44bf64Ce814716b6261e267DbE6cdf021c", Maintainer: "0x3CD6D7F5fF977bf8069548eA1F9441b061162b42", diff --git a/contracts/DODOV3MM/D3PoolNoBorrow/D3MMNoBorrow.sol b/contracts/DODOV3MM/D3PoolNoBorrow/D3MMNoBorrow.sol index 55c8b9c..a6c86db 100644 --- a/contracts/DODOV3MM/D3PoolNoBorrow/D3MMNoBorrow.sol +++ b/contracts/DODOV3MM/D3PoolNoBorrow/D3MMNoBorrow.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.16; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; -import {D3MM} from "../D3Pool/D3MM.sol"; +import {D3MM} from "D3Pool/D3MM.sol"; contract D3MMNoBorrow is D3MM { using SafeERC20 for IERC20; diff --git a/contracts/DODOV3MM/D3PoolNoBorrow/D3MakerFreeSlot.sol b/contracts/DODOV3MM/D3PoolNoBorrow/D3MakerFreeSlot.sol index dd00d8c..43d028d 100644 --- a/contracts/DODOV3MM/D3PoolNoBorrow/D3MakerFreeSlot.sol +++ b/contracts/DODOV3MM/D3PoolNoBorrow/D3MakerFreeSlot.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.16; import "../lib/MakerTypes.sol"; import "../lib/Errors.sol"; -import {D3Maker} from "../D3Pool/D3Maker.sol"; +import {D3Maker} from "D3Pool/D3Maker.sol"; /// @notice D3MakerFreeSlot is a special type of D3Maker, in which the market maker can set a new token info in an exsiting token slot, which can save gas contract D3MakerFreeSlot is D3Maker { diff --git a/deploy/bsc/000_deploy_contracts.ts b/deploy/bsc/000_deploy_contracts.ts index f88daea..d9aff71 100644 --- a/deploy/bsc/000_deploy_contracts.ts +++ b/deploy/bsc/000_deploy_contracts.ts @@ -108,6 +108,28 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { } console.log("setPriceSource for USDT...") await D3Oracle.setPriceSource(config.defaultAddress.USDT, priceSourceUSDT); + + const priceSourceUSDC = { + oracle: config.chainlinkPriceFeed.USDC_USD, + isWhitelisted: true, + priceTolerance: BigNumber.from(padZeros(9, 17)), + priceDecimal: 8, + tokenDecimal: 18, + heartBeat: 100000 + } + console.log("setPriceSource for USDC...") + await D3Oracle.setPriceSource(config.defaultAddress.USDC, priceSourceUSDC); + + const priceSourceCAKE = { + oracle: config.chainlinkPriceFeed.CAKE_USD, + isWhitelisted: true, + priceTolerance: BigNumber.from(padZeros(9, 17)), + priceDecimal: 8, + tokenDecimal: 18, + heartBeat: 100000 + } + console.log("setPriceSource for CAKE...") + await D3Oracle.setPriceSource(config.defaultAddress.CAKE, priceSourceCAKE); } }