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.
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.
- Install node and npm
- Install yarn
npm install --global yarn
Check that Yarn is installed by running:
yarn --version
Then, proceed with installing dependencies:
yarn install
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.
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.
Compile the smart contracts with Hardhat:
yarn compile
Compile the smart contracts and generate TypeChain artifacts:
yarn typechain
Lint the Solidity and TypeScript code (then check with prettier):
yarn lint
Delete the smart contract artifacts, the coverage reports and the Hardhat cache:
yarn clean
To see available tasks from Hardhat:
npx hardhat
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.
To deploy run following:
yarn deploy:contracts --network {network}
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.
This website can be helpful to write commit messages.