mirror of
https://github.com/cerc-io/watcher-ts
synced 2024-11-19 20:36:19 +00:00
da758aceaa
* 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> |
||
---|---|---|
.. | ||
contracts | ||
queries | ||
schema | ||
tasks | ||
.env.example | ||
.gitignore | ||
aggregation.md | ||
contract.md | ||
design-notes.md | ||
hardhat.config.ts | ||
package.json | ||
README.md | ||
tsconfig.json |
Uniswap
Instructions
Deploy contracts
# Create .env.
$ cp .env.example .env
# Set ETH_RPC_URL variable to target chain network.
# Deploy contracts to private network specified by ETH_RPC_URL
$ yarn deploy:factory
# Factory deployed to: 0x5FbDB2315678afecb367f032d93F642f64180aa3
$ yarn deploy:token --name Token0 --symbol TK0
# token TK0 deployed to: 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
$ yarn deploy:token --name Token1 --symbol TK1
# token TK1 deployed to: 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
$ yarn create:pool --factory 0x5FbDB2315678afecb367f032d93F642f64180aa3 --token0 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 --token1 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0 --fee 500
# Pool deployed to: 0x315244f2680ABa32F27004B67d83E53c8c88F5FE
# For local development.
# Start hardhat local network.
$ yarn hardhat node
# Deploy contracts to local network.
# Deploy contracts to private network specified by ETH_RPC_URL
$ yarn deploy:factory --network localhost
$ yarn deploy:token --network localhost --name Token0 --symbol TK0
Scripts
-
generate:schema
Generate schema for uniswap subgraph in graphql format. The
get-graphql-schema
tool is used to generate the schema (https://github.com/prisma-labs/get-graphql-schema). The uniswap subgraph graphql endpoint is provided in the script to generate the schema. -
lint:schema
Lint schema graphql files.
$ yarn lint:schema schema/frontend.graphql
-
deploy:factory
Deploy Factory contract.
$ yarn deploy:factory # Deploy to hardhat local network. $ yarn deploy --network localhost
-
deploy:token
Deploy Token contract.
$ yarn deploy:token --name TokenName --symbol TKS
-
create:pool
Create pool with factory contract and tokens.
$ yarn create:pool --factory 0xFactoryAddress --token0 0xToken0Address --token1 0xToken1Address --fee 500