diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c062db402d8..b114a57e31c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,23 @@ ## Current Develop Branch +## 7.7.9 Tue Apr 28 2020 +- [#8446](https://github.com/MetaMask/metamask-extension/pull/8446): Fix popup not opening +- [#8449](https://github.com/MetaMask/metamask-extension/pull/8449): Skip adding history entry for empty txMeta diffs +- [#8447](https://github.com/MetaMask/metamask-extension/pull/8447): Delete Dai/Sai migration notification +- [#8460](https://github.com/MetaMask/metamask-extension/pull/8460): Update deposit copy for Wyre +- [#8458](https://github.com/MetaMask/metamask-extension/pull/8458): Snapshot txMeta without cloning history +- [#8459](https://github.com/MetaMask/metamask-extension/pull/8459): Fix method registry initialization +- [#8455](https://github.com/MetaMask/metamask-extension/pull/8455): Add Dai/Sai to currency display +- [#8461](https://github.com/MetaMask/metamask-extension/pull/8461): Prevent network switch upon close of network timeout overlay +- [#8457](https://github.com/MetaMask/metamask-extension/pull/8457): Add INR currency option +- [#8462](https://github.com/MetaMask/metamask-extension/pull/8462): Fix display of Kovan and Rinkeby chain IDs +- [#8465](https://github.com/MetaMask/metamask-extension/pull/8465): Use ethereum-ens-network-map for network support +- [#8463](https://github.com/MetaMask/metamask-extension/pull/8463): Update deprecated Etherscam link +- [#8474](https://github.com/MetaMask/metamask-extension/pull/8474): Only update pending transactions upon block update +- [#8476](https://github.com/MetaMask/metamask-extension/pull/8476): Update eth-contract-metadata +- [#8509](https://github.com/MetaMask/metamask-extension/pull/8509): Fix Tohen Typo + ## 7.7.8 Wed Mar 11 2020 - [#8176](https://github.com/MetaMask/metamask-extension/pull/8176): Handle and set gas estimation when max mode is clicked - [#8178](https://github.com/MetaMask/metamask-extension/pull/8178): Use specified gas limit when speeding up a transaction diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 5f241ab05079..705d7f92eae8 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -328,7 +328,7 @@ "message": "Höhere Gebühren können Bearbeitungszeiten verkürzen, wofür es allerdings keine Garantie gibt." }, "customToken": { - "message": "Custom-Tohen" + "message": "Custom-Token" }, "customRPC": { "message": "Spezieller RPC" diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 73c59555eb46..412d78148950 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -1,13 +1,4 @@ { - "migrateSai": { - "message": "A message from Maker: The new Multi-Collateral Dai token has been released. Your old tokens are now called Sai. Please upgrade your Sai tokens to the new Dai." - }, - "migrateSaiInfo": { - "message": "To dismiss this notification you can migrate your tokens or hide SAI from the token list." - }, - "migrate": { - "message": "Migrate" - }, "showIncomingTransactions": { "message": "Show Incoming Transactions" }, @@ -238,7 +229,7 @@ "message": "Buy ETH with Wyre" }, "buyWithWyreDescription": { - "message": "Wyre lets you use a credit card to deposit ETH right in to your MetaMask account." + "message": "Wyre lets you use a debit card to deposit ETH right in to your MetaMask account." }, "buyCoinSwitch": { "message": "Buy on CoinSwitch" diff --git a/app/manifest.json b/app/manifest.json index de4191ab49e9..45ff5ab7f914 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_appName__", "short_name": "__MSG_appName__", - "version": "7.7.8", + "version": "7.7.9", "manifest_version": 2, "author": "https://metamask.io", "description": "__MSG_appDescription__", diff --git a/app/phishing.html b/app/phishing.html index 1e1c4d11cefb..515beea81888 100644 --- a/app/phishing.html +++ b/app/phishing.html @@ -47,7 +47,7 @@

Ethereum Phishing Detector. Domains on these warning lists may include outright malicious websites and legitimate websites that have been compromised by a malicious actor.

-

To read more about this site please review the domain on Etherscam.

+

To read more about this site please search for the domain on CryptoScamDB.

Note that this warning list is compiled on a voluntary basis. This list may be inaccurate or incomplete. Just because a domain does not appear on this list is not an implicit guarantee of that domain's safety. diff --git a/app/scripts/background.js b/app/scripts/background.js index 31c8d1815d7d..fc14f68a739c 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -447,7 +447,6 @@ function triggerUi () { const currentlyActiveMetamaskTab = Boolean(tabs.find(tab => openMetamaskTabsIDs[tab.id])) if (!popupIsOpen && !currentlyActiveMetamaskTab && !notificationIsOpen) { notificationManager.showPopup() - notificationIsOpen = true } }) } diff --git a/app/scripts/controllers/app-state.js b/app/scripts/controllers/app-state.js index c60a1c4f5065..32866888a5e6 100644 --- a/app/scripts/controllers/app-state.js +++ b/app/scripts/controllers/app-state.js @@ -13,7 +13,6 @@ class AppStateController { this.onInactiveTimeout = onInactiveTimeout || (() => {}) this.store = new ObservableStore(extend({ timeoutMinutes: 0, - mkrMigrationReminderTimestamp: null, }, initState)) this.timer = null @@ -24,12 +23,6 @@ class AppStateController { this._setInactiveTimeout(preferences.autoLogoutTimeLimit) } - setMkrMigrationReminderTimestamp (timestamp) { - this.store.updateState({ - mkrMigrationReminderTimestamp: timestamp, - }) - } - /** * Sets the last active time to the current time * @return {void} diff --git a/app/scripts/controllers/ens/ens.js b/app/scripts/controllers/ens/ens.js index eb2586a7d3ce..71996f4de331 100644 --- a/app/scripts/controllers/ens/ens.js +++ b/app/scripts/controllers/ens/ens.js @@ -1,5 +1,5 @@ const EthJsEns = require('ethjs-ens') -const ensNetworkMap = require('ethjs-ens/lib/network-map.json') +const ensNetworkMap = require('ethereum-ens-network-map') class Ens { static getNetworkEnsSupport (network) { diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index fa82b4f19eff..808c224c39a1 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -724,7 +724,6 @@ class TransactionController extends EventEmitter { Updates the memStore in transaction controller */ _updateMemstore () { - this.pendingTxTracker.updatePendingTxs() const unapprovedTxs = this.txStateManager.getUnapprovedTxList() const selectedAddressTxList = this.txStateManager.getFilteredTxList({ from: this.getSelectedAddress(), diff --git a/app/scripts/controllers/transactions/lib/tx-state-history-helper.js b/app/scripts/controllers/transactions/lib/tx-state-history-helper.js index 76fc5c35b394..20e64696b28c 100644 --- a/app/scripts/controllers/transactions/lib/tx-state-history-helper.js +++ b/app/scripts/controllers/transactions/lib/tx-state-history-helper.js @@ -57,13 +57,12 @@ function replayHistory (_shortHistory) { } /** - @param txMeta {Object} - @returns {object} a clone object of the txMeta with out history -*/ + * Snapshot {@code txMeta} + * @param {Object} txMeta - the tx metadata object + * @returns {Object} a deep clone without history + */ function snapshotFromTxMeta (txMeta) { - // create txMeta snapshot for history - const snapshot = clone(txMeta) - // dont include previous history in this snapshot - delete snapshot.history - return snapshot + const shallow = { ...txMeta } + delete shallow.history + return clone(shallow) } diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js index cf254352fddd..e2bbe8e39ed6 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.js +++ b/app/scripts/controllers/transactions/tx-state-manager.js @@ -195,7 +195,9 @@ class TransactionStateManager extends EventEmitter { const previousState = txStateHistoryHelper.replayHistory(txMeta.history) // generate history entry and add to history const entry = txStateHistoryHelper.generateHistoryEntry(previousState, currentState, note) - txMeta.history.push(entry) + if (entry.length) { + txMeta.history.push(entry) + } // commit txMeta to state const txId = txMeta.id diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index bd31705cbdb3..0d7b0a598127 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -509,7 +509,6 @@ module.exports = class MetamaskController extends EventEmitter { // AppStateController setLastActiveTime: nodeify(this.appStateController.setLastActiveTime, this.appStateController), - setMkrMigrationReminderTimestamp: nodeify(this.appStateController.setMkrMigrationReminderTimestamp, this.appStateController), // EnsController tryReverseResolveAddress: nodeify(this.ensController.reverseResolveAddress, this.ensController), @@ -768,7 +767,7 @@ module.exports = class MetamaskController extends EventEmitter { } await this.preferencesController.syncAddresses(accounts) - await this.txController.pendingTxTracker.updatePendingTxs() + await this.blockTracker.checkForLatestBlock() try { const threeBoxSyncingAllowed = this.threeBoxController.getThreeBoxSyncingState() diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js index 266e4fc312be..ad62749bbce7 100644 --- a/app/scripts/phishing-detect.js +++ b/app/scripts/phishing-detect.js @@ -14,7 +14,7 @@ function start () { const hash = window.location.hash.substring(1) const suspect = querystring.parse(hash) - document.getElementById('esdbLink').href = `https://etherscamdb.info/domain/${suspect.hostname}` + document.getElementById('csdbLink').href = `https://cryptoscamdb.org/search` global.platform = new ExtensionPlatform() global.METAMASK_UI_TYPE = windowType diff --git a/package.json b/package.json index 578da2a78883..8fb06842dd0b 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "dnode": "^1.2.2", "end-of-stream": "^1.1.0", "eth-block-tracker": "^4.4.2", - "eth-contract-metadata": "^1.12.1", + "eth-contract-metadata": "^1.13.0", "eth-ens-namehash": "^2.0.8", "eth-json-rpc-errors": "^1.1.0", "eth-json-rpc-filters": "^4.1.1", @@ -101,6 +101,7 @@ "eth-sig-util": "^2.3.0", "eth-token-tracker": "^1.1.10", "eth-trezor-keyring": "^0.4.0", + "ethereum-ens-network-map": "^1.0.2", "ethereumjs-abi": "^0.6.4", "ethereumjs-tx": "1.3.7", "ethereumjs-util": "5.1.0", diff --git a/test/unit/app/controllers/transactions/tx-state-manager-test.js b/test/unit/app/controllers/transactions/tx-state-manager-test.js index 02d6199e9fa8..bdd1c9cb72c3 100644 --- a/test/unit/app/controllers/transactions/tx-state-manager-test.js +++ b/test/unit/app/controllers/transactions/tx-state-manager-test.js @@ -252,6 +252,23 @@ describe('TransactionStateManager', function () { assert.deepEqual(result.history[1][0].value, expectedEntry.value, 'two history items (initial + diff) value') assert.ok(result.history[1][0].timestamp >= before && result.history[1][0].timestamp <= after) }) + + it('does NOT add empty history items', function () { + const txMeta = { + id: '1', + status: 'unapproved', + metamaskNetworkId: currentNetworkId, + txParams: { + gasPrice: '0x01', + }, + } + + txStateManager.addTx(txMeta) + txStateManager.updateTx(txMeta) + + const { history } = txStateManager.getTx('1') + assert.equal(history.length, 1, 'two history items (initial + diff)') + }) }) describe('#getUnapprovedTxList', function () { diff --git a/test/unit/balance-formatter-test.js b/test/unit/balance-formatter-test.js index bd0eb50087a4..52a442a005d8 100644 --- a/test/unit/balance-formatter-test.js +++ b/test/unit/balance-formatter-test.js @@ -1,13 +1,13 @@ const assert = require('assert') const currencyFormatter = require('currency-formatter') -const infuraConversion = require('../../ui/app/helpers/constants/infura-conversion.json') +const availableCurrencies = require('../../ui/app/helpers/constants/available-conversions.json') describe('currencyFormatting', function () { it('be able to format any infura currency', function (done) { const number = 10000 - infuraConversion.objects.forEach((conversion) => { - const code = conversion.quote.code.toUpperCase() + availableCurrencies.forEach((conversion) => { + const code = conversion.code.toUpperCase() const result = currencyFormatter.format(number, { code }) switch (code) { diff --git a/ui/app/components/app/dai-migration-component/dai-migration-notification.component.js b/ui/app/components/app/dai-migration-component/dai-migration-notification.component.js deleted file mode 100644 index d26358df7367..000000000000 --- a/ui/app/components/app/dai-migration-component/dai-migration-notification.component.js +++ /dev/null @@ -1,78 +0,0 @@ -import { DateTime } from 'luxon' -import React, { PureComponent } from 'react' -import PropTypes from 'prop-types' -import HomeNotification from '../home-notification' - -export default class DaiV1MigrationNotification extends PureComponent { - static contextTypes = { - t: PropTypes.func, - } - - static defaultProps = { - mkrMigrationReminderTimestamp: null, - string: '', - symbol: '', - } - - static propTypes = { - setMkrMigrationReminderTimestamp: PropTypes.func.isRequired, - mkrMigrationReminderTimestamp: PropTypes.string, - string: PropTypes.string, - symbol: PropTypes.string, - } - - remindMeLater = () => { - const nextWeek = DateTime.utc().plus({ - days: 7, - }) - this.props.setMkrMigrationReminderTimestamp(nextWeek.toString()) - } - - render () { - const { t } = this.context - const { mkrMigrationReminderTimestamp, string: balanceString, symbol } = this.props - - if (mkrMigrationReminderTimestamp) { - const reminderDateTime = DateTime.fromISO(mkrMigrationReminderTimestamp, { - zone: 'UTC', - }) - if (reminderDateTime > DateTime.utc()) { - return null - } - } - - if (!balanceString || !symbol) { - return null - } - - if (balanceString === '0') { - return null - } - - return ( - - {t('migrateSai')} -   - { - window.open('https://blog.makerdao.com/multi-collateral-dai-is-live/', '_blank', 'noopener') - }} - > - {t('learnMore')}. - - - )} - acceptText={t('migrate')} - onAccept={() => { - window.open('https://migrate.makerdao.com', '_blank', 'noopener') - }} - ignoreText={t('remindMeLater')} - onIgnore={this.remindMeLater} - infoText={t('migrateSaiInfo')} - /> - ) - } -} diff --git a/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js b/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js deleted file mode 100644 index 175083bce982..000000000000 --- a/ui/app/components/app/dai-migration-component/dai-migration-notification.container.js +++ /dev/null @@ -1,34 +0,0 @@ -import { connect } from 'react-redux' -import { compose } from 'recompose' -import DaiMigrationNotification from './dai-migration-notification.component' -import withTokenTracker from '../../../helpers/higher-order-components/with-token-tracker' -import { getSelectedAddress, getDaiV1Token } from '../../../selectors/selectors' -import { setMkrMigrationReminderTimestamp } from '../../../store/actions' - -const mapStateToProps = (state) => { - const { - metamask: { - mkrMigrationReminderTimestamp, - }, - } = state - - const userAddress = getSelectedAddress(state) - const oldDai = getDaiV1Token(state) - - return { - mkrMigrationReminderTimestamp, - userAddress, - token: oldDai, - } -} - -const mapDispatchToProps = (dispatch) => { - return { - setMkrMigrationReminderTimestamp: (t) => dispatch(setMkrMigrationReminderTimestamp(t)), - } -} - -export default compose( - connect(mapStateToProps, mapDispatchToProps), - withTokenTracker, -)(DaiMigrationNotification) diff --git a/ui/app/components/app/dai-migration-component/index.js b/ui/app/components/app/dai-migration-component/index.js deleted file mode 100644 index e3c7cec2bab3..000000000000 --- a/ui/app/components/app/dai-migration-component/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './dai-migration-notification.container' diff --git a/ui/app/components/app/loading-network-screen/loading-network-screen.container.js b/ui/app/components/app/loading-network-screen/loading-network-screen.container.js index 87f1397ce5b6..893ee45d248a 100644 --- a/ui/app/components/app/loading-network-screen/loading-network-screen.container.js +++ b/ui/app/components/app/loading-network-screen/loading-network-screen.container.js @@ -7,10 +7,10 @@ const mapStateToProps = state => { const { loadingMessage, currentView, + lastSelectedProvider, } = state.appState const { provider, - lastSelectedProvider, network, } = state.metamask const { rpcTarget, chainId, ticker, nickname, type } = provider diff --git a/ui/app/helpers/constants/available-conversions.json b/ui/app/helpers/constants/available-conversions.json new file mode 100644 index 000000000000..913e8795fb44 --- /dev/null +++ b/ui/app/helpers/constants/available-conversions.json @@ -0,0 +1,250 @@ +[ + { + "code": "aud", + "name": "Australian Dollar" + }, + { + "code": "hkd", + "name": "Hong Kong Dollar" + }, + { + "code": "sgd", + "name": "Singapore Dollar" + }, + { + "code": "idr", + "name": "Indonesian Rupiah" + }, + { + "code": "inr", + "name": "Indian Rupee" + }, + { + "code": "php", + "name": "Philippine Peso" + }, + { + "code": "1st", + "name": "FirstBlood" + }, + { + "code": "adt", + "name": "adToken" + }, + { + "code": "adx", + "name": "AdEx" + }, + { + "code": "ant", + "name": "Aragon" + }, + { + "code": "bat", + "name": "Basic Attention Token" + }, + { + "code": "bnt", + "name": "Bancor" + }, + { + "code": "btc", + "name": "Bitcoin" + }, + { + "code": "cad", + "name": "Canadian Dollar" + }, + { + "code": "cfi", + "name": "Cofound.it" + }, + { + "code": "crb", + "name": "CreditBit" + }, + { + "code": "cvc", + "name": "Civic" + }, + { + "code": "dash", + "name": "Dash" + }, + { + "code": "dgd", + "name": "DigixDAO" + }, + { + "code": "etc", + "name": "Ethereum Classic" + }, + { + "code": "eur", + "name": "Euro" + }, + { + "code": "fun", + "name": "FunFair" + }, + { + "code": "gbp", + "name": "Pound Sterling" + }, + { + "code": "gno", + "name": "Gnosis" + }, + { + "code": "gnt", + "name": "Golem" + }, + { + "code": "gup", + "name": "Matchpool" + }, + { + "code": "hmq", + "name": "Humaniq" + }, + { + "code": "jpy", + "name": "Japanese Yen" + }, + { + "code": "lgd", + "name": "Legends Room" + }, + { + "code": "lsk", + "name": "Lisk" + }, + { + "code": "ltc", + "name": "Litecoin" + }, + { + "code": "lun", + "name": "Lunyr" + }, + { + "code": "mco", + "name": "Monaco" + }, + { + "code": "mtl", + "name": "Metal" + }, + { + "code": "myst", + "name": "Mysterium" + }, + { + "code": "nmr", + "name": "Numeraire" + }, + { + "code": "omg", + "name": "OmiseGO" + }, + { + "code": "pay", + "name": "TenX" + }, + { + "code": "ptoy", + "name": "Patientory" + }, + { + "code": "qrl", + "name": "Quantum-Resistant Ledger" + }, + { + "code": "qtum", + "name": "Qtum" + }, + { + "code": "rep", + "name": "Augur" + }, + { + "code": "rlc", + "name": "iEx.ec" + }, + { + "code": "rub", + "name": "Russian Ruble" + }, + { + "code": "sc", + "name": "Siacoin" + }, + { + "code": "sngls", + "name": "SingularDTV" + }, + { + "code": "snt", + "name": "Status" + }, + { + "code": "steem", + "name": "Steem" + }, + { + "code": "storj", + "name": "Storj" + }, + { + "code": "time", + "name": "ChronoBank" + }, + { + "code": "tkn", + "name": "TokenCard" + }, + { + "code": "trst", + "name": "WeTrust" + }, + { + "code": "uah", + "name": "Ukrainian Hryvnia" + }, + { + "code": "usd", + "name": "United States Dollar" + }, + { + "code": "wings", + "name": "Wings" + }, + { + "code": "xem", + "name": "NEM" + }, + { + "code": "xlm", + "name": "Stellar Lumen" + }, + { + "code": "xmr", + "name": "Monero" + }, + { + "code": "xrp", + "name": "Ripple" + }, + { + "code": "zec", + "name": "Zcash" + }, + { + "code": "dai", + "name": "DAI" + }, + { + "code": "sai", + "name": "SAI" + } +] diff --git a/ui/app/helpers/constants/infura-conversion.json b/ui/app/helpers/constants/infura-conversion.json deleted file mode 100644 index 9a96fe069be4..000000000000 --- a/ui/app/helpers/constants/infura-conversion.json +++ /dev/null @@ -1,653 +0,0 @@ -{ - "objects": [ - { - "symbol": "ethaud", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "aud", - "name": "Australian Dollar" - } - }, - { - "symbol": "ethhkd", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "hkd", - "name": "Hong Kong Dollar" - } - }, - { - "symbol": "ethsgd", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "sgd", - "name": "Singapore Dollar" - } - }, - { - "symbol": "ethidr", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "idr", - "name": "Indonesian Rupiah" - } - }, - { - "symbol": "ethphp", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "php", - "name": "Philippine Peso" - } - }, - { - "symbol": "eth1st", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "1st", - "name": "FirstBlood" - } - }, - { - "symbol": "ethadt", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "adt", - "name": "adToken" - } - }, - { - "symbol": "ethadx", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "adx", - "name": "AdEx" - } - }, - { - "symbol": "ethant", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "ant", - "name": "Aragon" - } - }, - { - "symbol": "ethbat", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "bat", - "name": "Basic Attention Token" - } - }, - { - "symbol": "ethbnt", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "bnt", - "name": "Bancor" - } - }, - { - "symbol": "ethbtc", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "btc", - "name": "Bitcoin" - } - }, - { - "symbol": "ethcad", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "cad", - "name": "Canadian Dollar" - } - }, - { - "symbol": "ethcfi", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "cfi", - "name": "Cofound.it" - } - }, - { - "symbol": "ethcrb", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "crb", - "name": "CreditBit" - } - }, - { - "symbol": "ethcvc", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "cvc", - "name": "Civic" - } - }, - { - "symbol": "ethdash", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "dash", - "name": "Dash" - } - }, - { - "symbol": "ethdgd", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "dgd", - "name": "DigixDAO" - } - }, - { - "symbol": "ethetc", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "etc", - "name": "Ethereum Classic" - } - }, - { - "symbol": "etheur", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "eur", - "name": "Euro" - } - }, - { - "symbol": "ethfun", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "fun", - "name": "FunFair" - } - }, - { - "symbol": "ethgbp", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "gbp", - "name": "Pound Sterling" - } - }, - { - "symbol": "ethgno", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "gno", - "name": "Gnosis" - } - }, - { - "symbol": "ethgnt", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "gnt", - "name": "Golem" - } - }, - { - "symbol": "ethgup", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "gup", - "name": "Matchpool" - } - }, - { - "symbol": "ethhmq", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "hmq", - "name": "Humaniq" - } - }, - { - "symbol": "ethjpy", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "jpy", - "name": "Japanese Yen" - } - }, - { - "symbol": "ethlgd", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "lgd", - "name": "Legends Room" - } - }, - { - "symbol": "ethlsk", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "lsk", - "name": "Lisk" - } - }, - { - "symbol": "ethltc", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "ltc", - "name": "Litecoin" - } - }, - { - "symbol": "ethlun", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "lun", - "name": "Lunyr" - } - }, - { - "symbol": "ethmco", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "mco", - "name": "Monaco" - } - }, - { - "symbol": "ethmtl", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "mtl", - "name": "Metal" - } - }, - { - "symbol": "ethmyst", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "myst", - "name": "Mysterium" - } - }, - { - "symbol": "ethnmr", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "nmr", - "name": "Numeraire" - } - }, - { - "symbol": "ethomg", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "omg", - "name": "OmiseGO" - } - }, - { - "symbol": "ethpay", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "pay", - "name": "TenX" - } - }, - { - "symbol": "ethptoy", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "ptoy", - "name": "Patientory" - } - }, - { - "symbol": "ethqrl", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "qrl", - "name": "Quantum-Resistant Ledger" - } - }, - { - "symbol": "ethqtum", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "qtum", - "name": "Qtum" - } - }, - { - "symbol": "ethrep", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "rep", - "name": "Augur" - } - }, - { - "symbol": "ethrlc", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "rlc", - "name": "iEx.ec" - } - }, - { - "symbol": "ethrub", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "rub", - "name": "Russian Ruble" - } - }, - { - "symbol": "ethsc", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "sc", - "name": "Siacoin" - } - }, - { - "symbol": "ethsngls", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "sngls", - "name": "SingularDTV" - } - }, - { - "symbol": "ethsnt", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "snt", - "name": "Status" - } - }, - { - "symbol": "ethsteem", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "steem", - "name": "Steem" - } - }, - { - "symbol": "ethstorj", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "storj", - "name": "Storj" - } - }, - { - "symbol": "ethtime", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "time", - "name": "ChronoBank" - } - }, - { - "symbol": "ethtkn", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "tkn", - "name": "TokenCard" - } - }, - { - "symbol": "ethtrst", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "trst", - "name": "WeTrust" - } - }, - { - "symbol": "ethuah", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "uah", - "name": "Ukrainian Hryvnia" - } - }, - { - "symbol": "ethusd", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "usd", - "name": "United States Dollar" - } - }, - { - "symbol": "ethwings", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "wings", - "name": "Wings" - } - }, - { - "symbol": "ethxem", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "xem", - "name": "NEM" - } - }, - { - "symbol": "ethxlm", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "xlm", - "name": "Stellar Lumen" - } - }, - { - "symbol": "ethxmr", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "xmr", - "name": "Monero" - } - }, - { - "symbol": "ethxrp", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "xrp", - "name": "Ripple" - } - }, - { - "symbol": "ethzec", - "base": { - "code": "eth", - "name": "Ethereum" - }, - "quote": { - "code": "zec", - "name": "Zcash" - } - } - ] -} diff --git a/ui/app/helpers/utils/transactions.util.js b/ui/app/helpers/utils/transactions.util.js index 1f8c6e952a50..f198635e7c7a 100644 --- a/ui/app/helpers/utils/transactions.util.js +++ b/ui/app/helpers/utils/transactions.util.js @@ -47,8 +47,7 @@ async function getMethodFrom4Byte (fourBytePrefix) { return null } } - -const registry = new MethodRegistry({ provider: global.ethereumProvider }) +let registry /** * Attempts to return the method data from the MethodRegistry library, the message registry library and the token abi, in that order of preference @@ -62,6 +61,10 @@ export async function getMethodDataAsync (fourBytePrefix) { return null }) + if (!registry) { + registry = new MethodRegistry({ provider: global.ethereumProvider }) + } + let sig = await registry.lookup(fourBytePrefix) if (!sig) { diff --git a/ui/app/pages/home/home.component.js b/ui/app/pages/home/home.component.js index e51c8217798a..f08a0bb47fda 100644 --- a/ui/app/pages/home/home.component.js +++ b/ui/app/pages/home/home.component.js @@ -4,7 +4,6 @@ import Media from 'react-media' import { Redirect } from 'react-router-dom' import { formatDate } from '../../helpers/utils/util' import HomeNotification from '../../components/app/home-notification' -import DaiMigrationNotification from '../../components/app/dai-migration-component' import MultipleNotifications from '../../components/app/multiple-notifications' import WalletView from '../../components/app/wallet-view' import TransactionView from '../../components/app/transaction-view' @@ -24,7 +23,6 @@ export default class Home extends PureComponent { static defaultProps = { unsetMigratedPrivacyMode: null, - hasDaiV1Token: false, } static propTypes = { @@ -45,7 +43,6 @@ export default class Home extends PureComponent { restoreFromThreeBox: PropTypes.func, setShowRestorePromptToFalse: PropTypes.func, threeBoxLastUpdated: PropTypes.number, - hasDaiV1Token: PropTypes.bool, } componentWillMount () { @@ -89,7 +86,6 @@ export default class Home extends PureComponent { forgottenPassword, providerRequests, history, - hasDaiV1Token, showPrivacyModeNotification, unsetMigratedPrivacyMode, shouldShowSeedPhraseReminder, @@ -176,11 +172,6 @@ export default class Home extends PureComponent { /> : null } - { - hasDaiV1Token - ? - : null - } ) diff --git a/ui/app/pages/home/home.container.js b/ui/app/pages/home/home.container.js index 4a2106a55b91..1bac780afeb8 100644 --- a/ui/app/pages/home/home.container.js +++ b/ui/app/pages/home/home.container.js @@ -3,7 +3,7 @@ import { compose } from 'recompose' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { unconfirmedTransactionsCountSelector } from '../../selectors/confirm-transaction' -import { getCurrentEthBalance, getDaiV1Token } from '../../selectors/selectors' +import { getCurrentEthBalance } from '../../selectors/selectors' import { unsetMigratedPrivacyMode, restoreFromThreeBox, @@ -44,7 +44,6 @@ const mapStateToProps = state => { showRestorePrompt, selectedAddress, threeBoxLastUpdated, - hasDaiV1Token: Boolean(getDaiV1Token(state)), } } diff --git a/ui/app/pages/send/send-content/add-recipient/ens-input.component.js b/ui/app/pages/send/send-content/add-recipient/ens-input.component.js index 11b9c5cb5beb..48a7d81525d3 100644 --- a/ui/app/pages/send/send-content/add-recipient/ens-input.component.js +++ b/ui/app/pages/send/send-content/add-recipient/ens-input.component.js @@ -7,7 +7,7 @@ import { ellipsify } from '../../send.utils' import debounce from 'debounce' import copyToClipboard from 'copy-to-clipboard/index' import ENS from 'ethjs-ens' -import networkMap from 'ethjs-ens/lib/network-map.json' +import networkMap from 'ethereum-ens-network-map' import log from 'loglevel' diff --git a/ui/app/pages/settings/networks-tab/networks-tab.constants.js b/ui/app/pages/settings/networks-tab/networks-tab.constants.js index 1a49ca04f06b..453a616b209b 100644 --- a/ui/app/pages/settings/networks-tab/networks-tab.constants.js +++ b/ui/app/pages/settings/networks-tab/networks-tab.constants.js @@ -17,21 +17,12 @@ const defaultNetworksData = [ ticker: 'ETH', blockExplorerUrl: 'https://ropsten.etherscan.io', }, - { - labelKey: 'kovan', - iconColor: '#9064FF', - providerType: 'kovan', - rpcUrl: 'https://api.infura.io/v1/jsonrpc/kovan', - chainId: '4', - ticker: 'ETH', - blockExplorerUrl: 'https://etherscan.io', - }, { labelKey: 'rinkeby', iconColor: '#F6C343', providerType: 'rinkeby', rpcUrl: 'https://api.infura.io/v1/jsonrpc/rinkeby', - chainId: '42', + chainId: '4', ticker: 'ETH', blockExplorerUrl: 'https://rinkeby.etherscan.io', }, @@ -44,6 +35,15 @@ const defaultNetworksData = [ ticker: 'ETH', blockExplorerUrl: 'https://goerli.etherscan.io', }, + { + labelKey: 'kovan', + iconColor: '#9064FF', + providerType: 'kovan', + rpcUrl: 'https://api.infura.io/v1/jsonrpc/kovan', + chainId: '42', + ticker: 'ETH', + blockExplorerUrl: 'https://etherscan.io', + }, { labelKey: 'localhost', iconColor: 'white', diff --git a/ui/app/pages/settings/settings-tab/settings-tab.component.js b/ui/app/pages/settings/settings-tab/settings-tab.component.js index f8daa98f9341..d62838a971be 100644 --- a/ui/app/pages/settings/settings-tab/settings-tab.component.js +++ b/ui/app/pages/settings/settings-tab/settings-tab.component.js @@ -1,15 +1,15 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' -import infuraCurrencies from '../../../helpers/constants/infura-conversion.json' +import availableCurrencies from '../../../helpers/constants/available-conversions' import SimpleDropdown from '../../../components/app/dropdowns/simple-dropdown' import ToggleButton from '../../../components/ui/toggle-button' import locales from '../../../../../app/_locales/index.json' -const sortedCurrencies = infuraCurrencies.objects.sort((a, b) => { - return a.quote.name.toLocaleLowerCase().localeCompare(b.quote.name.toLocaleLowerCase()) +const sortedCurrencies = availableCurrencies.sort((a, b) => { + return a.name.toLocaleLowerCase().localeCompare(b.name.toLocaleLowerCase()) }) -const infuraCurrencyOptions = sortedCurrencies.map(({ quote: { code, name } }) => { +const currencyOptions = sortedCurrencies.map(({ code, name }) => { return { displayValue: `${code.toUpperCase()} - ${name}`, key: code, @@ -63,7 +63,7 @@ export default class SettingsTab extends PureComponent {

setCurrentCurrency(newCurrency)} /> diff --git a/ui/app/selectors/selectors.js b/ui/app/selectors/selectors.js index d606b6db8a38..fab5f1dae114 100644 --- a/ui/app/selectors/selectors.js +++ b/ui/app/selectors/selectors.js @@ -49,7 +49,6 @@ const selectors = { getAccountType, getNumberOfAccounts, getNumberOfTokens, - getDaiV1Token, isEthereumNetwork, getMetaMetricState, getRpcPrefsForCurrentProvider, @@ -226,12 +225,6 @@ function getAddressBookEntryName (state, address) { return entry && entry.name !== '' ? entry.name : addressSlicer(address) } -function getDaiV1Token (state) { - const OLD_DAI_CONTRACT_ADDRESS = '0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359' - const tokens = state.metamask.tokens || [] - return tokens.find(({address}) => checksumAddress(address) === OLD_DAI_CONTRACT_ADDRESS) -} - function accountsWithSendEtherInfoSelector (state) { const accounts = getMetaMaskAccounts(state) const { identities } = state.metamask diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index 285216154564..19c9bfaea37f 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -367,7 +367,6 @@ var actions = { // AppStateController-related actions SET_LAST_ACTIVE_TIME: 'SET_LAST_ACTIVE_TIME', setLastActiveTime, - setMkrMigrationReminderTimestamp, getContractMethodData, loadingMethoDataStarted, @@ -2756,16 +2755,6 @@ function setLastActiveTime () { } } -function setMkrMigrationReminderTimestamp (timestamp) { - return (dispatch) => { - background.setMkrMigrationReminderTimestamp(timestamp, (err) => { - if (err) { - return dispatch(actions.displayWarning(err.message)) - } - }) - } -} - function loadingMethoDataStarted () { return { type: actions.LOADING_METHOD_DATA_STARTED, diff --git a/yarn.lock b/yarn.lock index 25712b7ed677..f83ad6d26e8f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10049,10 +10049,10 @@ eth-block-tracker@^4.4.2: pify "^3.0.0" safe-event-emitter "^1.0.1" -eth-contract-metadata@^1.11.0, eth-contract-metadata@^1.12.1: - version "1.12.1" - resolved "https://registry.yarnpkg.com/eth-contract-metadata/-/eth-contract-metadata-1.12.1.tgz#41014c8c0123453cee15acbcc14299c4d470c759" - integrity sha512-9u2jUcdxaKIv4RvA9RtjyD4+M2yWt4yCulR5bpdQTiG3HUFnN9lHtNL5NIRDpvQVJKerFhexrgEM2WdGP3a6VA== +eth-contract-metadata@^1.11.0, eth-contract-metadata@^1.13.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/eth-contract-metadata/-/eth-contract-metadata-1.13.0.tgz#9819d0e556ea2187da91d6b49ce96abc5fce2a73" + integrity sha512-9CjXHX8IdXysUEvOHdbCsjdAwM1E98jaeK2HeOqm/9S/vOZ8YryaBBt/YSiBq3MkpCwf+d1pEQ53p96rsdy52w== eth-ens-namehash@2.0.8, eth-ens-namehash@^2.0.8: version "2.0.8" @@ -10369,7 +10369,7 @@ ethereum-common@^0.0.18: resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.0.18.tgz#2fdc3576f232903358976eb39da783213ff9523f" integrity sha1-L9w1dvIykDNYl26znaeDIT/5Uj8= -ethereum-ens-network-map@^1.0.0: +ethereum-ens-network-map@^1.0.0, ethereum-ens-network-map@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/ethereum-ens-network-map/-/ethereum-ens-network-map-1.0.2.tgz#4e27bad18dae7bd95d84edbcac2c9e739fc959b9" integrity sha512-5qwJ5n3YhjSpE6O/WEBXCAb2nagUgyagJ6C0lGUBWC4LjKp/rRzD+pwtDJ6KCiITFEAoX4eIrWOjRy0Sylq5Hg==