1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

Bundle optimazation 0 (#14782)

* optimism/contracts - import minimal subset

* ui helpers - dont import whole of mm controllers

* lint fix
This commit is contained in:
kumavis 2022-07-29 19:37:29 -10:00 committed by GitHub
parent 8185175968
commit 9e7c75d06d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -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),
);

View File

@ -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;
}