fix
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,6 +4,7 @@
|
|||||||
.idea
|
.idea
|
||||||
|
|
||||||
build/
|
build/
|
||||||
|
build-v1/
|
||||||
dist/
|
dist/
|
||||||
node_modules/
|
node_modules/
|
||||||
coverage/
|
coverage/
|
||||||
|
|||||||
@@ -9,6 +9,13 @@ const DODOSellHelper = artifacts.require("DODOSellHelper");
|
|||||||
const DEPLOY_ROUTE = true;
|
const DEPLOY_ROUTE = true;
|
||||||
|
|
||||||
module.exports = async (deployer, network) => {
|
module.exports = async (deployer, network) => {
|
||||||
|
let DODOSellHelperAddress = ""
|
||||||
|
if(network == 'kovan'){
|
||||||
|
DODOSellHelperAddress = "0xbdEae617F2616b45DCB69B287D52940a76035Fe3";
|
||||||
|
}else {
|
||||||
|
DODOSellHelperAddress = "";
|
||||||
|
}
|
||||||
|
|
||||||
logger.log("====================================================");
|
logger.log("====================================================");
|
||||||
logger.log("network type: " + network);
|
logger.log("network type: " + network);
|
||||||
logger.log("Deploy time: " + new Date().toLocaleString());
|
logger.log("Deploy time: " + new Date().toLocaleString());
|
||||||
@@ -16,11 +23,14 @@ module.exports = async (deployer, network) => {
|
|||||||
if (DEPLOY_ROUTE) {
|
if (DEPLOY_ROUTE) {
|
||||||
logger.log("Deploy type: Smart Route");
|
logger.log("Deploy type: Smart Route");
|
||||||
await deployer.deploy(SmartApprove);
|
await deployer.deploy(SmartApprove);
|
||||||
await deployer.deploy(DODOSellHelper);
|
if(DODOSellHelperAddress == "") {
|
||||||
|
await deployer.deploy(DODOSellHelper);
|
||||||
|
DODOSellHelperAddress = DODOSellHelper.address;
|
||||||
|
}
|
||||||
logger.log("SmartApprove Address: ",SmartApprove.address);
|
logger.log("SmartApprove Address: ",SmartApprove.address);
|
||||||
logger.log("DODOSellHelper Address: ",DODOSellHelper.address);
|
logger.log("DODOSellHelper Address: ",DODOSellHelperAddress);
|
||||||
|
|
||||||
await deployer.deploy(SmartSwap,SmartApprove.address,DODOSellHelper.address);
|
await deployer.deploy(SmartSwap,SmartApprove.address,DODOSellHelperAddress);
|
||||||
logger.log("SmartSwap Address: ",SmartSwap.address);
|
logger.log("SmartSwap Address: ",SmartSwap.address);
|
||||||
|
|
||||||
const SmartApproveInstance = await SmartApprove.deployed();
|
const SmartApproveInstance = await SmartApprove.deployed();
|
||||||
|
|||||||
@@ -155,9 +155,7 @@ describe("Trader", () => {
|
|||||||
var pairs = [{
|
var pairs = [{
|
||||||
pair: ctx.DODO_USDT.options.address,
|
pair: ctx.DODO_USDT.options.address,
|
||||||
base: ctx.DODO.options.address,
|
base: ctx.DODO.options.address,
|
||||||
/*only for test*/
|
|
||||||
pairContract: ctx.DODO_USDT
|
pairContract: ctx.DODO_USDT
|
||||||
/**************/
|
|
||||||
}];
|
}];
|
||||||
|
|
||||||
var tx = await logGas(await calcRoute(ctx,decimalStr('10'),0.1,routes,pairs), ctx.sendParam(trader), "directly swap")
|
var tx = await logGas(await calcRoute(ctx,decimalStr('10'),0.1,routes,pairs), ctx.sendParam(trader), "directly swap")
|
||||||
@@ -193,15 +191,11 @@ describe("Trader", () => {
|
|||||||
var pairs = [{
|
var pairs = [{
|
||||||
pair: ctx.DODO_USDT.options.address,
|
pair: ctx.DODO_USDT.options.address,
|
||||||
base: ctx.DODO.options.address,
|
base: ctx.DODO.options.address,
|
||||||
/*only for test*/
|
|
||||||
pairContract: ctx.DODO_USDT
|
pairContract: ctx.DODO_USDT
|
||||||
/**************/
|
|
||||||
},{
|
},{
|
||||||
pair: ctx.USDT_USDC.options.address,
|
pair: ctx.USDT_USDC.options.address,
|
||||||
base: ctx.USDT.options.address,
|
base: ctx.USDT.options.address,
|
||||||
/*only for test*/
|
|
||||||
pairContract: ctx.USDT_USDC
|
pairContract: ctx.USDT_USDC
|
||||||
/**************/
|
|
||||||
}];
|
}];
|
||||||
|
|
||||||
var tx = await logGas(await calcRoute(ctx,decimalStr('10'),0.1,routes,pairs), ctx.sendParam(trader), "tow hops swap")
|
var tx = await logGas(await calcRoute(ctx,decimalStr('10'),0.1,routes,pairs), ctx.sendParam(trader), "tow hops swap")
|
||||||
@@ -240,21 +234,15 @@ describe("Trader", () => {
|
|||||||
var pairs = [{
|
var pairs = [{
|
||||||
pair: ctx.DODO_USDT.options.address,
|
pair: ctx.DODO_USDT.options.address,
|
||||||
base: ctx.DODO.options.address,
|
base: ctx.DODO.options.address,
|
||||||
/*only for test*/
|
|
||||||
pairContract: ctx.DODO_USDT
|
pairContract: ctx.DODO_USDT
|
||||||
/**************/
|
|
||||||
},{
|
},{
|
||||||
pair: ctx.USDT_USDC.options.address,
|
pair: ctx.USDT_USDC.options.address,
|
||||||
base: ctx.USDT.options.address,
|
base: ctx.USDT.options.address,
|
||||||
/*only for test*/
|
|
||||||
pairContract: ctx.USDT_USDC
|
pairContract: ctx.USDT_USDC
|
||||||
/**************/
|
|
||||||
},{
|
},{
|
||||||
pair: ctx.WETH_USDC.options.address,
|
pair: ctx.WETH_USDC.options.address,
|
||||||
base: ctx.WETH.options.address,
|
base: ctx.WETH.options.address,
|
||||||
/*only for test*/
|
|
||||||
pairContract: ctx.WETH_USDC
|
pairContract: ctx.WETH_USDC
|
||||||
/**************/
|
|
||||||
}];
|
}];
|
||||||
|
|
||||||
var tx = await logGas(await calcRoute(ctx,decimalStr('10'),0.1,routes,pairs), ctx.sendParam(trader), "three hops swap")
|
var tx = await logGas(await calcRoute(ctx,decimalStr('10'),0.1,routes,pairs), ctx.sendParam(trader), "three hops swap")
|
||||||
|
|||||||
Reference in New Issue
Block a user