Bundle optimazation 0 (#14782)

* optimism/contracts - import minimal subset

* ui helpers - dont import whole of mm controllers

* lint fix
feature/default_network_editable
kumavis 2 years ago committed by GitHub
parent 8185175968
commit 9e7c75d06d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      ui/helpers/utils/optimism/fetchEstimatedL1Fee.js
  2. 4
      ui/helpers/utils/util.js

@ -1,13 +1,14 @@
import * as ethers from 'ethers';
import * as optimismContracts from '@eth-optimism/contracts';
import { getContractFactory } from '@eth-optimism/contracts/dist/contract-defs';
import { predeploys } from '@eth-optimism/contracts/dist/predeploys';
import buildUnserializedTransaction from './buildUnserializedTransaction';
// The code in this file is largely drawn from https://community.optimism.io/docs/developers/l2/new-fees.html#for-frontend-and-wallet-developers
function buildOVMGasPriceOracleContract(eth) {
const OVMGasPriceOracle = optimismContracts
.getContractFactory('OVM_GasPriceOracle')
.attach(optimismContracts.predeploys.OVM_GasPriceOracle);
const OVMGasPriceOracle = getContractFactory('OVM_GasPriceOracle').attach(
predeploys.OVM_GasPriceOracle,
);
const abi = JSON.parse(
OVMGasPriceOracle.interface.format(ethers.utils.FormatTypes.json),
);

@ -3,7 +3,7 @@ import abi from 'human-standard-token-abi';
import BigNumber from 'bignumber.js';
import * as ethUtil from 'ethereumjs-util';
import { DateTime } from 'luxon';
import { util } from '@metamask/controllers';
import { getFormattedIpfsUrl } from '@metamask/controllers/dist/util';
import slip44 from '@metamask/slip44';
import { addHexPrefix } from '../../../app/scripts/lib/util';
import {
@ -557,7 +557,7 @@ export function getAssetImageURL(image, ipfsGateway) {
}
if (image.startsWith('ipfs://')) {
return util.getFormattedIpfsUrl(ipfsGateway, image, true);
return getFormattedIpfsUrl(ipfsGateway, image, true);
}
return image;
}

Loading…
Cancel
Save