diff --git a/src/helpers.ts b/src/helpers.ts index e6ece18c..7907f2d3 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -40,7 +40,7 @@ import { } from '../types'; import {PartialExtension} from './internal/types'; import {UnknownSignerError} from './errors'; -import {mergeABIs, recode} from './utils'; +import {mergeABIs, recode, getArtifactFromFolders} from './utils'; import fs from 'fs-extra'; import OpenZeppelinTransparentProxy from '../extendedArtifacts/TransparentUpgradeableProxy.json'; @@ -495,7 +495,11 @@ export function addHelpers( if (options.contract) { if (typeof options.contract === 'string') { artifactName = options.contract; - artifact = await getArtifact(artifactName); + if (options.importPath) { + artifact = await getArtifactFromFolders(artifactName, [options.importPath]) as Artifact; + } else { + artifact = await getArtifact(artifactName); + } } else { artifact = options.contract as Artifact; // TODO better handling } @@ -614,7 +618,7 @@ export function addHelpers( ); await setupGasPrice(unsignedTx); await setupNonce(from, unsignedTx); - + // Temporary workaround for https://github.com/ethers-io/ethers.js/issues/2078 // TODO: Remove me when LedgerSigner adds proper support for 1559 txns if (hardwareWallet === 'ledger') { diff --git a/types.ts b/types.ts index f9b167b3..f6099d54 100644 --- a/types.ts +++ b/types.ts @@ -151,6 +151,7 @@ export type ArtifactData = { export interface DeployOptionsBase extends TxOptions { contract?: string | ArtifactData; + importPath?: string; args?: any[]; skipIfAlreadyDeployed?: boolean; linkedData?: any; // JSONable ?