Skip to content

This project is for easier deployment and verification of uniswap v3 contracts, using hardhat

Notifications You must be signed in to change notification settings

kralonur/hardhat-uniswap-v3-contracts-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hardhat Uniswap V3 Contracts Deploy

This project is designed to follow the deployment steps of deploy-v3 with some minor changes. The motivation behind creating this project is to gain a better understanding of the deployment process, make verification easier, and have the ability to modify the contracts if necessary.

Important Note:

At the time of creating this repository, the latest commit of deploy-v3 does not include the deployment of SwapRouter and Quoter contracts. However, this repository contains the deployment of these contracts.

Installation

Pre Requisites

Before running any command, you need to create a .env file and set a BIP-39 compatible mnemonic as an environment variable. Follow the example in .env.example. If you don't already have a mnemonic, use this website to generate one.

  1. Install node and npm
  2. Install yarn
npm install --global yarn

Check that Yarn is installed by running:

yarn --version

Then, proceed with installing dependencies:

yarn install

Required Contracts for Deployment

This repo does not contains the contracts itself for deployment. You need to clone them. And for that scripts are provided.

First you need to give required permissions to the scripts and then you can run them:

chmod +x ./repo-all.sh
./repo-all.sh

This script will clone the required contracts in the ./contracts directory.

Making future changes for contracts

If you want to make changes on uniswap contracts you should delete # contracts section of .gitignore file. Then the contracts will be included on future commits.

Usage/Examples

Compile

Compile the smart contracts with Hardhat:

yarn compile

TypeChain

Compile the smart contracts and generate TypeChain artifacts:

yarn typechain

Lint Solidity and TypeScript

Lint the Solidity and TypeScript code (then check with prettier):

yarn lint

Clean

Delete the smart contract artifacts, the coverage reports and the Hardhat cache:

yarn clean

Available Tasks

To see available tasks from Hardhat:

npx hardhat

Deployment

Args

First you need to create a .env file using the .env.example file as a template.

Then you need to create deployArgs.json file in deploargs directory. You can use deployArgs.example.json as a template.

Deploy

To deploy run following:

yarn deploy:contracts --network {network}

Verify

To verify the contracts first you need to deploy with given deploy script up.

Then you can run following:

yarn verify:contracts --network {network}

Or you can verify one contract at time:

yarn verify:{contract-name} --network {network}

All of the verify commands are available in package.json file.

Contributing

This website can be helpful to write commit messages.

About

This project is for easier deployment and verification of uniswap v3 contracts, using hardhat

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published