mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +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:
parent
8185175968
commit
9e7c75d06d
@ -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…
Reference in New Issue
Block a user