Skip to content
Permalink
Browse files

Remove Redundant Code

  • Loading branch information...
piavgh committed Mar 4, 2019
1 parent 106d2c5 commit 7cfb43cc0aee2f5f2e3d11c6a890d5814279a012
Showing with 30 additions and 86 deletions.
  1. +0 −3 .env.sample
  2. +30 −56 config/index.js
  3. +0 −9 config/secret.js
  4. +0 −18 truffle.js
@@ -1,5 +1,2 @@
ETHEREUM_MNEMONIC=Your Ethereum mnemonic here
ROPSTEN_MNEMONIC=Your Ropsten mnemonic here
RINKEBY_MNEMONIC=Your Rinkeby mnemonic here
TOMOCHAIN_MNEMONIC=Your Tomochain mainnet mnemonic here
TOMOCHAIN_TESTNET_MNEMONIC=Your Tomochain testnet mnemonic here
@@ -1,37 +1,11 @@
require('dotenv').config()

const NETWORK_ID = {
ETHEREUM: '1',
ROPSTEN: '3',
RINKEBY: '4',
TOMOCHAIN: '88',
TOMOCHAIN_TESTNET: '89',
DEVELOPMENT: '8888',
}

const baseTokens = [
'ETH',
// 'AE',
// 'BAT',
// 'BNB',
// 'GNT',
// 'KNC',
// 'LOOM',
// 'LRC',
// 'MITH',
// 'MKR',
// 'NPXS',
// 'OMG',
// 'PRFT',
// 'REP',
// 'SNT',
// 'WTC',
// 'ZRX',
]

// const quoteTokens = ['WETH', 'DAI', 'TUSD', 'USDC'];
const quoteTokens = []

