Fix indentations
This commit is contained in:
@@ -2,5 +2,5 @@ import {Artifacts} from '../util/artifacts';
|
||||
const {Migrations} = new Artifacts(artifacts);
|
||||
|
||||
module.exports = (deployer: any) => {
|
||||
deployer.deploy(Migrations);
|
||||
deployer.deploy(Migrations);
|
||||
};
|
||||
|
||||
@@ -1,43 +1,44 @@
|
||||
import {Artifacts} from '../util/artifacts';
|
||||
import {ContractInstance, MultiSigConfigByNetwork} from '../util/types';
|
||||
const {
|
||||
MultiSigWalletWithTimeLock,
|
||||
TokenTransferProxy,
|
||||
EtherToken,
|
||||
TokenRegistry,
|
||||
MultiSigWalletWithTimeLock,
|
||||
TokenTransferProxy,
|
||||
EtherToken,
|
||||
TokenRegistry,
|
||||
} = new Artifacts(artifacts);
|
||||
|
||||
let multiSigConfigByNetwork: MultiSigConfigByNetwork;
|
||||
try {
|
||||
/* tslint:disable */
|
||||
const multiSigConfig = require('./config/multisig');
|
||||
multiSigConfigByNetwork = multiSigConfig.multiSig;
|
||||
/* tslint:enable */
|
||||
/* tslint:disable */
|
||||
const multiSigConfig = require('./config/multisig');
|
||||
multiSigConfigByNetwork = multiSigConfig.multiSig;
|
||||
/* tslint:enable */
|
||||
} catch (e) {
|
||||
multiSigConfigByNetwork = {};
|
||||
multiSigConfigByNetwork = {};
|
||||
}
|
||||
|
||||
module.exports = (deployer: any, network: string, accounts: string[]) => {
|
||||
const defaultConfig = {
|
||||
owners: [accounts[0], accounts[1]],
|
||||
confirmationsRequired: 2,
|
||||
secondsRequired: 0,
|
||||
};
|
||||
const config = multiSigConfigByNetwork[network] || defaultConfig;
|
||||
if (network !== 'live') {
|
||||
deployer.deploy(MultiSigWalletWithTimeLock, config.owners, config.confirmationsRequired, config.secondsRequired)
|
||||
.then(() => {
|
||||
return deployer.deploy(TokenTransferProxy);
|
||||
}).then(() => {
|
||||
return deployer.deploy(TokenRegistry);
|
||||
}).then(() => {
|
||||
return deployer.deploy(EtherToken);
|
||||
});
|
||||
} else {
|
||||
deployer.deploy([
|
||||
[MultiSigWalletWithTimeLock, config.owners, config.confirmationsRequired, config.secondsRequired],
|
||||
TokenTransferProxy,
|
||||
TokenRegistry,
|
||||
]);
|
||||
}
|
||||
const defaultConfig = {
|
||||
owners: [accounts[0], accounts[1]],
|
||||
confirmationsRequired: 2,
|
||||
secondsRequired: 0,
|
||||
};
|
||||
const config = multiSigConfigByNetwork[network] || defaultConfig;
|
||||
if (network !== 'live') {
|
||||
deployer.deploy(MultiSigWalletWithTimeLock, config.owners,
|
||||
config.confirmationsRequired, config.secondsRequired)
|
||||
.then(() => {
|
||||
return deployer.deploy(TokenTransferProxy);
|
||||
}).then(() => {
|
||||
return deployer.deploy(TokenRegistry);
|
||||
}).then(() => {
|
||||
return deployer.deploy(EtherToken);
|
||||
});
|
||||
} else {
|
||||
deployer.deploy([
|
||||
[MultiSigWalletWithTimeLock, config.owners, config.confirmationsRequired, config.secondsRequired],
|
||||
TokenTransferProxy,
|
||||
TokenRegistry,
|
||||
]);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,80 +7,80 @@ import {ContractInstance, Token, TokenInfoByNetwork} from '../util/types';
|
||||
|
||||
import {tokenInfo} from './config/token_info';
|
||||
const {
|
||||
DummyToken,
|
||||
EtherToken,
|
||||
ZRXToken,
|
||||
TokenRegistry,
|
||||
DummyToken,
|
||||
EtherToken,
|
||||
ZRXToken,
|
||||
TokenRegistry,
|
||||
} = new Artifacts(artifacts);
|
||||
|
||||
module.exports = (deployer: any, network: string) => {
|
||||
const tokens = network === 'live' ? tokenInfo.live : tokenInfo.development;
|
||||
deployer.then(() => {
|
||||
return TokenRegistry.deployed();
|
||||
}).then((tokenRegistry: ContractInstance) => {
|
||||
if (network !== 'live') {
|
||||
const totalSupply = Math.pow(10, 18) * 1000000000;
|
||||
return Bluebird.each(tokens.map((token: Token) => DummyToken.new(
|
||||
token.name,
|
||||
token.symbol,
|
||||
token.decimals,
|
||||
totalSupply,
|
||||
)), _.noop).then((dummyTokens: ContractInstance[]) => {
|
||||
const weth = {
|
||||
address: EtherToken.address,
|
||||
name: 'Ether Token',
|
||||
symbol: 'WETH',
|
||||
url: '',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
};
|
||||
return Bluebird.each(dummyTokens.map((tokenContract: ContractInstance, i: number) => {
|
||||
const token = tokens[i];
|
||||
return tokenRegistry.addToken(
|
||||
tokenContract.address,
|
||||
token.name,
|
||||
token.symbol,
|
||||
token.decimals,
|
||||
token.ipfsHash,
|
||||
token.swarmHash,
|
||||
);
|
||||
}).concat(tokenRegistry.addToken(
|
||||
weth.address,
|
||||
weth.name,
|
||||
weth.symbol,
|
||||
weth.decimals,
|
||||
weth.ipfsHash,
|
||||
weth.swarmHash,
|
||||
)), _.noop);
|
||||
});
|
||||
} else {
|
||||
const zrx = {
|
||||
address: ZRXToken.address,
|
||||
name: '0x Protocol Token',
|
||||
symbol: 'ZRX',
|
||||
url: 'https://www.0xproject.com/',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
};
|
||||
return Bluebird.each(tokens.map((token: Token) => {
|
||||
return tokenRegistry.addToken(
|
||||
token.address,
|
||||
token.name,
|
||||
token.symbol,
|
||||
token.decimals,
|
||||
token.ipfsHash,
|
||||
token.swarmHash,
|
||||
);
|
||||
}).concat(tokenRegistry.addToken(
|
||||
zrx.address,
|
||||
zrx.name,
|
||||
zrx.symbol,
|
||||
zrx.decimals,
|
||||
zrx.ipfsHash,
|
||||
zrx.swarmHash,
|
||||
)), _.noop);
|
||||
}
|
||||
});
|
||||
const tokens = network === 'live' ? tokenInfo.live : tokenInfo.development;
|
||||
deployer.then(() => {
|
||||
return TokenRegistry.deployed();
|
||||
}).then((tokenRegistry: ContractInstance) => {
|
||||
if (network !== 'live') {
|
||||
const totalSupply = Math.pow(10, 18) * 1000000000;
|
||||
return Bluebird.each(tokens.map((token: Token) => DummyToken.new(
|
||||
token.name,
|
||||
token.symbol,
|
||||
token.decimals,
|
||||
totalSupply,
|
||||
)), _.noop).then((dummyTokens: ContractInstance[]) => {
|
||||
const weth = {
|
||||
address: EtherToken.address,
|
||||
name: 'Ether Token',
|
||||
symbol: 'WETH',
|
||||
url: '',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
};
|
||||
return Bluebird.each(dummyTokens.map((tokenContract: ContractInstance, i: number) => {
|
||||
const token = tokens[i];
|
||||
return tokenRegistry.addToken(
|
||||
tokenContract.address,
|
||||
token.name,
|
||||
token.symbol,
|
||||
token.decimals,
|
||||
token.ipfsHash,
|
||||
token.swarmHash,
|
||||
);
|
||||
}).concat(tokenRegistry.addToken(
|
||||
weth.address,
|
||||
weth.name,
|
||||
weth.symbol,
|
||||
weth.decimals,
|
||||
weth.ipfsHash,
|
||||
weth.swarmHash,
|
||||
)), _.noop);
|
||||
});
|
||||
} else {
|
||||
const zrx = {
|
||||
address: ZRXToken.address,
|
||||
name: '0x Protocol Token',
|
||||
symbol: 'ZRX',
|
||||
url: 'https://www.0xproject.com/',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
};
|
||||
return Bluebird.each(tokens.map((token: Token) => {
|
||||
return tokenRegistry.addToken(
|
||||
token.address,
|
||||
token.name,
|
||||
token.symbol,
|
||||
token.decimals,
|
||||
token.ipfsHash,
|
||||
token.swarmHash,
|
||||
);
|
||||
}).concat(tokenRegistry.addToken(
|
||||
zrx.address,
|
||||
zrx.name,
|
||||
zrx.symbol,
|
||||
zrx.decimals,
|
||||
zrx.ipfsHash,
|
||||
zrx.swarmHash,
|
||||
)), _.noop);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
import {Artifacts} from '../util/artifacts';
|
||||
import {ContractInstance} from '../util/types';
|
||||
const {
|
||||
TokenTransferProxy,
|
||||
Exchange,
|
||||
TokenRegistry,
|
||||
TokenTransferProxy,
|
||||
Exchange,
|
||||
TokenRegistry,
|
||||
} = new Artifacts(artifacts);
|
||||
|
||||
let tokenTransferProxy: ContractInstance;
|
||||
module.exports = (deployer: any) => {
|
||||
deployer.then(async () => {
|
||||
return Promise.all([
|
||||
TokenTransferProxy.deployed(),
|
||||
TokenRegistry.deployed(),
|
||||
]);
|
||||
})
|
||||
.then((instances: ContractInstance[]) => {
|
||||
let tokenRegistry: ContractInstance;
|
||||
[tokenTransferProxy, tokenRegistry] = instances;
|
||||
return tokenRegistry.getTokenAddressBySymbol('ZRX');
|
||||
})
|
||||
.then((ptAddress: string) => {
|
||||
return deployer.deploy(Exchange, ptAddress, tokenTransferProxy.address);
|
||||
}).then(() => {
|
||||
return tokenTransferProxy.addAuthorizedAddress(Exchange.address);
|
||||
});
|
||||
deployer.then(async () => {
|
||||
return Promise.all([
|
||||
TokenTransferProxy.deployed(),
|
||||
TokenRegistry.deployed(),
|
||||
]);
|
||||
})
|
||||
.then((instances: ContractInstance[]) => {
|
||||
let tokenRegistry: ContractInstance;
|
||||
[tokenTransferProxy, tokenRegistry] = instances;
|
||||
return tokenRegistry.getTokenAddressBySymbol('ZRX');
|
||||
})
|
||||
.then((ptAddress: string) => {
|
||||
return deployer.deploy(Exchange, ptAddress, tokenTransferProxy.address);
|
||||
}).then(() => {
|
||||
return tokenTransferProxy.addAuthorizedAddress(Exchange.address);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
import {Artifacts} from '../util/artifacts';
|
||||
import {ContractInstance} from '../util/types';
|
||||
const {
|
||||
TokenTransferProxy,
|
||||
MultiSigWalletWithTimeLock,
|
||||
TokenRegistry,
|
||||
TokenTransferProxy,
|
||||
MultiSigWalletWithTimeLock,
|
||||
TokenRegistry,
|
||||
} = new Artifacts(artifacts);
|
||||
|
||||
let tokenRegistry: ContractInstance;
|
||||
module.exports = (deployer: any, network: string) => {
|
||||
if (network !== 'development') {
|
||||
deployer.then(async () => {
|
||||
return Promise.all([
|
||||
TokenTransferProxy.deployed(),
|
||||
TokenRegistry.deployed(),
|
||||
]).then((instances: ContractInstance[]) => {
|
||||
let tokenTransferProxy: ContractInstance;
|
||||
[tokenTransferProxy, tokenRegistry] = instances;
|
||||
return tokenTransferProxy.transferOwnership(MultiSigWalletWithTimeLock.address);
|
||||
}).then(() => {
|
||||
return tokenRegistry.transferOwnership(MultiSigWalletWithTimeLock.address);
|
||||
});
|
||||
});
|
||||
}
|
||||
if (network !== 'development') {
|
||||
deployer.then(async () => {
|
||||
return Promise.all([
|
||||
TokenTransferProxy.deployed(),
|
||||
TokenRegistry.deployed(),
|
||||
]).then((instances: ContractInstance[]) => {
|
||||
let tokenTransferProxy: ContractInstance;
|
||||
[tokenTransferProxy, tokenRegistry] = instances;
|
||||
return tokenTransferProxy.transferOwnership(MultiSigWalletWithTimeLock.address);
|
||||
}).then(() => {
|
||||
return tokenRegistry.transferOwnership(MultiSigWalletWithTimeLock.address);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2,9 +2,9 @@ import {MultiSigConfigByNetwork} from '../../util/types';
|
||||
|
||||
// Make a copy of this file named `multisig.js` and input custom params as needed
|
||||
export const multiSig: MultiSigConfigByNetwork = {
|
||||
kovan: {
|
||||
owners: [],
|
||||
confirmationsRequired: 0,
|
||||
secondsRequired: 0,
|
||||
},
|
||||
kovan: {
|
||||
owners: [],
|
||||
confirmationsRequired: 0,
|
||||
secondsRequired: 0,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -2,98 +2,98 @@ import {constants} from '../../util/constants';
|
||||
import {TokenInfoByNetwork} from '../../util/types';
|
||||
|
||||
export const tokenInfo: TokenInfoByNetwork = {
|
||||
development: [
|
||||
{
|
||||
name: '0x Protocol Token',
|
||||
symbol: 'ZRX',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
name: 'Augur Reputation Token',
|
||||
symbol: 'REP',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
name: 'Digix DAO Token',
|
||||
symbol: 'DGD',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
name: 'Golem Network Token',
|
||||
symbol: 'GNT',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
name: 'MakerDAO',
|
||||
symbol: 'MKR',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
name: 'Melon Token',
|
||||
symbol: 'MLN',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
],
|
||||
live: [
|
||||
{
|
||||
address: '0xecf8f87f810ecf450940c9f60066b4a7a501d6a7',
|
||||
name: 'ETH Wrapper Token',
|
||||
symbol: 'WETH',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
address: '0x48c80f1f4d53d5951e5d5438b54cba84f29f32a5',
|
||||
name: 'Augur Reputation Token',
|
||||
symbol: 'REP',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
address: '0xe0b7927c4af23765cb51314a0e0521a9645f0e2a',
|
||||
name: 'Digix DAO Token',
|
||||
symbol: 'DGD',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
address: '0xa74476443119a942de498590fe1f2454d7d4ac0d',
|
||||
name: 'Golem Network Token',
|
||||
symbol: 'GNT',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
address: '0xc66ea802717bfb9833400264dd12c2bceaa34a6d',
|
||||
name: 'MakerDAO',
|
||||
symbol: 'MKR',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
address: '0xbeb9ef514a379b997e0798fdcc901ee474b6d9a1',
|
||||
name: 'Melon Token',
|
||||
symbol: 'MLN',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
],
|
||||
development: [
|
||||
{
|
||||
name: '0x Protocol Token',
|
||||
symbol: 'ZRX',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
name: 'Augur Reputation Token',
|
||||
symbol: 'REP',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
name: 'Digix DAO Token',
|
||||
symbol: 'DGD',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
name: 'Golem Network Token',
|
||||
symbol: 'GNT',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
name: 'MakerDAO',
|
||||
symbol: 'MKR',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
name: 'Melon Token',
|
||||
symbol: 'MLN',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
],
|
||||
live: [
|
||||
{
|
||||
address: '0xecf8f87f810ecf450940c9f60066b4a7a501d6a7',
|
||||
name: 'ETH Wrapper Token',
|
||||
symbol: 'WETH',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
address: '0x48c80f1f4d53d5951e5d5438b54cba84f29f32a5',
|
||||
name: 'Augur Reputation Token',
|
||||
symbol: 'REP',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
address: '0xe0b7927c4af23765cb51314a0e0521a9645f0e2a',
|
||||
name: 'Digix DAO Token',
|
||||
symbol: 'DGD',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
address: '0xa74476443119a942de498590fe1f2454d7d4ac0d',
|
||||
name: 'Golem Network Token',
|
||||
symbol: 'GNT',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
address: '0xc66ea802717bfb9833400264dd12c2bceaa34a6d',
|
||||
name: 'MakerDAO',
|
||||
symbol: 'MKR',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
{
|
||||
address: '0xbeb9ef514a379b997e0798fdcc901ee474b6d9a1',
|
||||
name: 'Melon Token',
|
||||
symbol: 'MLN',
|
||||
decimals: 18,
|
||||
ipfsHash: constants.NULL_BYTES,
|
||||
swarmHash: constants.NULL_BYTES,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user