From cbc6786ca59904c1492d8bb2a5cdc144333d9626 Mon Sep 17 00:00:00 2001 From: owen05 Date: Thu, 12 Nov 2020 09:43:38 +0800 Subject: [PATCH] migrations script --- deploy-detail.txt | 8 ++++++++ migrations/2_deploy.js | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 deploy-detail.txt diff --git a/deploy-detail.txt b/deploy-detail.txt new file mode 100644 index 0000000..c728994 --- /dev/null +++ b/deploy-detail.txt @@ -0,0 +1,8 @@ +==================================================== +network type: kovan +Deploy time: 2020/11/12 上午9:38:54 +Deploy type: Smart Route +SmartApprove Address: 0x8D2625d0f1ed3C7E1E506Bf86b4660c1781Fd7C0 +DODOSellHelper Address: 0xbdEae617F2616b45DCB69B287D52940a76035Fe3 +SmartSwap Address: 0xC1632dD29D5c4ac1Cd7b9B7d1e23E91bB092acAC +SmartApprovce setSmartSwap tx: 0x2e641cd363b3c42579308502dbca07e45377032fb52ae5f1acbd0d865d0ce7e3 diff --git a/migrations/2_deploy.js b/migrations/2_deploy.js index 63ed46d..c5949eb 100644 --- a/migrations/2_deploy.js +++ b/migrations/2_deploy.js @@ -1 +1,33 @@ -module.exports = async (deployer, network) => {}; +const fs = require('fs'); +const file = fs.createWriteStream('../deploy-detail.txt'); +let logger = new console.Console(file, file); + +const SmartApprove = artifacts.require("SmartApprove"); +const SmartSwap = artifacts.require("SmartSwap"); +const DODOSellHelper = artifacts.require("DODOSellHelper"); + +const DEPLOY_ROUTE = true; + +module.exports = async (deployer, network) => { + logger.log("===================================================="); + logger.log("network type: " + network); + logger.log("Deploy time: " + new Date().toLocaleString()); + + if (DEPLOY_ROUTE) { + logger.log("Deploy type: Smart Route"); + await deployer.deploy(SmartApprove); + await deployer.deploy(DODOSellHelper); + logger.log("SmartApprove Address: ",SmartApprove.address); + logger.log("DODOSellHelper Address: ",DODOSellHelper.address); + + await deployer.deploy(SmartSwap,SmartApprove.address,DODOSellHelper.address); + logger.log("SmartSwap Address: ",SmartSwap.address); + + const SmartApproveInstance = await SmartApprove.deployed(); + var tx = await SmartApproveInstance.setSmartSwap(SmartSwap.address); + logger.log("SmartApprovce setSmartSwap tx: ",tx.tx); + } +}; + + +