Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions pvt/helpers/src/contract.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { ethers } from 'hardhat';
import { ethers, artifacts, Artifact } from 'hardhat';
import { Contract } from 'ethers';
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/dist/src/signer-with-address';

import { Artifacts } from 'hardhat/internal/artifacts';
import { Artifact } from 'hardhat/types';
import path from 'path';
import { Dictionary } from 'lodash';

Expand All @@ -30,7 +28,7 @@ export async function deploy(

const artifact = getArtifact(contract);

const factory = await ethers.getContractFactoryFromArtifact(artifact, { signer: from, libraries });
const factory = await ethers.getContractFactory(artifact.abi, artifact.bytecode, from);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also would need to send the libraries to link here: https://v2.hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-ethers

const instance = await factory.deploy(...args);

return instance.deployed();
Expand Down Expand Up @@ -67,7 +65,6 @@ export function getArtifact(contract: string): Artifact {
artifactsPath = `${packagePath}/artifacts`;
}

const artifacts = new Artifacts(artifactsPath);
return artifacts.readArtifactSync(contract.split('/').slice(-1)[0]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we don't need the artifactsPath anymore? how is the global artifacts linked to the path in this case, considering we have multiple workspaces in the monorepo?

}

Expand Down