Error: missing argument: in Contract constructor

Viewed 698

Error message: Error: missing argument: in Contract constructor (count=0, expectedCount=1, code=MISSING_ARGUMENT, version=contracts/5.6.2)

contract:

contract KBMarket is ReentrancyGuard {
    using Counters for Counters.Counter;

    constructor() {
        owner = payable(msg.sender);
    }

and here is hardhat test.js:

describe("KBMarket", function () {
  it("Should Mint And Trade NFTs", async function () {
    const Market = await ethers.getContractFactory('KBMarket')
    const market = await Market.deploy()
    await market.deployed()
    const marketAddress = market.adderss
  }
}

Thanks in advance.

1 Answers

Your constructor should have an argument: constructor(uint _feePercent)

In deploy.js, const market = await Market.deploy(1) you need to pass an argument here because the marketplace's constructor accepts the _feePercent as an argument.

Related