const rewardAddresses = {
'1': '',
'8888': '0xD3050147F1AC4c552941930C7b27386dE8A710b8',
@@ -41,30 +15,32 @@ let tokenContracts = null
const getTokenContracts = (artifacts, filters) => {
if (tokenContracts === null) {
tokenContracts = [
artifacts.require('../contracts/tokens/BTC.sol'),
artifacts.require('../contracts/tokens/ETH.sol'),
artifacts.require('../contracts/tokens/OMG.sol'),
artifacts.require('../contracts/tokens/BNB.sol'),
artifacts.require('../contracts/tokens/ZRX.sol'),
artifacts.require('../contracts/tokens/AE.sol'),
artifacts.require('../contracts/tokens/TRX.sol'),
artifacts.require('../contracts/tokens/MKR.sol'),
artifacts.require('../contracts/tokens/BAT.sol'),
artifacts.require('../contracts/tokens/REP.sol'),
artifacts.require('../contracts/tokens/BTM.sol'),
artifacts.require('../contracts/tokens/NPXS.sol'),
artifacts.require('../contracts/tokens/WTC.sol'),
artifacts.require('../contracts/tokens/KCS.sol'),
artifacts.require('../contracts/tokens/GNT.sol'),
artifacts.require('../contracts/tokens/PPT.sol'),
artifacts.require('../contracts/tokens/SNT.sol'),
artifacts.require('../contracts/tokens/DGX.sol'),
artifacts.require('../contracts/tokens/MITH.sol'),
artifacts.require('../contracts/tokens/AION.sol'),
artifacts.require('../contracts/tokens/LRC.sol'),
artifacts.require('../contracts/tokens/FUN.sol'),
artifacts.require('../contracts/tokens/KNC.sol'),
artifacts.require('../contracts/tokens/LOOM.sol'),
artifacts.require('../contracts/tokens/DAI.sol'),
artifacts.require('../contracts/tokens/USDT.sol'),
// artifacts.require('../contracts/tokens/OMG.sol'),
// artifacts.require('../contracts/tokens/BNB.sol'),
// artifacts.require('../contracts/tokens/ZRX.sol'),
// artifacts.require('../contracts/tokens/AE.sol'),
// artifacts.require('../contracts/tokens/TRX.sol'),
// artifacts.require('../contracts/tokens/MKR.sol'),
// artifacts.require('../contracts/tokens/BAT.sol'),
// artifacts.require('../contracts/tokens/REP.sol'),
// artifacts.require('../contracts/tokens/BTM.sol'),
// artifacts.require('../contracts/tokens/NPXS.sol'),
// artifacts.require('../contracts/tokens/WTC.sol'),
// artifacts.require('../contracts/tokens/KCS.sol'),
// artifacts.require('../contracts/tokens/GNT.sol'),
// artifacts.require('../contracts/tokens/PPT.sol'),
// artifacts.require('../contracts/tokens/SNT.sol'),
// artifacts.require('../contracts/tokens/DGX.sol'),
// artifacts.require('../contracts/tokens/MITH.sol'),
// artifacts.require('../contracts/tokens/AION.sol'),
// artifacts.require('../contracts/tokens/LRC.sol'),
// artifacts.require('../contracts/tokens/FUN.sol'),
// artifacts.require('../contracts/tokens/KNC.sol'),
// artifacts.require('../contracts/tokens/LOOM.sol'),
// artifacts.require('../contracts/tokens/DAI.sol'),
]
}
if (!filters) return tokenContracts
@@ -75,16 +51,14 @@ const getTokenContracts = (artifacts, filters) => {

module.exports = {
NETWORK_ID,
quoteTokens,
baseTokens,
tokens: [...baseTokens, ...quoteTokens],
tokens: [
'BTC',
'ETH',
'USDT',
],
rewardAddresses,
// truffle config
rpcEndpoints: {
ethereum: 'https://mainnet.infura.io/v3/ebaf1785cc1b4f319e0ff07f26cadae8',
ropsten: 'https://ropsten.infura.io/v3/ebaf1785cc1b4f319e0ff07f26cadae8',
kovan: 'https://ropsten.infura.io/v3/ebaf1785cc1b4f319e0ff07f26cadae8',
rinkeby: 'https://rinkeby.infura.io/v3/ebaf1785cc1b4f319e0ff07f26cadae8',
tomochain: 'https://rpc.tomochain.com',
tomochainTestnet: 'https://testnet.tomochain.com',
},
@@ -1,13 +1,4 @@
const config = {
ethereum: {
mnemonic: process.env.ETHEREUM_MNEMONIC,
},
ropsten: {
mnemonic: process.env.ROPSTEN_MNEMONIC,
},
rinkeby: {
mnemonic: process.env.RINKEBY_MNEMONIC,
},
tomochain: {
mnemonic: process.env.TOMOCHAIN_MNEMONIC,
},
@@ -21,24 +21,6 @@ module.exports = {
gasPrice: config.constants.development.DEFAULT_GAS_PRICE,
from: '0xF9D87abd60435b70415CcC1FAAcA4F8B91786eDb', // testprc main account here
},
ethereum: {
provider: () => new HDWalletProvider(secret.ethereum.mnemonic, config.rpcEndpoints.ethereum),
network_id: config.NETWORK_ID.ETHEREUM,
gas: config.constants.development.MAX_GAS,
gasPrice: config.constants.development.DEFAULT_GAS_PRICE,
},
ropsten: {
provider: () => new HDWalletProvider(secret.ropsten.mnemonic, config.rpcEndpoints.ropsten),
network_id: config.NETWORK_ID.ROPSTEN,
gas: config.constants.development.MAX_GAS,
gasPrice: config.constants.development.DEFAULT_GAS_PRICE,
},
rinkeby: {
provider: () => new HDWalletProvider(secret.rinkeby.mnemonic, config.rpcEndpoints.rinkeby),
network_id: config.NETWORK_ID.RINKEBY,
gas: config.constants.development.MAX_GAS,
gasPrice: config.constants.development.DEFAULT_GAS_PRICE,
},
tomochain: {
provider: () => new HDWalletProvider(secret.tomochain.mnemonic, config.rpcEndpoints.tomochain),
network_id: config.NETWORK_ID.TOMOCHAIN,

0 comments on commit 7cfb43c

Please sign in to comment.
You can’t perform that action at this time.