diff options
author | Fabio Berger <me@fabioberger.com> | 2018-02-07 09:23:01 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-02-07 09:23:01 +0800 |
commit | 05aa2fa42148e79f6a3dd35e91e9e85346c4d421 (patch) | |
tree | 5c7f1d845fc1fa162958a0b840242eb11e1c23c7 | |
parent | 03f5c9b9508b833bd4645386b5f46720a7d7ba2a (diff) | |
download | dexon-sol-tools-05aa2fa42148e79f6a3dd35e91e9e85346c4d421.tar dexon-sol-tools-05aa2fa42148e79f6a3dd35e91e9e85346c4d421.tar.gz dexon-sol-tools-05aa2fa42148e79f6a3dd35e91e9e85346c4d421.tar.bz2 dexon-sol-tools-05aa2fa42148e79f6a3dd35e91e9e85346c4d421.tar.lz dexon-sol-tools-05aa2fa42148e79f6a3dd35e91e9e85346c4d421.tar.xz dexon-sol-tools-05aa2fa42148e79f6a3dd35e91e9e85346c4d421.tar.zst dexon-sol-tools-05aa2fa42148e79f6a3dd35e91e9e85346c4d421.zip |
Properly detect Rinkeby and Ropsten TokenRegistry tokens as mintable
-rw-r--r-- | packages/website/ts/components/token_balances.tsx | 10 | ||||
-rw-r--r-- | packages/website/ts/utils/configs.ts | 24 |
2 files changed, 31 insertions, 3 deletions
diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx index 64aa1ef3f..ea8144b7d 100644 --- a/packages/website/ts/components/token_balances.tsx +++ b/packages/website/ts/components/token_balances.tsx @@ -362,8 +362,14 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala EtherscanLinkSuffixes.Address, ); const isMintable = - _.includes(configs.SYMBOLS_OF_MINTABLE_TOKENS, token.symbol) && - this.props.networkId !== constants.NETWORK_ID_MAINNET; + (_.includes(configs.SYMBOLS_OF_MINTABLE_KOVAN_TOKENS, token.symbol) && + this.props.networkId === constants.NETWORK_ID_BY_NAME[Networks.Kovan]) || + (_.includes(configs.SYMBOLS_OF_MINTABLE_RINKEBY_ROPSTEN_TOKENS, token.symbol) && + _.includes( + [constants.NETWORK_ID_BY_NAME[Networks.Rinkeby], constants.NETWORK_ID_BY_NAME[Networks.Ropsten]], + this.props.networkId, + )); + console.log('token', token); return ( <TableRow key={token.address} style={{ height: TOKEN_TABLE_ROW_HEIGHT }}> <TableRowColumn colSpan={tokenColSpan}> diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts index 874ad04c2..69773eae7 100644 --- a/packages/website/ts/utils/configs.ts +++ b/packages/website/ts/utils/configs.ts @@ -124,5 +124,27 @@ export const configs = { [4]: [`https://rinkeby.infura.io/${INFURA_API_KEY}`], } as PublicNodeUrlsByNetworkId, SHOULD_DEPRECATE_OLD_WETH_TOKEN: true, - SYMBOLS_OF_MINTABLE_TOKENS: ['MKR', 'MLN', 'GNT', 'DGD', 'REP'], + SYMBOLS_OF_MINTABLE_KOVAN_TOKENS: ['MKR', 'MLN', 'GNT', 'DGD', 'REP'], + SYMBOLS_OF_MINTABLE_RINKEBY_ROPSTEN_TOKENS: [ + 'TKN0', + 'TKN1', + 'TKN2', + 'TKN3', + 'TKN4', + 'TKN5', + 'TKN6', + 'TKN7', + 'TKN8', + 'TKN9', + 'TKN10', + 'TKN11', + 'TKN12', + 'TKN13', + 'TKN14', + 'TKN15', + 'TKN16', + 'TKN17', + 'TKN18', + 'TKN19', + ], }; |