From 7a5d076e33ef3b51e3926e13cc5557400eb0482b Mon Sep 17 00:00:00 2001 From: owen05 Date: Mon, 30 Aug 2021 19:26:06 +0800 Subject: [PATCH] update arb contract info --- config/arb-config.js | 63 ++++---- config/eth-config.js | 4 + config/matic-config.js | 2 +- migrations/2_deploy_v2.js | 296 ++++++++++++++++++++++++++++--------- migrations/5_deploy_nft.js | 2 +- truffle-config.js | 18 ++- 6 files changed, 278 insertions(+), 107 deletions(-) diff --git a/config/arb-config.js b/config/arb-config.js index 201c395..1ea55b0 100644 --- a/config/arb-config.js +++ b/config/arb-config.js @@ -1,63 +1,70 @@ module.exports = { ARB_CONFIG: { + //DODOV1 + //DODO: 0xe33c4f54212E6690E923c39aB6fB9eC9E36c7735, + //DODOZoo: 0xBcC3401E16C25EaF4d3FeD632ce3288503883B1f + //TOKEN WETH: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", CHI: "0x0000000000000000000000000000000000000000", DODO: "0x69Eb4FA4a2fbd498C257C57Ea8b7655a2559A581", //Helper - DODOSellHelper: "0x18AA6Bb215CDBd179E7beAE10F66C21B26971306", + DODOSellHelper: "0xA5F36E822540eFD11FcD77ec46626b916B217c3e", DODOCalleeHelper: "0xe3B40F8D8346d428EAB28d9Fd672b784d921cfBD", DODOV1PmmHelper: "0x4EE6398898F7FC3e648b3f6bA458310ac29cD352", - DODOV2RouteHelper: "0xd72b354BD39f8F11D0cA07bD5724896Bb1a42707", - CurveSample: "", + DODOV2RouteHelper: "0xBE24a05a317ED701630EE503F0C59A01e4B0c88C", + ERC20Helper: "0x7C062B9C584fA6eC2504270790D38240A2c5fE72", + DODOSwapCalcHelper: "0xd7863Aee0B7A312F2c055B441253d66AFac8d144", + MultiCall: "0xF718F2bd590E5621e53f7b89398e52f7Acced8ca", + CurveSample: "0x17307DA6c27BeAaDCcC1C7Ca7456cA1fBa10b9CF", //Template CloneFactory: "0x1ddD02f6d31C1eF04cFA0a1AA811406B5B2884E7", - FeeRateModel: "0xD56281EF996B6B29874C77D2e1464216E8043127", - PermissionManager: "0x61b21603A527b487C4a3A80a69224b87751D0F6a", + FeeRateModel: "0x668E7f4d8051511279d3BD6d6854e7D39cc94873", + FeeRateDIP3: "0xc6DE76f82a3456D75212a454E83B37659886e190", + PermissionManager: "0xb8132c7112aAf11fed09c7218AD2fcB42Da84773", DVM: "0x790B4A80Fb1094589A3c0eFC8740aA9b0C1733fB", - DPP: "0x1565666CD77bB6DDE193e1D37Ad7b07900e6f4c0", - DSP: "0x778DF5B12170e8af8dF94356BfC864E57CE185DC", - + DPP: "0xFF83897590Ac2f48aDFdEb9f497fe68A34B893C0", + DSP: "0xD0751f77d36aDaBA0067a151a8cF11475880c874", DPPAdmin: "0x1dc8D1f1600B7C1D39e6b60FBC7b021Bc4F9C993", - CP: "0xF7345452fE13A516974d2DdA279dE55DE5D11Ea2", + CP: "0xC39EE45A98d16D4587bB60596a22973b5d71AA3a", + ERC20MineV2: "0xe91067189C71dB0696bD6fBC14535CB159F98b5C", ERC20MineV3: "0x973CAB76C35BB1da47e044A63546c69A8Ac1143c", ERC20: "0xBb245F54569841906eC7eDFFf72a910557B81378", - MintableERC20: "0x70eFB31271C0796833f80dA4E6538d05B2AFA72C", CustomERC20: "0xcE2a934933465E187c95AcAce60BC650a06aD373", //Factory - DVMFactory: "0xb0C7cB15b52b0093130487209e96CFeC0Ba4Ff66", - DPPFactory: "0xF0B4338E3e3dfE9B6934FD68697ba8cF1055A1aD", - DSPFactory: "0xa1254eE5c6d6616904A82c55C6e134557096B6D4", - UpCpFactory: "0x69f52AC40185A2A005D49114F0B77b7bA856F0a0", - CrowdPoolingFactory: "0x884E3EE9e25896c57E7d8d6FAACef22B02BCD6bE", - ERC20Factory: "0x141b4497a298340E8B451ac4eeE947B00aDbe07A", - ERC20V2Factory: "0xE3c91fDCe30DD5Aa95138D6c4d63f43a26e9066e", - DODOMineV3Registry: "0xf6585FE94f2147682723FCdFFb973757BCdB608F", + DVMFactory: "0xDa4c4411c55B0785e501332354A036c04833B72b", + DPPFactory: "0xDdB13e6dd168E1a68DC2285Cb212078ae10394A9", + DSPFactory: "0xC8fE2440744dcd733246a4dB14093664DEFD5A53", + UpCpFactory: "0xE92787F457F541a9D5Ae17C1dbdBffA8D3BA3C25", + CrowdPoolingFactory: "0x6E5f239f729c83E976a7A280F81Dd1685dd89218", + ERC20V2Factory: "0x750B153E6a69DCA16eb12D5aEdDFD80ca3f10d1C", + DODOMineV2Factory: "0x5a2E2278A0fACcf224cEd1ce809eC4e4b1708759", + DODOMineV3Registry: "0x2B40bC6c9C12c18787436aa1E2B761f684F42999", //Approve - DODOApprove: "0xCDFD45f965De9932367833Ca7187e4c9C43A2380", - DODOApproveProxy: "0x0fe261aeE0d1C4DFdDee4102E82Dd425999065F4", + DODOApprove: "0xA867241cDC8d3b0C07C85cC06F25a0cD3b5474d8", + DODOApproveProxy: "0x311E670c3305a0BD55184c1C6580eBeA1FA611F0", //Adapter DODOV1Adapter: "0xd5a7E197bacE1F3B26E2760321d6ce06Ad07281a", DODOV2Adapter: "0x8aB2D334cE64B50BE9Ab04184f7ccBa2A6bb6391", UniAdapter: "0x17eBC315760Bb47384224A5f3BF829222fbD3Aa7", - CurveAdapter: "", + CurveAdapter: "0x57a046AC05185ba2AbdD3C480567A35bd1Ac9711", //Proxy - DODOV2Proxy: "0xeCEaDe494FD5F913Fd937C5CAc4577236395Dc32", - DSPProxy: "0x3a343F2e4e142412c5dD130359edb765a6054965", - CpProxy: "0x2cD18557E14aF72DAA8090BcAA95b231ffC9ea26", - RouteProxy: "0x3E64F18168651d140AaE57e0cF325874d066bA9E", - DODOMineV3Proxy: "0x579D25c519de3235aeD83A277E67c6420d9Fd1bE", + DODOV2Proxy: "0x88CBf433471A0CD8240D2a12354362988b4593E5", + DSPProxy: "0x36E5238B4479d1ba0bFE47550B0B8e4f4f500EAA", + CpProxy: "0x074890524059905096caA0D1A7B5715C6203c155", + RouteProxy: "0x3B6067D4CAa8A14c63fdBE6318F27A0bBc9F9237", + DODOMineV3Proxy: "0x9A74B169798bE874EF1C23b4092e5689969eF45E", //Account - multiSigAddress: "0x1e0D4043C0CD3ed15F3c2AfE60B0F213c9b5E30d", - defaultMaintainer: "0x1e0D4043C0CD3ed15F3c2AfE60B0F213c9b5E30d", + multiSigAddress: "0x01d3E7271c278Aa3AA56EeBa6a109b2C200679fA", + defaultMaintainer: "0x01d3E7271c278Aa3AA56EeBa6a109b2C200679fA" } } \ No newline at end of file diff --git a/config/eth-config.js b/config/eth-config.js index 6651c8e..bec8abe 100644 --- a/config/eth-config.js +++ b/config/eth-config.js @@ -65,5 +65,9 @@ module.exports = { //Account multiSigAddress: "0x95C4F5b83aA70810D4f142d58e5F7242Bd891CB0", defaultMaintainer: "0x95C4F5b83aA70810D4f142d58e5F7242Bd891CB0", + + + //============= NFT ================ + DodoNftErc721: "0x945497d9A3e0C1600478e466E2a38Ff8E1623E55", } } \ No newline at end of file diff --git a/config/matic-config.js b/config/matic-config.js index 2ce516d..ab02568 100644 --- a/config/matic-config.js +++ b/config/matic-config.js @@ -22,7 +22,7 @@ module.exports = { DSP: "0xbe9a66e49503e84ae59a4d0545365AABedf33b40", DPPAdmin: "0xB5Dc5E183c2aCf02aB879A8569aB4EDAf147d537", - CP: "0xf50BDc9E90B7a1c138cb7935071b85c417C4cb8e", + CP: "0x4BFa49b0a0B6B08D3D82b8AB45feC0c737880155", ERC20MineV3: "0xda59427Bd9d4827Ec9f751719eb79b0a3e74FA4D", ERC20: "0x34b9Dc29AaDc313F2BF828B7Be1e0DEe393D28e3", MintableERC20: "0x7737fd30535c69545deeEa54AB8Dd590ccaEBD3c", diff --git a/migrations/2_deploy_v2.js b/migrations/2_deploy_v2.js index cfa87ef..c03e309 100644 --- a/migrations/2_deploy_v2.js +++ b/migrations/2_deploy_v2.js @@ -6,33 +6,42 @@ const { GetConfig } = require("../configAdapter.js") const CloneFactory = artifacts.require("CloneFactory"); const FeeRateModelTemplate = artifacts.require("FeeRateModel"); +const FeeRateDIP3 = artifacts.require("FeeRateDIP3Impl"); const PermissionManagerTemplate = artifacts.require("PermissionManager"); const DODOSellHelper = artifacts.require("DODOSellHelper"); -const DODOCalleeHelper = artifacts.require("DODOCalleeHelper"); const DODOV1PmmHelper = artifacts.require("DODOV1PmmHelper"); const DODOV2RouteHelper = artifacts.require("DODOV2RouteHelper"); +const DODOSwapCalcHelper = artifacts.require("DODOSwapCalcHelper"); +const ERC20Helper = artifacts.require("ERC20Helper"); +const MultiCall = artifacts.require("Multicall"); +const DODOCalleeHelper = artifacts.require("DODOCalleeHelper"); const DvmTemplate = artifacts.require("DVM"); -const DppTemplate = artifacts.require("DPP"); const DspTemplate = artifacts.require("DSP"); +const DppTemplate = artifacts.require("DPP"); const DppAdminTemplate = artifacts.require("DPPAdmin"); const CpTemplate = artifacts.require("CP"); - const ERC20Template = artifacts.require("InitializableERC20"); -const MintableERC20Template = artifacts.require("InitializableMintableERC20"); -const ERC20Factory = artifacts.require("ERC20Factory"); +const CustomERC20Template = artifacts.require("CustomERC20"); +const ERC20MineV2 = artifacts.require("ERC20Mine"); +const ERC20MineV3 = artifacts.require("ERC20MineV3"); +const ERC20V2Factory = artifacts.require("ERC20V2Factory"); const DvmFactory = artifacts.require("DVMFactory"); const DppFactory = artifacts.require("DPPFactory"); const DspFactory = artifacts.require("DSPFactory"); const CpFactory = artifacts.require("CrowdPoolingFactory"); const UpCpFactory = artifacts.require("UpCrowdPoolingFactory"); +const MineV3Registry = artifacts.require("DODOMineV3Registry"); +const MineV2Factory = artifacts.require("DODOMineV2Factory"); const DODOApprove = artifacts.require("DODOApprove"); const DODOApproveProxy = artifacts.require("DODOApproveProxy"); const DODODspProxy = artifacts.require("DODODspProxy"); const DODOCpProxy = artifacts.require("DODOCpProxy"); +const DODORouteProxy = artifacts.require("DODORouteProxy"); +const DODOMineV3Proxy = artifacts.require("DODOMineV3Proxy"); const DODOProxyV2 = artifacts.require("DODOV2Proxy02"); const DODOV1Adapter = artifacts.require("DODOV1Adapter"); @@ -51,10 +60,14 @@ module.exports = async (deployer, network, accounts) => { let DODOCalleeHelperAddress = CONFIG.DODOCalleeHelper; let DODORouteV2HelperAddress = CONFIG.DODOV2RouteHelper; let DODOV1PmmHelperAddress = CONFIG.DODOV1PmmHelper; + let DODOSwapCalcHelperAddress = CONFIG.DODOSwapCalcHelper; + let ERC20HelperAddress = CONFIG.ERC20Helper; + let MultiCallAddress = CONFIG.MultiCall; //Template let CloneFactoryAddress = CONFIG.CloneFactory; let DefaultMtFeeRateAddress = CONFIG.FeeRateModel; + let FeeRateDIP3Address = CONFIG.FeeRateDIP3; let DefaultPermissionAddress = CONFIG.PermissionManager; let DvmTemplateAddress = CONFIG.DVM; let DspTemplateAddress = CONFIG.DSP; @@ -62,7 +75,9 @@ module.exports = async (deployer, network, accounts) => { let DppAdminTemplateAddress = CONFIG.DPPAdmin; let CpTemplateAddress = CONFIG.CP; let ERC20TemplateAddress = CONFIG.ERC20; - let MintableERC20TemplateAddress = CONFIG.MintableERC20; + let CustomERC20TemplateAddress = CONFIG.CustomERC20; + let MineV2TemplateAddress = CONFIG.ERC20MineV2; + let MineV3TemplateAddress = CONFIG.ERC20MineV3; //Facotry let DvmFactoryAddress = CONFIG.DVMFactory; @@ -70,31 +85,32 @@ module.exports = async (deployer, network, accounts) => { let DppFactoryAddress = CONFIG.DPPFactory; let CpFactoryAddress = CONFIG.CrowdPoolingFactory; let UpCpFactoryAddress = CONFIG.UpCpFactory; - let ERC20FactoryAddress = CONFIG.ERC20Factory; + let ERC20V2FactoryAddress = CONFIG.ERC20V2Factory; + let DODOMineV3RegistryAddress = CONFIG.DODOMineV3Registry; + let DODOMineV2FactoryAddress = CONFIG.DODOMineV2Factory; //Approve let DODOApproveAddress = CONFIG.DODOApprove; let DODOApproveProxyAddress = CONFIG.DODOApproveProxy; + //Adapter + let DODOV1AdpaterAddress = CONFIG.DODOV1Adapter; + let DODOV2AdapterAddress = CONFIG.DODOV2Adapter; + let UniAdapterAddress = CONFIG.UniAdapter; + + //Proxy + let DODOV2ProxyAddress = CONFIG.DODOV2Proxy; + let DODODspProxyAddress = CONFIG.DSPProxy; + let DODOCpProxyAddress = CONFIG.CpProxy; + let DODOMineV3ProxyAddress = CONFIG.DODOMineV3Proxy; + let DODORouteProxyAddress = CONFIG.RouteProxy; + + //Account let multiSigAddress = CONFIG.multiSigAddress; let defaultMaintainer = CONFIG.defaultMaintainer; - if (deploySwitch.ADAPTER) { - logger.log("===================================================="); - logger.log("network type: " + network); - logger.log("Deploy time: " + new Date().toLocaleString()); - logger.log("Deploy type: V2 - Adapter"); - - await deployer.deploy(DODOV1Adapter, DODOSellHelperAddress) - logger.log("DODOV1Adapter Address: ", DODOV1Adapter.address); - await deployer.deploy(DODOV2Adapter) - logger.log("DODOV2Adapter Address: ", DODOV2Adapter.address); - await deployer.deploy(UniAdapter) - logger.log("UniAdapter Address: ", UniAdapter.address); - } - if (deploySwitch.DEPLOY_V2) { logger.log("===================================================="); logger.log("network type: " + network); @@ -103,11 +119,28 @@ module.exports = async (deployer, network, accounts) => { logger.log("multiSigAddress: ", multiSigAddress) //Helper + if (MultiCallAddress == "") { + await deployer.deploy(MultiCall); + MultiCallAddress = MultiCall.address; + logger.log("MultiCallAddress: ", MultiCallAddress); + } + if (DODOSellHelperAddress == "") { await deployer.deploy(DODOSellHelper); DODOSellHelperAddress = DODOSellHelper.address; logger.log("DODOSellHelper Address: ", DODOSellHelperAddress); } + + if (DODOSwapCalcHelperAddress == "") { + await deployer.deploy(DODOSwapCalcHelper, DODOSellHelperAddress); + logger.log("DODOSwapCalcHelper Address: ", DODOSwapCalcHelper.address); + } + + if (ERC20HelperAddress == "") { + await deployer.deploy(ERC20Helper); + logger.log("ERC20Helper Address: ", ERC20Helper.address); + } + if (DODOCalleeHelperAddress == "") { await deployer.deploy(DODOCalleeHelper, WETHAddress); DODOCalleeHelperAddress = DODOCalleeHelper.address; @@ -136,6 +169,15 @@ module.exports = async (deployer, network, accounts) => { logger.log("Init DefaultMtFeeRateAddress Tx:", tx.tx); } + if (FeeRateDIP3Address == "") { + await deployer.deploy(FeeRateDIP3); + FeeRateDIP3Address = FeeRateDIP3.address; + logger.log("FeeRateDIP3 Address: ", FeeRateDIP3Address); + const feeRateDIP3Instance = await FeeRateDIP3.at(FeeRateDIP3Address); + var tx = await feeRateDIP3Instance.initOwner(multiSigAddress); + logger.log("Init FeeRateDIP3 Tx:", tx.tx); + } + if (DefaultPermissionAddress == "") { await deployer.deploy(PermissionManagerTemplate); DefaultPermissionAddress = PermissionManagerTemplate.address; @@ -168,6 +210,7 @@ module.exports = async (deployer, network, accounts) => { DppAdminTemplateAddress = DppAdminTemplate.address; logger.log("DppAdminTemplateAddress: ", DppAdminTemplateAddress); } + if (CpTemplateAddress == "") { await deployer.deploy(CpTemplate); CpTemplateAddress = CpTemplate.address; @@ -179,23 +222,26 @@ module.exports = async (deployer, network, accounts) => { ERC20TemplateAddress = ERC20Template.address; logger.log("ERC20TemplateAddress: ", ERC20TemplateAddress); } - if (MintableERC20TemplateAddress == "") { - await deployer.deploy(MintableERC20Template); - MintableERC20TemplateAddress = MintableERC20Template.address; - logger.log("MintableERC20TemplateAddress: ", MintableERC20TemplateAddress); + + if (CustomERC20TemplateAddress == "") { + await deployer.deploy(CustomERC20Template); + CustomERC20TemplateAddress = CustomERC20Template.address; + logger.log("CustomERC20TemplateAddress: ", CustomERC20TemplateAddress); } - if (ERC20FactoryAddress == "") { - await deployer.deploy( - ERC20Factory, - CloneFactoryAddress, - ERC20TemplateAddress, - MintableERC20TemplateAddress - ); - ERC20FactoryAddress = ERC20Factory.address; - logger.log("ERC20FactoryAddress: ", ERC20FactoryAddress); + if (MineV2TemplateAddress == "") { + await deployer.deploy(ERC20MineV2); + MineV2TemplateAddress = ERC20MineV2.address; + logger.log("MineV2TemplateAddress: ", MineV2TemplateAddress); } + if (MineV3TemplateAddress == "") { + await deployer.deploy(ERC20MineV3); + MineV3TemplateAddress = ERC20MineV3.address; + logger.log("MineV3TemplateAddress: ", MineV3TemplateAddress); + } + + //Approve if (DODOApproveAddress == "") { await deployer.deploy(DODOApprove); @@ -209,7 +255,22 @@ module.exports = async (deployer, network, accounts) => { logger.log("DODOApproveProxy Address: ", DODOApproveProxyAddress); } + //Factory + if (ERC20V2FactoryAddress == "") { + await deployer.deploy( + ERC20V2Factory, + CloneFactoryAddress, + ERC20TemplateAddress, + CustomERC20TemplateAddress + ); + ERC20V2FactoryAddress = ERC20V2Factory.address; + logger.log("ERC20V2FactoryAddress: ", ERC20V2FactoryAddress); + const ERC20V2FactoryInstance = await ERC20V2Factory.at(ERC20V2FactoryAddress); + var tx = await ERC20V2FactoryInstance.initOwner(multiSigAddress); + logger.log("Init ERC20V2Factory Tx:", tx.tx); + } + if (DvmFactoryAddress == "") { await deployer.deploy( DvmFactory, @@ -252,8 +313,8 @@ module.exports = async (deployer, network, accounts) => { DefaultMtFeeRateAddress, DefaultPermissionAddress ); - logger.log("UpCrowdPoolingFactory address: ", UpCpFactory.address); UpCpFactoryAddress = UpCpFactory.address; + logger.log("UpCrowdPoolingFactory address: ", UpCpFactory.address); const UpCpFactoryInstance = await UpCpFactory.at(UpCpFactory.address); var tx = await UpCpFactoryInstance.initOwner(multiSigAddress); logger.log("Init UpCpFactory Tx:", tx.tx); @@ -291,56 +352,149 @@ module.exports = async (deployer, network, accounts) => { logger.log("Init DspFactory Tx:", tx.tx); } + if (DODOMineV2FactoryAddress == "") { + await deployer.deploy( + MineV2Factory, + CloneFactoryAddress, + MineV2TemplateAddress, + defaultMaintainer + ); + DODOMineV2FactoryAddress = MineV2Factory.address; + logger.log("DODOMineV2FactoryAddress: ", DODOMineV2FactoryAddress); + } + + if (DODOMineV3RegistryAddress == "") { + await deployer.deploy(MineV3Registry); + DODOMineV3RegistryAddress = MineV3Registry.address; + logger.log("DODOMineV3RegistryAddress: ", DODOMineV3RegistryAddress); + + const dodoMineV3RegistryInstance = await MineV3Registry.at(DODOMineV3RegistryAddress); + var tx = await dodoMineV3RegistryInstance.initOwner(multiSigAddress); + logger.log("Init DODOMineV3Registry Tx:", tx.tx); + } + if (DODORouteV2HelperAddress == "") { await deployer.deploy(DODOV2RouteHelper, DvmFactoryAddress, DppFactoryAddress, DspFactoryAddress); DODOV2RouteHelperAddress = DODOV2RouteHelper.address; logger.log("DODOV2RouteHelper Address: ", DODOV2RouteHelperAddress); } + //Adapter + if (DODOV1AdpaterAddress == "") { + await deployer.deploy(DODOV1Adapter, DODOSellHelperAddress); + logger.log("DODOV1Adapter Address: ", DODOV1Adapter.address); + } + if (DODOV2AdapterAddress == "") { + await deployer.deploy(DODOV2Adapter) + logger.log("DODOV2Adapter Address: ", DODOV2Adapter.address); + } + if (UniAdapterAddress == "") { + await deployer.deploy(UniAdapter) + logger.log("UniAdapter Address: ", UniAdapter.address); + } + + //Proxy - await deployer.deploy( - DODODspProxy, - DspFactoryAddress, - WETHAddress, - DODOApproveProxyAddress - ); - logger.log("DODODspProxy Address: ", DODODspProxy.address); + if (DODOV2ProxyAddress == "") { + await deployer.deploy( + DODOProxyV2, + DvmFactoryAddress, + DppFactoryAddress, + WETHAddress, + DODOApproveProxyAddress, + DODOSellHelperAddress + ); + await deployer.deploy( + DODOProxyV2 + ); + DODOV2ProxyAddress = DODOProxyV2.address; + logger.log("DODOV2Proxy02 Address: ", DODOProxyV2.address); + const DODOProxyV2Instance = await DODOProxyV2.at(DODOProxyV2.address); + var tx = await DODOProxyV2Instance.initOwner(multiSigAddress); + logger.log("Init DODOProxyV2 Tx:", tx.tx); + } + + if (DODODspProxyAddress == "") { + await deployer.deploy( + DODODspProxy, + DspFactoryAddress, + WETHAddress, + DODOApproveProxyAddress + ); + DODODspProxyAddress = DODODspProxy.address; + logger.log("DODODspProxy Address: ", DODODspProxy.address); + } + + if (DODOCpProxyAddress == "") { + await deployer.deploy( + DODOCpProxy, + WETHAddress, + CpFactoryAddress, + UpCpFactoryAddress, + DODOApproveProxyAddress + ); + DODOCpProxyAddress = DODOCpProxy.address; + logger.log("CpProxy address: ", DODOCpProxy.address); + } + + if (DODOMineV3ProxyAddress == "") { + await deployer.deploy( + DODOMineV3Proxy, + CloneFactoryAddress, + MineV3TemplateAddress, + DODOApproveProxyAddress, + DODOMineV3RegistryAddress + ); + DODOMineV3ProxyAddress = DODOMineV3Proxy.address; + logger.log("DODOMineV3ProxyAddress: ", DODOMineV3ProxyAddress); + + const dodoMineV3ProxyInstance = await DODOMineV3Proxy.at(DODOMineV3ProxyAddress); + var tx = await dodoMineV3ProxyInstance.initOwner(multiSigAddress); + logger.log("Init DODOMineV3Proxy Tx:", tx.tx); + } + + if (DODORouteProxyAddress == "") { + await deployer.deploy( + DODORouteProxy, + WETHAddress, + DODOApproveProxyAddress + ); + DODOApproveProxyAddress = DODORouteProxy.address; + logger.log("DODORouteProxy Address: ", DODORouteProxy.address); + } - await deployer.deploy( - DODOCpProxy, - WETHAddress, - CpFactoryAddress, - UpCpFactoryAddress, - DODOApproveProxyAddress - ); - logger.log("CpProxy address: ", DODOCpProxy.address); - - - await deployer.deploy( - DODOProxyV2, - DvmFactoryAddress, - DppFactoryAddress, - WETHAddress, - DODOApproveProxyAddress, - DODOSellHelperAddress - ); - logger.log("DODOV2Proxy02 Address: ", DODOProxyV2.address); - const DODOProxyV2Instance = await DODOProxyV2.at(DODOProxyV2.address); - var tx = await DODOProxyV2Instance.initOwner(multiSigAddress); - logger.log("Init DODOProxyV2 Tx:", tx.tx); - - - if (network == 'kovan' || network == 'mbtestnet' || network == 'oktest' || network == 'matic' || network == 'arb' || network == 'rinkeby') { - + if (network == 'kovan' || network == 'rinkeby') { + var tx; + //ApproveProxy init以及添加ProxyList const DODOApproveProxyInstance = await DODOApproveProxy.at(DODOApproveProxyAddress); - var tx = await DODOApproveProxyInstance.init(multiSigAddress, [DODOProxyV2.address, DODOCpProxy.address, DODODspProxy.address]); + tx = await DODOApproveProxyInstance.init(multiSigAddress, [DODOV2ProxyAddress, DODODspProxyAddress, DODOCpProxyAddress, DODOMineV3ProxyAddress, DODORouteProxyAddress]); logger.log("DODOApproveProxy Init tx: ", tx.tx); - + //Approve init const DODOApproveInstance = await DODOApprove.at(DODOApproveAddress); - var tx = await DODOApproveInstance.init(multiSigAddress, DODOApproveProxy.address); + tx = await DODOApproveInstance.init(multiSigAddress, DODOApproveProxy.address); logger.log("DODOApprove Init tx: ", tx.tx); + + //Set FeeRateDIP3 + const FeeRateModelInstance = await FeeRateModel.at(DefaultMtFeeRateAddress); + tx = await FeeRateModelInstance.setProxy(FeeRateDIP3Address); + logger.log("Set FeeRateDIP3 tx: ", tx.tx); + + //ERC20V2Factory 设置fee + const ERC20V2FactoryInstance = await ERC20V2Factory.at(ERC20V2FactoryAddress); + tx = await ERC20V2FactoryInstance.changeCreateFee("100000000000000000"); + logger.log("Set ERC20V2 fee tx: ", tx.tx); + + //DODOMineV2Factory 设置个人账户为owner + const dodoMineV2FactoryInstance = await DODOMineV2Factory.at(DODOMineV2FactoryAddress); + var tx = await dodoMineV2FactoryInstance.initOwner(multiSigAddress); + logger.log("Init DODOMineV2Factory Tx:", tx.tx); + + //DODOMineV3Registry add Proxy as admin + const dodoMineV3RegistryInstance = await DODOMineV3Registry.at(DODOMineV3RegistryAddress); + var tx = await dodoMineV3RegistryInstance.addAdminList(DODOMineV3ProxyAddress); + logger.log("DODOMineV3RegistryAddress Init tx: ", tx.tx); } } diff --git a/migrations/5_deploy_nft.js b/migrations/5_deploy_nft.js index 9ca8af8..c87cf37 100644 --- a/migrations/5_deploy_nft.js +++ b/migrations/5_deploy_nft.js @@ -97,7 +97,7 @@ module.exports = async (deployer, network, accounts) => { logger.log("DodoNftErc721Address: ", DodoNftErc721Address); const DodoNftErc721Instance = await DodoNftErc721.at(DodoNftErc721Address); var tx = await DodoNftErc721Instance.init( - multiSigAddress, + "0x16CC37d06FE5061CD0023fb8d142ABaAbB396A2b", "DODONFT", "DODONFT" ); diff --git a/truffle-config.js b/truffle-config.js index a1bb0c2..82eb608 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -41,7 +41,6 @@ module.exports = { deploySwitch: { DEPLOY_V1: false, DEPLOY_V2: false, - ADAPTER: false, MOCK_TOKEN: false, MOCK_V2_POOL: false, vDODOToken: false, @@ -111,7 +110,7 @@ module.exports = { return new HDWalletProvider(privKey, "https://mainnet.infura.io/v3/" + infuraId); }, gas: 6000000, - gasPrice: 25000000000, + gasPrice: 150000000000, network_id: 1, skipDryRun: true }, @@ -193,13 +192,20 @@ module.exports = { }, arb: { + networkCheckTimeout: 100000, + // provider: function () { + // return wrapProvider( + // new HDWalletProvider(privKey, "https://arb1.arbitrum.io/rpc") + // // new HDWalletProvider(privKey, 'https://arbitrum-mainnet.infura.io/v3/' + infuraId) + // ) + // }, provider: function () { - return wrapProvider( - new HDWalletProvider(privKey, "https://arb1.arbitrum.io/rpc") - ) + return new HDWalletProvider(privKey, "https://arb1.arbitrum.io/rpc") }, network_id: '42161', - gasPrice: 400000000, + gas: 1200000, + gasPrice: 900000000, + skipDryRun: true }, matic: {