From ab4b5b7c038d5177aba99697c6b2239fae28210f Mon Sep 17 00:00:00 2001 From: owen05 Date: Mon, 11 Jan 2021 10:19:21 +0800 Subject: [PATCH] update deployv1.5 && fix --- contracts/SmartRoute/DODOV1Proxy02.sol | 1 + migrations/2_deploy_v1.5.js | 18 +++++++++--------- truffle-config.js | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/contracts/SmartRoute/DODOV1Proxy02.sol b/contracts/SmartRoute/DODOV1Proxy02.sol index daadc81..03ab8af 100644 --- a/contracts/SmartRoute/DODOV1Proxy02.sol +++ b/contracts/SmartRoute/DODOV1Proxy02.sol @@ -97,6 +97,7 @@ contract DODOV1Proxy02 is IDODOV1Proxy02, InitializableOwnable { ) external override payable judgeExpired(deadLine) returns (uint256 returnAmount) { require(dodoPairs.length > 0, "DODOV1Proxy02: PAIRS_EMPTY"); require(minReturnAmount > 0, "DODOV1Proxy02: RETURN_AMOUNT_ZERO"); + require(fromToken != _CHI_TOKEN_, "DODOV1Proxy02: NOT_SUPPORT_SELL_CHI"); uint256 originGas = gasleft(); if (fromToken != _ETH_ADDRESS_) { diff --git a/migrations/2_deploy_v1.5.js b/migrations/2_deploy_v1.5.js index 703ef1b..a44aed8 100644 --- a/migrations/2_deploy_v1.5.js +++ b/migrations/2_deploy_v1.5.js @@ -4,7 +4,7 @@ const file = fs.createWriteStream("../deploy-detail-v1.5.txt", { 'flags': 'a' }) let logger = new console.Console(file, file); const DODOApprove = artifacts.require("DODOApprove"); -const DODOProxyV1 = artifacts.require("DODOV1Proxy01"); +const DODOProxyV2 = artifacts.require("DODOV1Proxy02"); const DODOSellHelper = artifacts.require("DODOSellHelper"); const DODOSwapCalcHelper = artifacts.require("DODOSwapCalcHelper"); @@ -62,20 +62,20 @@ module.exports = async (deployer, network, accounts) => { } await deployer.deploy( - DODOProxyV1, + DODOProxyV2, DODOApproveAddress, DODOSellHelperAddress, WETHAddress, chiAddress ); - logger.log("DODOProxyV1 Address: ", DODOProxyV1.address); - const DODOProxyV1Instance = await DODOProxyV1.at(DODOProxyV1.address); - tx = await DODOProxyV1Instance.initOwner(ownerAddress); - logger.log("Set DODOProxyV1 Owner tx: ", tx.tx); + logger.log("DODOProxyV2 Address: ", DODOProxyV2.address); + const DODOProxyV2Instance = await DODOProxyV2.at(DODOProxyV2.address); + tx = await DODOProxyV2Instance.initOwner(ownerAddress); + logger.log("Set DODOProxyV2 Owner tx: ", tx.tx); - const DODOApproveInstance = await DODOApprove.at(DODOApproveAddress); - tx = await DODOApproveInstance.init(ownerAddress, DODOProxyV1.address); - logger.log("Set DODOApprove Owner And Init Set Proxy tx: ", tx.tx); + // const DODOApproveInstance = await DODOApprove.at(DODOApproveAddress); + // tx = await DODOApproveInstance.init(ownerAddress, DODOProxyV1.address); + // logger.log("Set DODOApprove Owner And Init Set Proxy tx: ", tx.tx); // var tx1 = await DODOProxyV1Instance.addWhiteList("0x111111125434b319222cdbf8c261674adb56f3ae"); // var tx2 = await DODOProxyV1Instance.addWhiteList("0xdef1c0ded9bec7f1a1670819833240f027b25eff"); diff --git a/truffle-config.js b/truffle-config.js index 2416921..b6cab0f 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -38,7 +38,7 @@ module.exports = { * $ truffle test --network */ deploySwitch: { - DEPLOY_V1: false, + DEPLOY_V1: true, DEPLOY_V2: false, MOCK_TOKEN: false, MOCK_V2_POOL: false,