aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-12-16 04:07:14 +0800
committerFabio Berger <me@fabioberger.com>2017-12-16 04:07:14 +0800
commitfe8f2d87c79cb25a7879c2e737dbdd64b7c40f60 (patch)
tree56c037df571f363f8c0a0e9b3d85515ccd373b6e
parenta71a1edf2c7d4acdf62836e19103c2867eb1e105 (diff)
downloaddexon-sol-tools-fe8f2d87c79cb25a7879c2e737dbdd64b7c40f60.tar.gz
dexon-sol-tools-fe8f2d87c79cb25a7879c2e737dbdd64b7c40f60.tar.zst
dexon-sol-tools-fe8f2d87c79cb25a7879c2e737dbdd64b7c40f60.zip
Temporary hack to alleviate issues with updating tokenRegistry with new WETH address
-rw-r--r--packages/website/ts/blockchain.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts
index 331bafa71..6877a301a 100644
--- a/packages/website/ts/blockchain.ts
+++ b/packages/website/ts/blockchain.ts
@@ -592,9 +592,22 @@ export class Blockchain {
// HACK: For now we have a hard-coded list of iconUrls for the dummyTokens
// TODO: Refactor this out and pull the iconUrl directly from the TokenRegistry
const iconUrl = constants.iconUrlBySymbol[t.symbol];
+ // HACK: Temporarily we hijack the WETH addresses fetched from the tokenRegistry
+ // so that we can take our time with actually updating it. This ensures that when
+ // we deploy the new WETH page, everyone will re-fill their trackedTokens with the
+ // new canonical WETH.
+ // TODO: Remove this hack once we've updated the TokenRegistries
+ let address = t.address;
+ if (t.symbol === 'WETH') {
+ if (this.networkId === 1) {
+ address = '0xe495bcacaf29a0eb00fb67b86e9cd2a994dd55d8';
+ } else if (this.networkId === 42) {
+ address = '0x739e78d6bebbdf24105a5145fa04436589d1cbd9';
+ }
+ }
const token: Token = {
iconUrl,
- address: t.address,
+ address,
name: t.name,
symbol: t.symbol,
decimals: t.decimals,