Skip to content

Type error with platform.deployContract #793

@ericglau

Description

@ericglau

When using platform.deployContract in typescript, a type error occurs.

Example:

import { ethers, platform } from "hardhat";

async function main() {
  const ContractFactory = await ethers.getContractFactory("MyToken");

  const instance = await platform.deployContract(ContractFactory);
  await instance.deployed();

  console.log(`Proxy deployed to ${instance.address}`);
}

cause type error:

Property 'deployContract' does not exist on type 'HardhatUpgrades'.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions