diff --git a/app/components/Nav/Main/RootRPCMethodsUI.js b/app/components/Nav/Main/RootRPCMethodsUI.js index 086d3c3a61f..4604ab61f0c 100644 --- a/app/components/Nav/Main/RootRPCMethodsUI.js +++ b/app/components/Nav/Main/RootRPCMethodsUI.js @@ -25,7 +25,7 @@ import { getIsSwapApproveOrSwapTransaction, isApprovalTransaction, } from '../../../util/transactions'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import Logger from '../../../util/Logger'; import TransactionTypes from '../../../core/TransactionTypes'; import { swapsUtils } from '@metamask/swaps-controller'; diff --git a/app/components/UI/ConfirmAddAsset/ConfirmAddAsset.test.tsx b/app/components/UI/ConfirmAddAsset/ConfirmAddAsset.test.tsx index ed1a2f5fdc3..202f223366e 100644 --- a/app/components/UI/ConfirmAddAsset/ConfirmAddAsset.test.tsx +++ b/app/components/UI/ConfirmAddAsset/ConfirmAddAsset.test.tsx @@ -7,7 +7,7 @@ import renderWithProvider, { import useBalance from '../Ramp/hooks/useBalance'; import { toTokenMinimalUnit } from '../../../util/number'; import { fireEvent } from '@testing-library/react-native'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import { RootState } from '../../../reducers'; import { mockNetworkState } from '../../../util/test/network'; import { CHAIN_IDS } from '@metamask/transaction-controller'; diff --git a/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.test.tsx b/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.test.tsx index 9fb61eadebc..5f0faecdc96 100644 --- a/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.test.tsx +++ b/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Limits, Payment } from '@consensys/on-ramp-sdk'; import { act, fireEvent, screen } from '@testing-library/react-native'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import { renderScreen } from '../../../../../util/test/renderWithProvider'; import BuildQuote from './BuildQuote'; import useRegions from '../../hooks/useRegions'; diff --git a/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.tsx b/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.tsx index 04727253c4b..6b21b8a8361 100644 --- a/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.tsx +++ b/app/components/UI/Ramp/Views/BuildQuote/BuildQuote.tsx @@ -12,7 +12,7 @@ import Animated, { withTiming, } from 'react-native-reanimated'; import { useNavigation } from '@react-navigation/native'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import { useRampSDK } from '../../sdk'; import usePaymentMethods from '../../hooks/usePaymentMethods'; diff --git a/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.tsx b/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.tsx index ac4927aa503..33a3de63d78 100644 --- a/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.tsx +++ b/app/components/UI/Ramp/Views/SendTransaction/SendTransaction.tsx @@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { ImageSourcePropType, View } from 'react-native'; import { useDispatch, useSelector } from 'react-redux'; import { useNavigation } from '@react-navigation/native'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import { SellOrder } from '@consensys/on-ramp-sdk/dist/API'; import { TransactionParams, diff --git a/app/components/UI/Ramp/hooks/useGasPriceEstimation.ts b/app/components/UI/Ramp/hooks/useGasPriceEstimation.ts index 6c9565b94f6..e9fb3151bb8 100644 --- a/app/components/UI/Ramp/hooks/useGasPriceEstimation.ts +++ b/app/components/UI/Ramp/hooks/useGasPriceEstimation.ts @@ -5,7 +5,7 @@ import { type GasFeeController as GasFeeControllerType, } from '@metamask/gas-fee-controller'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import Engine from '../../../../core/Engine'; import { decGWEIToHexWEI } from '../../../../util/conversions'; import { selectGasFeeControllerState } from '../../../../selectors/gasFeeController'; diff --git a/app/components/UI/Ramp/hooks/useIntentAmount.ts b/app/components/UI/Ramp/hooks/useIntentAmount.ts index 7b024731c3d..4687ec8b134 100644 --- a/app/components/UI/Ramp/hooks/useIntentAmount.ts +++ b/app/components/UI/Ramp/hooks/useIntentAmount.ts @@ -1,5 +1,5 @@ import { useEffect } from 'react'; -import { type BN } from 'ethereumjs-util'; +import { type BN } from 'bn.js'; import { useRampSDK } from '../sdk'; import parseAmount from '../utils/parseAmount'; import { toTokenMinimalUnit } from '../../../../util/number'; diff --git a/app/components/UI/Stake/Views/StakeInputView/StakeInputView.test.tsx b/app/components/UI/Stake/Views/StakeInputView/StakeInputView.test.tsx index 9648fba601e..de6efc72dda 100644 --- a/app/components/UI/Stake/Views/StakeInputView/StakeInputView.test.tsx +++ b/app/components/UI/Stake/Views/StakeInputView/StakeInputView.test.tsx @@ -4,7 +4,7 @@ import StakeInputView from './StakeInputView'; import { renderScreen } from '../../../../../util/test/renderWithProvider'; import Routes from '../../../../../constants/navigation/Routes'; import { backgroundState } from '../../../../../util/test/initial-root-state'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import { Stake } from '../../sdk/stakeSdkProvider'; function render(Component: React.ComponentType) { diff --git a/app/components/UI/Stake/Views/UnstakeInputView/UnstakeInputView.tsx b/app/components/UI/Stake/Views/UnstakeInputView/UnstakeInputView.tsx index c109940d3a5..360389389ff 100644 --- a/app/components/UI/Stake/Views/UnstakeInputView/UnstakeInputView.tsx +++ b/app/components/UI/Stake/Views/UnstakeInputView/UnstakeInputView.tsx @@ -1,6 +1,6 @@ import { useNavigation } from '@react-navigation/native'; import React, { useCallback, useEffect } from 'react'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import UnstakeInputViewBanner from './UnstakeBanner'; import { strings } from '../../../../../../locales/i18n'; import Button, { diff --git a/app/components/UI/Stake/components/StakingBalance/StakingBalance.tsx b/app/components/UI/Stake/components/StakingBalance/StakingBalance.tsx index 8884688694b..ecc3bdddb02 100644 --- a/app/components/UI/Stake/components/StakingBalance/StakingBalance.tsx +++ b/app/components/UI/Stake/components/StakingBalance/StakingBalance.tsx @@ -25,7 +25,7 @@ import { strings } from '../../../../../../locales/i18n'; import { renderFromWei } from '../../../../../util/number'; import { getTimeDifferenceFromNow } from '../../../../../util/date'; import { filterExitRequests } from './utils'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import bn from 'bignumber.js'; import { CommonPercentageInputUnits, diff --git a/app/components/UI/Stake/hooks/useStakingInput.ts b/app/components/UI/Stake/hooks/useStakingInput.ts index d9d233d19af..1631969ec64 100644 --- a/app/components/UI/Stake/hooks/useStakingInput.ts +++ b/app/components/UI/Stake/hooks/useStakingInput.ts @@ -1,4 +1,4 @@ -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import { useState, useMemo, useCallback } from 'react'; import { useSelector } from 'react-redux'; import { diff --git a/app/components/UI/Tokens/TokenList/PortfolioBalance/index.test.tsx b/app/components/UI/Tokens/TokenList/PortfolioBalance/index.test.tsx index e1e1f694376..52e18f9619a 100644 --- a/app/components/UI/Tokens/TokenList/PortfolioBalance/index.test.tsx +++ b/app/components/UI/Tokens/TokenList/PortfolioBalance/index.test.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { fireEvent } from '@testing-library/react-native'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import renderWithProvider from '../../../../../util/test/renderWithProvider'; import { backgroundState } from '../../../../../util/test/initial-root-state'; import AppConstants from '../../../../../../app/core/AppConstants'; diff --git a/app/components/UI/Tokens/index.test.tsx b/app/components/UI/Tokens/index.test.tsx index 0934c8df253..5af3f9949da 100644 --- a/app/components/UI/Tokens/index.test.tsx +++ b/app/components/UI/Tokens/index.test.tsx @@ -2,7 +2,7 @@ import React from 'react'; // eslint-disable-next-line @typescript-eslint/no-shadow import { fireEvent, waitFor } from '@testing-library/react-native'; import Tokens from './'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import renderWithProvider from '../../../util/test/renderWithProvider'; import { createStackNavigator } from '@react-navigation/stack'; import { getAssetTestId } from '../../../../wdio/screen-objects/testIDs/Screens/WalletView.testIds'; diff --git a/app/components/Views/confirmations/Approval/components/TransactionEditor/index.js b/app/components/Views/confirmations/Approval/components/TransactionEditor/index.js index 5e607dfbef8..622ecfd156f 100644 --- a/app/components/Views/confirmations/Approval/components/TransactionEditor/index.js +++ b/app/components/Views/confirmations/Approval/components/TransactionEditor/index.js @@ -3,14 +3,15 @@ import { StyleSheet, View } from 'react-native'; import PropTypes from 'prop-types'; import AnimatedTransactionModal from '../../../../../UI/AnimatedTransactionModal'; import TransactionReview from '../../../components/TransactionReview'; +import { BN } from 'bn.js'; import { hexToBN, fromWei, renderFromWei, toHexadecimal, } from '../../../../../../util/number'; -import { isValidAddress, BN, addHexPrefix } from 'ethereumjs-util'; import { strings } from '../../../../../../../locales/i18n'; +import { isValidAddress, addHexPrefix } from 'ethereumjs-util'; import { connect } from 'react-redux'; import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; import { diff --git a/app/components/Views/confirmations/SendFlow/Amount/index.js b/app/components/Views/confirmations/SendFlow/Amount/index.js index 98741587ed3..a86194f4c26 100644 --- a/app/components/Views/confirmations/SendFlow/Amount/index.js +++ b/app/components/Views/confirmations/SendFlow/Amount/index.js @@ -60,7 +60,7 @@ import CollectibleMedia from '../../../../UI/CollectibleMedia'; import collectiblesTransferInformation from '../../../../../util/collectibles-transfer'; import { strings } from '../../../../../../locales/i18n'; import Device from '../../../../../util/device'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import { MetaMetricsEvents } from '../../../../../core/Analytics'; import dismissKeyboard from 'react-native/Libraries/Utilities/dismissKeyboard'; import NetworkMainAssetLogo from '../../../../UI/NetworkMainAssetLogo'; diff --git a/app/components/Views/confirmations/SendFlow/Confirm/validation.test.ts b/app/components/Views/confirmations/SendFlow/Confirm/validation.test.ts index e9ed1b98278..d88d1734292 100644 --- a/app/components/Views/confirmations/SendFlow/Confirm/validation.test.ts +++ b/app/components/Views/confirmations/SendFlow/Confirm/validation.test.ts @@ -1,4 +1,4 @@ -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import { validateSufficientBalance, validateSufficientTokenBalance } from './validation'; import { renderFromWei, hexToBN } from '../../../../../util/number'; import { diff --git a/app/components/Views/confirmations/SendFlow/Confirm/validation.ts b/app/components/Views/confirmations/SendFlow/Confirm/validation.ts index 884c939441e..501657ff73a 100644 --- a/app/components/Views/confirmations/SendFlow/Confirm/validation.ts +++ b/app/components/Views/confirmations/SendFlow/Confirm/validation.ts @@ -4,7 +4,7 @@ import { decodeTransferData, } from '../../../../../util/transactions'; import { strings } from '../../../../../../locales/i18n'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; interface SelectedAsset { address: string; diff --git a/app/components/hooks/useAddressBalance/useAddressBalance.test.tsx b/app/components/hooks/useAddressBalance/useAddressBalance.test.tsx index f3f8592d8a8..fc41558f95f 100644 --- a/app/components/hooks/useAddressBalance/useAddressBalance.test.tsx +++ b/app/components/hooks/useAddressBalance/useAddressBalance.test.tsx @@ -8,7 +8,7 @@ import { Asset } from './useAddressBalance.types'; import useAddressBalance from './useAddressBalance'; import backgroundState from '../../../util/test/initial-root-state'; import { createMockAccountsControllerState } from '../../../util/test/accountsControllerTestUtils'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; const MOCK_ADDRESS_1 = '0x0'; const MOCK_ADDRESS_2 = '0x1'; diff --git a/app/components/hooks/useTokenBalance.tsx b/app/components/hooks/useTokenBalance.tsx index 8962c9ce352..6640abaf214 100644 --- a/app/components/hooks/useTokenBalance.tsx +++ b/app/components/hooks/useTokenBalance.tsx @@ -1,6 +1,6 @@ import { useState, useEffect, Dispatch, SetStateAction } from 'react'; import Engine from '../../core/Engine'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; /** * Hook to handle the balance of ERC20 tokens diff --git a/app/components/hooks/useTokenBalancesController/useTokenBalancesController.test.tsx b/app/components/hooks/useTokenBalancesController/useTokenBalancesController.test.tsx index b575c66c4cc..ec76f1af8ee 100644 --- a/app/components/hooks/useTokenBalancesController/useTokenBalancesController.test.tsx +++ b/app/components/hooks/useTokenBalancesController/useTokenBalancesController.test.tsx @@ -4,7 +4,7 @@ import { Provider } from 'react-redux'; import { createStore, Store } from 'redux'; import { act, render, waitFor } from '@testing-library/react-native'; import useTokenBalancesController from './useTokenBalancesController'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import { cloneDeep } from 'lodash'; import { backgroundState } from '../../../util/test/initial-root-state'; diff --git a/app/constants/transaction.ts b/app/constants/transaction.ts index 92bde7b1648..b4d14b2d56a 100644 --- a/app/constants/transaction.ts +++ b/app/constants/transaction.ts @@ -1,4 +1,4 @@ -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; // Transaction Status export const TX_UNAPPROVED = 'unapproved'; diff --git a/app/store/migrations/029.ts b/app/store/migrations/029.ts index af4f1ebf1ba..28f56e47092 100644 --- a/app/store/migrations/029.ts +++ b/app/store/migrations/029.ts @@ -2,7 +2,6 @@ import { toHex } from '@metamask/controller-utils'; import { Hex, hasProperty, isObject } from '@metamask/utils'; import { regex } from '../../../app/util/regex'; -//@ts-expect-error - This error is expected, but ethereumjs-util exports this function import { isHexString } from 'ethereumjs-util'; import { TransactionParams } from '@metamask/transaction-controller'; import { captureException } from '@sentry/react-native'; @@ -466,7 +465,7 @@ export default async function migrate(stateAsync: unknown) { if (Array.isArray(transactionControllerState.transactions)) { transactionControllerState.transactions.forEach( (transaction: TransactionParams, index: number) => { - if (transaction && !isHexString(transaction.chainId)) { + if (transaction && (!transaction.chainId || (transaction.chainId && !isHexString(transaction.chainId)))) { if ( Array.isArray(transactionControllerState.transactions) && isObject(transactionControllerState.transactions[index]) diff --git a/app/store/migrations/031.ts b/app/store/migrations/031.ts index ba4b06ca119..0ad5dcdf64e 100644 --- a/app/store/migrations/031.ts +++ b/app/store/migrations/031.ts @@ -6,7 +6,6 @@ import { TokensControllerState, } from '@metamask/assets-controllers'; import { toHex } from '@metamask/controller-utils'; -//@ts-expect-error - This error is expected, but ethereumjs-util exports this function import { isHexString } from 'ethereumjs-util'; /** diff --git a/app/util/address/index.ts b/app/util/address/index.ts index d34f848d195..97549ae9da4 100644 --- a/app/util/address/index.ts +++ b/app/util/address/index.ts @@ -3,7 +3,6 @@ import { isValidAddress, addHexPrefix, isValidChecksumAddress, - //@ts-expect-error - This error is expected, but ethereumjs-util exports this function isHexPrefixed, } from 'ethereumjs-util'; import punycode from 'punycode/punycode'; diff --git a/app/util/confirmation/transactions.test.ts b/app/util/confirmation/transactions.test.ts index 1c124ff1fd6..f4b730ff468 100644 --- a/app/util/confirmation/transactions.test.ts +++ b/app/util/confirmation/transactions.test.ts @@ -1,4 +1,4 @@ -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import { buildTransactionParams } from './transactions'; import { GAS_ESTIMATE_TYPES } from '@metamask/gas-fee-controller'; import { TransactionEnvelopeType } from '@metamask/transaction-controller'; diff --git a/app/util/conversion/index.js b/app/util/conversion/index.js index 4046c727724..7040fd58535 100644 --- a/app/util/conversion/index.js +++ b/app/util/conversion/index.js @@ -23,7 +23,8 @@ import BigNumber from 'bignumber.js'; -import { stripHexPrefix, BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; +import { stripHexPrefix } from 'etehreumjs-util'; // Big Number Constants const BIG_NUMBER_WEI_MULTIPLIER = new BigNumber('1000000000000000000'); diff --git a/app/util/custom-gas/index.js b/app/util/custom-gas/index.js index 3583b88fab3..14335731d83 100644 --- a/app/util/custom-gas/index.js +++ b/app/util/custom-gas/index.js @@ -1,4 +1,4 @@ -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import { renderFromWei, weiToFiat, toWei, conversionUtil } from '../number'; import { strings } from '../../../locales/i18n'; import TransactionTypes from '../../core/TransactionTypes'; diff --git a/app/util/dappTransactions/index.test.ts b/app/util/dappTransactions/index.test.ts index f4c625d0518..22526e2d895 100644 --- a/app/util/dappTransactions/index.test.ts +++ b/app/util/dappTransactions/index.test.ts @@ -1,4 +1,4 @@ -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import { strings } from '../../../locales/i18n'; import Engine from '../../core/Engine'; diff --git a/app/util/dappTransactions/index.ts b/app/util/dappTransactions/index.ts index d2d93d8fd74..dd741eb1d8d 100644 --- a/app/util/dappTransactions/index.ts +++ b/app/util/dappTransactions/index.ts @@ -4,7 +4,7 @@ import Engine from '../../core/Engine'; import TransactionTypes from '../../core/TransactionTypes'; import { toLowerCaseEquals } from '../general'; import { strings } from '../../../locales/i18n'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import { lt } from '../lodash'; import { estimateGas as controllerEstimateGas } from '../transaction-controller'; diff --git a/app/util/number/index.js b/app/util/number/index.js index a4ce4d98e05..6feee1958bb 100644 --- a/app/util/number/index.js +++ b/app/util/number/index.js @@ -1,7 +1,8 @@ /** * Collection of utility functions for consistent formatting and conversion */ -import { BN, stripHexPrefix } from 'ethereumjs-util'; +import { BN } from 'bn.js'; +import { stripHexPrefix } from 'ethereumjs-util'; import { utils as ethersUtils } from 'ethers'; import convert from 'ethjs-unit'; import { @@ -367,7 +368,7 @@ export function isDecimal(value) { * @returns {Object} - BN instance */ export function toBN(value) { - return new BN(value); + return new BN(value || 0); } /** diff --git a/app/util/number/index.test.ts b/app/util/number/index.test.ts index 436f18c0c29..e050c763ff5 100644 --- a/app/util/number/index.test.ts +++ b/app/util/number/index.test.ts @@ -1,4 +1,4 @@ -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import { addCurrencySymbol, diff --git a/app/util/transaction-reducer-helpers.ts b/app/util/transaction-reducer-helpers.ts index 562fa6db9a7..6c3af5a5ac8 100644 --- a/app/util/transaction-reducer-helpers.ts +++ b/app/util/transaction-reducer-helpers.ts @@ -1,5 +1,5 @@ import { SecurityAlertResponse } from '@metamask/transaction-controller'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; interface TxMeta { data?: string; diff --git a/app/util/transactions/index.js b/app/util/transactions/index.js index 71614e75e97..5a4dfec1f57 100644 --- a/app/util/transactions/index.js +++ b/app/util/transactions/index.js @@ -1,5 +1,6 @@ -import { addHexPrefix, toChecksumAddress, BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; import { rawEncode, rawDecode } from 'ethereumjs-abi'; +import { addHexPrefix, toChecksumAddress } from 'ethereumjs-util'; import BigNumber from 'bignumber.js'; import humanizeDuration from 'humanize-duration'; import { diff --git a/app/util/transactions/index.test.ts b/app/util/transactions/index.test.ts index 2f8415f8871..2fd31d69575 100644 --- a/app/util/transactions/index.test.ts +++ b/app/util/transactions/index.test.ts @@ -1,5 +1,5 @@ import { swapsUtils } from '@metamask/swaps-controller'; -import { BN } from 'ethereumjs-util'; +import { BN } from 'bn.js'; /* eslint-disable-next-line import/no-namespace */ import * as controllerUtilsModule from '@metamask/controller-utils'; diff --git a/package.json b/package.json index 22e0511d140..cf145b508eb 100644 --- a/package.json +++ b/package.json @@ -110,6 +110,7 @@ "@metamask/accounts-controller": "^18.1.0", "@metamask/contract-metadata": "^2.1.0", "@metamask/react-native-payments/validator": "^13.7.0", + "**/ethereumjs-abi": "npm:ethereumjs-abi@0.6.8", "**/minimist": "1.2.6", "d3-color": "3.1.0", "tough-cookie": "4.1.3", @@ -129,7 +130,8 @@ "react-native/ws": "^6.2.3", "socket.io-client/engine.io-client/ws": "^8.17.1", "micromatch": "4.0.8", - "send": "0.19.0" + "send": "0.19.0", + "**/secp256k1": "4.0.4" }, "dependencies": { "@consensys/on-ramp-sdk": "1.28.5", @@ -223,6 +225,7 @@ "axios": "^1.6.8", "base-64": "1.0.0", "bignumber.js": "^9.0.1", + "bn.js": "5.2.1", "buffer": "6.0.3", "cockatiel": "^3.1.2", "compare-versions": "^3.6.0", @@ -237,8 +240,8 @@ "eth-json-rpc-filters": "4.2.2", "eth-json-rpc-middleware": "4.3.0", "eth-url-parser": "1.0.4", - "ethereumjs-abi": "0.6.6", - "ethereumjs-util": "6.1.0", + "ethereumjs-abi": "^0.6.8", + "ethereumjs-util": "^7.1.5", "ethers": "^5.0.14", "ethjs-contract": "0.2.3", "ethjs-ens": "2.0.1", @@ -534,7 +537,7 @@ }, "lavamoat": { "allowScripts": { - "ethereumjs-abi>ethereumjs-util>ethereum-cryptography>keccak": true, + "ethereumjs-util>ethereum-cryptography>keccak": true, "@sentry/react-native>@sentry/cli": true, "@storybook/manager-webpack5>@storybook/core-common>webpack>watchpack>watchpack-chokidar2>chokidar>fsevents": false, "@storybook/addon-controls>@storybook/core-common>esbuild": false, @@ -553,8 +556,6 @@ "detox": true, "detox>bunyan>dtrace-provider": false, "eciesjs>secp256k1": true, - "ethereumjs-util>keccak": true, - "ethereumjs-util>secp256k1": true, "ethjs-query>babel-runtime>core-js": false, "ganache>@trufflesuite/bigint-buffer": false, "ganache>bufferutil": false, diff --git a/yarn.lock b/yarn.lock index dcd0616c19b..728a9dca060 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13305,20 +13305,6 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== -bindings@^1.2.1, bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - -bip66@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.5.tgz#01fa8748785ca70955d5011217d1b3139969ca22" - integrity sha512-nemMHz95EmS38a26XbbdxIYj5csHd3RMP3H5bwQknX0WYHF01qhpufP42mLOwVICuH2JmhIhXiWs89MfUGL7Xw== - dependencies: - safe-buffer "^5.0.1" - bl@^1.2.3, bl@~0.8.1: version "1.2.3" resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.3.tgz#1e8dd80142eac80d7158c9dccc047fb620e035e7" @@ -13366,7 +13352,7 @@ bn.js@5.2.1, bn.js@^5.0.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== @@ -13464,7 +13450,7 @@ browser-process-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== -browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.0.6, browserify-aes@^1.2.0: +browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== @@ -15971,15 +15957,6 @@ dotenv@^16.0.0, dotenv@^16.0.3: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e" integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ== -drbg.js@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/drbg.js/-/drbg.js-1.0.1.tgz#3e36b6c42b37043823cdbc332d58f31e2445480b" - integrity sha512-F4wZ06PvqxYLFEZKkFxTDcns9oFNk34hvmJSEwdzsxVQ8YI5YaxtACgQatkYgv2VI2CFkUd2Y+xosPQnHv809g== - dependencies: - browserify-aes "^1.0.6" - create-hash "^1.1.2" - create-hmac "^1.1.4" - dset@^3.1.1: version "3.1.4" resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.4.tgz#f8eaf5f023f068a036d08cd07dc9ffb7d0065248" @@ -17146,17 +17123,10 @@ ethereum-ens-network-map@^1.0.0: resolved "https://registry.yarnpkg.com/ethereum-ens-network-map/-/ethereum-ens-network-map-1.0.2.tgz#4e27bad18dae7bd95d84edbcac2c9e739fc959b9" integrity sha512-5qwJ5n3YhjSpE6O/WEBXCAb2nagUgyagJ6C0lGUBWC4LjKp/rRzD+pwtDJ6KCiITFEAoX4eIrWOjRy0Sylq5Hg== -ethereumjs-abi@0.6.6: - version "0.6.6" - resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.6.tgz#f8ba3413a98478173f5a00f7f1316819db1d09ec" - integrity sha512-w8KubDsA/+OAuqtIR9RGsMcoZ5nhM8vxwjJAJvEIY+clhxA3BHoLG3+ClYQaQhD0n3mlDt3U5rBrmSVJvI3c8A== - dependencies: - bn.js "^4.10.0" - ethereumjs-util "^5.0.0" - -"ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git": +ethereumjs-abi@^0.6.8, "ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git", "ethereumjs-abi@npm:ethereumjs-abi@0.6.8": version "0.6.8" - resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#ee3994657fa7a427238e6ba92a84d0b529bbcde0" + resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" + integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== dependencies: bn.js "^4.11.8" ethereumjs-util "^6.0.0" @@ -17213,19 +17183,6 @@ ethereumjs-tx@^2.1.1: ethereumjs-common "^1.5.0" ethereumjs-util "^6.0.0" -ethereumjs-util@6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz#e9c51e5549e8ebd757a339cc00f5380507e799c8" - integrity sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q== - dependencies: - bn.js "^4.11.0" - create-hash "^1.1.2" - ethjs-util "0.1.6" - keccak "^1.0.2" - rlp "^2.0.0" - safe-buffer "^5.1.1" - secp256k1 "^3.0.1" - ethereumjs-util@^5.0.0, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.2: version "5.2.1" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz#a833f0e5fca7e5b361384dc76301a721f537bf65" @@ -17252,7 +17209,7 @@ ethereumjs-util@^6.0.0: ethjs-util "0.1.6" rlp "^2.2.3" -ethereumjs-util@^7.0.10, ethereumjs-util@^7.0.8, ethereumjs-util@^7.1.2: +ethereumjs-util@^7.0.10, ethereumjs-util@^7.0.8, ethereumjs-util@^7.1.2, ethereumjs-util@^7.1.5: version "7.1.5" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz#9ecf04861e4fbbeed7465ece5f23317ad1129181" integrity sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg== @@ -17993,11 +17950,6 @@ file-type@^9.0.0: resolved "https://registry.yarnpkg.com/file-type/-/file-type-9.0.0.tgz#a68d5ad07f486414dfb2c8866f73161946714a18" integrity sha512-Qe/5NJrgIOlwijpq3B7BEpzPFcgzggOTagZmkXQY4LA6bsXKTUstK7Wp12lEJ/mLKTpvIZxmIuRcLYWT6ov9lw== -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - filelist@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.4.tgz#f78978a1e944775ff9e62e744424f215e58352b5" @@ -21323,16 +21275,6 @@ keccak@3.0.2, keccak@^3.0.0: node-gyp-build "^4.2.0" readable-stream "^3.6.0" -keccak@^1.0.2: - version "1.4.0" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-1.4.0.tgz#572f8a6dbee8e7b3aa421550f9e6408ca2186f80" - integrity sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw== - dependencies: - bindings "^1.2.1" - inherits "^2.0.3" - nan "^2.2.1" - safe-buffer "^5.1.0" - keygrip@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/keygrip/-/keygrip-1.1.0.tgz#871b1681d5e159c62a445b0c74b615e0917e7226" @@ -23088,7 +23030,7 @@ mz@^2.7.0: object-assign "^4.0.1" thenify-all "^1.0.0" -nan@^2.14.0, nan@^2.2.1: +nan@^2.14.0: version "2.20.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.20.0.tgz#08c5ea813dd54ed16e5bd6505bf42af4f7838ca3" integrity sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw== @@ -23208,6 +23150,11 @@ node-addon-api@^2.0.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== +node-addon-api@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.1.0.tgz#49da1ca055e109a23d537e9de43c09cca21eb762" + integrity sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA== + node-addon-api@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-6.1.0.tgz#ac8470034e58e67d0c6f1204a18ae6995d9c0d76" @@ -26999,29 +26946,15 @@ scrypt-js@3.0.1, scrypt-js@^3.0.0, scrypt-js@^3.0.1: resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== -secp256k1@4.0.3, secp256k1@^4.0.0, secp256k1@^4.0.1, secp256k1@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" - integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== +secp256k1@4.0.3, secp256k1@4.0.4, secp256k1@^4.0.0, secp256k1@^4.0.1, secp256k1@^4.0.3: + version "4.0.4" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.4.tgz#58f0bfe1830fe777d9ca1ffc7574962a8189f8ab" + integrity sha512-6JfvwvjUOn8F/jUoBY2Q1v5WY5XS+rj8qSe0v8Y4ezH4InLgTEeOOPQsRll9OV429Pvo6BCHGavIyJfr3TAhsw== dependencies: - elliptic "^6.5.4" - node-addon-api "^2.0.0" + elliptic "^6.5.7" + node-addon-api "^5.0.0" node-gyp-build "^4.2.0" -secp256k1@^3.0.1: - version "3.8.0" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.8.0.tgz#28f59f4b01dbee9575f56a47034b7d2e3b3b352d" - integrity sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw== - dependencies: - bindings "^1.5.0" - bip66 "^1.1.5" - bn.js "^4.11.8" - create-hash "^1.2.0" - drbg.js "^1.0.1" - elliptic "^6.5.2" - nan "^2.14.0" - safe-buffer "^5.1.2" - seed-random@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/seed-random/-/seed-random-2.2.0.tgz#2a9b19e250a817099231a5b99a4daf80b7fbed54"