forked from amis-erc20/bZx-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
7_deploy_BZRxTokenConvert.js
55 lines (42 loc) · 1.76 KB
/
7_deploy_BZRxTokenConvert.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
var BZRxTokenConvert = artifacts.require("BZRxTokenConvert");
var BZRxToken = artifacts.require("BZRxToken");
//var BZRxTransferProxy = artifacts.require("BZRxTransferProxy");
var BZxProxy = artifacts.require("BZxProxy");
var BZxProxySettings = artifacts.require("BZxProxySettings");
var BZxVault = artifacts.require("BZxVault");
//var BZxEther = artifacts.require("BZxEther");
var config = require("../protocol-config.js");
const path = require("path");
module.exports = (deployer, network, accounts) => {
var bzrx_token_address, weth_token_address;
if (network == "development" || network == "develop" || network == "testnet" || network == "coverage") {
network = "development";
bzrx_token_address = BZRxToken.address
weth_token_address = config["addresses"]["development"]["ZeroEx"]["WETH9"]; //BZxEther.address;
} else {
bzrx_token_address = config["addresses"][network]["BZRXToken"];
weth_token_address = config["addresses"][network]["ZeroEx"]["WETH9"];
}
deployer.then(async () => {
await deployer.deploy(
BZRxTokenConvert,
bzrx_token_address,
BZxVault.address,
weth_token_address,
"0"
);
var bZRxToken = await BZRxToken.at(bzrx_token_address);
/*if (network == "development") {
await deployer.deploy(
BZRxTransferProxy,
bzrx_token_address
);
await bZRxToken.addMinter(BZRxTransferProxy.address);
}*/
await bZRxToken.addMinter(BZRxTokenConvert.address);
// bZx Proxy uses BZRxTokenConvert contract as BZRX token until the tokensale ends
var bZxProxy = await BZxProxySettings.at(BZxProxy.address);
await bZxProxy.setBZRxToken(BZRxTokenConvert.address);
console.log(` > [${parseInt(path.basename(__filename))}] BZx deploy/setup: #done`);
});
};