Skip to content

Commit

Permalink
deploy to bsc and polygon
Browse files Browse the repository at this point in the history
  • Loading branch information
traceurl committed Dec 8, 2023
1 parent 8a9fbb0 commit d3215a9
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
7 changes: 7 additions & 0 deletions config/bsc-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,21 @@ 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",
D3UserQuota: "0x67119E13FE9D9c5aCE5ab882bE5D5a35402209DC",
D3PoolQuota: "0xE3C6a9C1fCF1091b45901222Eba0849ab551248E",
D3MMTemplate: "0xf592B231A92c53d9039b23b5ae280c895BD2DB32",
D3MakerTemplate: "0x2252033E2cE653e652E23CD88207016706F0d308",
D3MMNoBorrowTemplate: "0x769cF285e0b3609CE82830634654Ab19ce963062",
D3MakerFreeSlotTemplate: "0xAa82c20D7c5c11b4a29419939ECbab3579043aB4",
D3TokenTemplate: "0x132c4945090f98c56689D0E4509B1801C02f3c80",
CloneFactory: "0x03E2427859119E497EB856a166F616a2Ce5f8c88",
Maintainer: "0xf12A8888f6c8448aAf5D7968359a1Cc827E44cEF",
Expand All @@ -30,6 +35,8 @@ const BSC_CONFIG = {
ETH_USD: "0x9ef1B8c0E4F7dc8bF5719Ea496883DC6401d5b2e",
BNB_USD: "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE",
USDT_USD: "0xB97Ad0E74fa7d920791E90258A6E2085088b4320",
USDC_USD: "0x51597f405303C4377E36123cBc172b13269EA163",
CAKE_USD: "0xB6064eD41d4f67e353768aA239cA86f4F73665a1",
},
};

Expand Down
2 changes: 2 additions & 0 deletions config/polygon-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const POLYGON_CONFIG = {
D3PoolQuota: "0x27f5021961C731abD6849a91e58Aa6cb3e42C03A",
D3MMTemplate: "0x5168a07e121554E8417C181e32f49e66EAC88e19",
D3MakerTemplate: "0x3B8B82441b907947e88Ef92473A4FDa06224b618",
D3MMNoBorrowTemplate: "0x6019C1596679eDE8828Cc65b35951E9638726E19",
D3MakerFreeSlotTemplate: "0xBAf350b14ed48429A7772F7D05B2CFc6620744D9",
D3TokenTemplate: "0x6990254C0Dcae91e2FD93C493D33570cDaBC3dC6",
CloneFactory: "0x729f7f44bf64Ce814716b6261e267DbE6cdf021c",
Maintainer: "0x3CD6D7F5fF977bf8069548eA1F9441b061162b42",
Expand Down
2 changes: 1 addition & 1 deletion contracts/DODOV3MM/D3PoolNoBorrow/D3MMNoBorrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion contracts/DODOV3MM/D3PoolNoBorrow/D3MakerFreeSlot.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
22 changes: 22 additions & 0 deletions deploy/bsc/000_deploy_contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit d3215a9

Please sign in to comment.