@fleupold/dex-contracts
Version:
Contracts for dFusion multi-token batch auction exchange
24 lines (23 loc) • 764 B
JavaScript
import { addTokens, getBatchExchange, getOwl } from "./util";
import { factory } from "../src/logging";
const log = factory.getLogger("scripts.add_token");
const argv = require("yargs")
.option("tokenAddress", {
describe: "Address of the token to be added",
})
.demand(["tokenAddress"])
.help(false)
.version(false).argv;
module.exports = async function (callback) {
try {
const [account] = await web3.eth.getAccounts();
log.info(`Using account ${account}`);
const batchExchange = await getBatchExchange(artifacts);
const owl = await getOwl(artifacts);
await addTokens([argv.tokenAddress], account, batchExchange, owl);
callback();
}
catch (error) {
callback(error);
}
};