2

enter image description here

enter image description here

I don't know how to deploy this contract whit HARDHAT because there is an Interface object in the constructor.

Please can someone explain to me how to initialize IUniswapV2Pair _pair

IUniswapV2Pair is a Uniswap Library written in Solidity.

  const Unitest = await hre.ethers.getContractFactory("Unitest");
  const unitest = await Unitest.deploy(int256 .....,
        uint256 .... , IUniswapV2Pair(?????));

  await unitest.deployed();

  console.log("unitest deployed to:", unitest.address);
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • IDK Hardhat but you can try to pass a deployed UniswapV2Pair address to it like: `IUniswapV2Pair(0x...)` or first deploy a contract that implements IUniswapV2Pair interface then pass its address to IUniswapV2Pair. – Yunus YILDIRIM Mar 24 '22 at 20:37

1 Answers1

0

You get the address of Interface. This is in rinkeby: https://rinkeby.etherscan.io/address/0x6bcd5b1e919277afe06a3f6355265ff3cf7956a4#code

and then when you deploy the contract,

   const Uniswap = await hre.ethers.getContractFactory("ContractName");
   const contract = await NFTMarket.deploy("0x6BcD5b1E919277AFe06a3f6355265ff3Cf7956A4",period,startTime);
Yilmaz
  • 35,338
  • 10
  • 157
  • 202