I've tried these solution but they didn't work for me.
Is there any other solution for this 'TypeError: ethers.getContractFactory(...).deploy is not a function'?
const { expect } = require("chai");
const { ethers } = require("hardhat");
const {
BN, // Big Number support
constants, // Common constants, like the zero address and largest integers
expectEvent, // Assertions for emitted events
expectRevert, // Assertions for transactions that should fail
} = require("@openzeppelin/test-helpers");
async function fetchContractFactory() {
const contractFactory = await ethers.getContractFactory("example");
console.log(contractFactory);
}
fetchContractFactory();
describe("example", function () {
let example, bob;
before(async function () {
bob = await ethers.getVerifiedContractAt(
"0x6B566554378477490ab040f6F757171c967D03ab"
);
console.log("Should be able to read the correct address " + bob.address);
console.log("About to deploy example contract");
example = await ethers.getContractFactory("example").deploy(bob.address);
console.log(`example contract deployed at ${example.address}`);
});
it("bb", async function () {
await example.arrival();
const result = await example.bob.fill("roll", 0);
expect(result).to.be.true;
});
});
So the error message is at this line, const contractFactory = await ethers.getContractFactory("example");
or at this line, example = await ethers.getContractFactory("example").deploy(bob.address);