Skip to content

Commit

Permalink
chore: update ERC-20 token list
Browse files Browse the repository at this point in the history
The package eth-contract-metadata has been deprecated, and replaced
with @metamask/contract-metadata.

Fixes brave/brave-browser#15688.
  • Loading branch information
onyb committed May 9, 2021
1 parent d0edf56 commit 1276cf4
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app/scripts/controllers/detect-tokens.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Web3 from 'web3'
import contracts from 'eth-contract-metadata'
import contracts from '@metamask/contract-metadata'
import { warn } from 'loglevel'
import { MAINNET } from './network/enums'
// By default, poll every 3 minutes
Expand All @@ -25,7 +25,7 @@ export default class DetectTokensController {
}

/**
* For each token in eth-contract-metadata, find check selectedAddress balance.
* For each token in @metamask/contract-metadata, find check selectedAddress balance.
*/
async detectNewTokens () {
if (!this.isActive) {
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import TrezorKeyring from 'eth-trezor-keyring'
import LedgerBridgeKeyring from '@metamask/eth-ledger-bridge-keyring'
import EthQuery from 'eth-query'
import nanoid from 'nanoid'
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'

import {
AddressBookController,
Expand Down
2 changes: 1 addition & 1 deletion development/build/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const copyTargets = [
dest: `images`,
},
{
src: `./node_modules/eth-contract-metadata/images/`,
src: `./node_modules/@metamask/contract-metadata/images/`,
dest: `images/contract`,
},
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"@formatjs/intl-relativetimeformat": "^5.2.6",
"@fortawesome/fontawesome-free": "^5.13.0",
"@material-ui/core": "^4.11.0",
"@metamask/contract-metadata": "^1.25.0",
"@metamask/controllers": "^2.0.5",
"@metamask/eth-ledger-bridge-keyring": "^0.2.6",
"@metamask/etherscan-link": "^1.1.0",
Expand Down Expand Up @@ -110,7 +111,6 @@
"dnode": "^1.2.2",
"end-of-stream": "^1.4.4",
"eth-block-tracker": "^4.4.2",
"eth-contract-metadata": "^1.16.0",
"eth-ens-namehash": "^2.0.8",
"eth-json-rpc-errors": "^2.0.2",
"eth-json-rpc-filters": "^4.1.1",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/app/controllers/detect-tokens-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import assert from 'assert'
import nock from 'nock'
import sinon from 'sinon'
import ObservableStore from 'obs-store'
import contracts from 'eth-contract-metadata'
import contracts from '@metamask/contract-metadata'
import BigNumber from 'bignumber.js'

import DetectTokensController from '../../../../app/scripts/controllers/detect-tokens'
Expand Down
2 changes: 1 addition & 1 deletion ui/app/components/ui/identicon/identicon.component.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'

import BlockieIdenticon from './blockieIdenticon'
import { checksumAddress } from '../../../helpers/utils/util'
Expand Down
2 changes: 1 addition & 1 deletion ui/app/helpers/utils/token-util.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import log from 'loglevel'
import * as util from './util'
import BigNumber from 'bignumber.js'
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'
import { conversionUtil, multiplyCurrencies } from './conversion-util'
import { formatCurrency } from './confirm-tx.util'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'
import Fuse from 'fuse.js'
import InputAdornment from '@material-ui/core/InputAdornment'
import TextField from '../../../components/ui/text-field'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { connect } from 'react-redux'
import { compose } from 'redux'
import { withRouter } from 'react-router-dom'
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'
import ConfirmTransactionBase from './confirm-transaction-base.component'
import {
clearConfirmTransaction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {

import { isValidAddress, isEthNetwork, checkExistingAddresses } from '../../../../helpers/utils/util'
import ethUtil from 'ethereumjs-util'
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'

export function getToErrorObject (to, hasHexData = false, network) {
let toError = null
Expand Down
2 changes: 1 addition & 1 deletion ui/lib/icon-factory.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
let iconFactory
import { isValidAddress } from 'ethereumjs-util'
import { checksumAddress } from '../app/helpers/utils/util'
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'

export default function iconFactoryGenerator (jazzicon) {
if (!iconFactory) {
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,11 @@
resolved "https://registry.yarnpkg.com/@metamask/contract-metadata/-/contract-metadata-1.22.0.tgz#55cc84756c703c433176b484b1d34f0e03d16d1e"
integrity sha512-t4ijbU+4OH9UAlrPkfLPFo6KmkRTRZJHB+Vly4ajF8oZMnota5YjVVl/SmltsoRC9xvJtRn9DUVf3YMHMIdofw==

"@metamask/contract-metadata@^1.25.0":
version "1.25.0"
resolved "https://registry.yarnpkg.com/@metamask/contract-metadata/-/contract-metadata-1.25.0.tgz#442ace91fb40165310764b68d8096d0017bb0492"
integrity sha512-yhmYB9CQPv0dckNcPoWDcgtrdUp0OgK0uvkRE5QIBv4b3qENI1/03BztvK2ijbTuMlORUpjPq7/1MQDUPoRPVw==

"@metamask/controllers@^2.0.5":
version "2.0.5"
resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-2.0.5.tgz#302dbae0595b269f2660253ee40c4c7f9bce069e"
Expand Down Expand Up @@ -9083,7 +9088,7 @@ 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.16.0:
eth-contract-metadata@^1.11.0:
version "1.17.0"
resolved "https://registry.yarnpkg.com/eth-contract-metadata/-/eth-contract-metadata-1.17.0.tgz#96d4b056ac9a7175eeba091dbabd0713cfd4c703"
integrity sha512-vlw4OiW3+9J3kJfEtPCyiSW9fhdWTqrAhXcvdMY2CevGxbhvOd5Lz59DeWerSTV3IoSXttghDurPA76dAeTV+A==
Expand Down

0 comments on commit 1276cf4

Please sign in to comment.