I'm trying to deploy Uniswap v3 locally. I launched a local node with a main net fork using Alchemy like this:
npx hardhat node --fork https://eth-mainnet.g.alchemy.com/v2/{API KEY}
My code is as simple as that:
const mainnetFactoryAddress = "0x1F98431c8aD98523631AE4a59f267346ea31F984"
const FactoryDeployedContract = await hre.ethers.getContractAt("UniswapV3Factory", mainnetFactoryAddress);
And this is the error output I'm getting:
HardhatError: HH700: Artifact for contract "UniswapV3Factory" not found.
at Artifacts._handleWrongArtifactForContractName (UniV3-test-hardhat/node_modules/hardhat/src/internal/artifacts.ts:678:11)
at Artifacts._getArtifactPathFromFiles (UniV3-test-hardhat/node_modules/hardhat/src/internal/artifacts.ts:803:19)
at Artifacts._getArtifactPath (UniV3-test-hardhat/node_modules/hardhat/src/internal/artifacts.ts:483:21)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at Artifacts.readArtifact (UniV3-test-hardhat/node_modules/hardhat/src/internal/artifacts.ts:71:26)
at getContractAt (UniV3-test-hardhat/node_modules/@nomiclabs/hardhat-ethers/src/internal/helpers.ts:314:22)
at main (UniV3-test-hardhat/scripts/deploy.js:57:35)
I'm having trouble figuring out why it can't seem to find the artificat for the factory contract. Anyone would have an hint or a solution for this problem please?
Edit: I also installed the npm @uniswap/v3-core
package and also have this line at the top: const UniswapV3Factory = require('@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json');