watcher-ts/packages/uniswap/tasks/deploy-factory.ts
Ashwin Phatak da758aceaa
Script to deploy uniswap contracts locally for testing (#118)
* Initial setup with hardhat.

* Deploy Factory contract.

* Deploy tokens and create pool using factory contract.

* Deploy contract to private network.

* Implement separate scripts for deploying Factory, Token and Pool.

Co-authored-by: nikugogoi <95nikass@gmail.com>
2021-07-05 11:05:45 +05:30

15 lines
565 B
TypeScript

import { task, types } from "hardhat/config";
import {
abi as FACTORY_ABI,
bytecode as FACTORY_BYTECODE,
} from '@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json'
task("deploy-factory", "Deploys Factory contract")
.setAction(async (_, hre) => {
const [signer] = await hre.ethers.getSigners();
const Factory = new hre.ethers.ContractFactory(FACTORY_ABI , FACTORY_BYTECODE, signer);
const factory = await Factory.deploy();
await factory.deployed();
console.log("Factory deployed to:", factory.address);
});