Skip to content

Latest commit

 

History

History
258 lines (174 loc) · 5.37 KB

README.md

File metadata and controls

258 lines (174 loc) · 5.37 KB

Liquity V2 App

Preview

https://liquity2-sepolia.vercel.app/

Requirements

Dependencies

git clone [email protected]:liquity/bold.git
cd bold
pnpm install # install dependencies for all packages

How to develop

Copy the .env file to .env.local:

cp .env .env.local

Edit the .env.local file to set the environment variables.

Run the development server:

cd bold/frontend/app
pnpm build-deps # only needed once
pnpm dev

You can now open http://localhost:3000/ in your browser.

Scripts

pnpm build                  # build the static app in out/
pnpm build-deps             # build all the dependencies needed by the app
pnpm build-graphql          # update the code generated from the GraphQL queries
pnpm build-panda            # update the code generated from the Panda CSS config
pnpm build-uikit            # builds the UI kit in ../uikit
pnpm dev                    # run the development server
pnpm fmt                    # format the code
pnpm lint                   # lint the code
pnpm test                   # run the tests
pnpm update-liquity-abis    # build the contracts and update the ABIs

Environment

Create .env.local from the .env file and fill in the required values (see the description of each variable below).

cp .env .env.local

See ./src/env.ts for details about how the environment variables are being imported by the app.

Supported Variables

NEXT_PUBLIC_CHAIN_ID

The Ethereum network to connect to.

# Example
NEXT_PUBLIC_CHAIN_ID=1

NEXT_PUBLIC_CHAIN_NAME

The name of the Ethereum network.

# Example
NEXT_PUBLIC_CHAIN_NAME=Ethereum

NEXT_PUBLIC_CHAIN_CURRENCY

The currency of the Ethereum network.

# Format
NEXT_PUBLIC_CHAIN_CURRENCY=name|symbol|decimals

# Example
NEXT_PUBLIC_CHAIN_CURRENCY=Ether|ETH|18

NEXT_PUBLIC_CHAIN_RPC_URL

The RPC URL for the Ethereum network.

# Example
NEXT_PUBLIC_CHAIN_RPC_URL=https://cloudflare-eth.com

NEXT_PUBLIC_CHAIN_BLOCK_EXPLORER

The block explorer for the Ethereum network. Optional.

# Format
NEXT_PUBLIC_CHAIN_BLOCK_EXPLORER=name|url

# Example
NEXT_PUBLIC_CHAIN_BLOCK_EXPLORER=Etherscan|https://etherscan.io

NEXT_PUBLIC_CHAIN_CONTRACT_ENS_REGISTRY

The address of the ENS registry contract. Optional.

# Format
NEXT_PUBLIC_CHAIN_CONTRACT_ENS_REGISTRY=address

# Example
NEXT_PUBLIC_CHAIN_CONTRACT_ENS_REGISTRY=0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e

NEXT_PUBLIC_CHAIN_CONTRACT_ENS_RESOLVER

The address of the ENS resolver contract. Optional.

# Format
NEXT_PUBLIC_CHAIN_CONTRACT_ENS_RESOLVER=address|blockCreated

# Example
NEXT_PUBLIC_CHAIN_CONTRACT_ENS_RESOLVER=0xce01f8eee7E479C928F8919abD53E553a36CeF67|19258213

NEXT_PUBLIC_CHAIN_CONTRACT_MULTICALL

The address of the Multicall contract. Optional.

# Format
NEXT_PUBLIC_CHAIN_CONTRACT_MULTICALL=address|blockCreated

# Example
NEXT_PUBLIC_CHAIN_CONTRACT_MULTICALL=0xca11bde05977b3631167028862be2a173976ca11|14353601

NEXT_PUBLIC_COINGECKO_API_KEY

API key for CoinGecko integration. Use 'demo' for the demo API or 'pro' for the pro API.

# Format
NEXT_PUBLIC_COINGECKO_API_KEY=apiType|API_KEY

# Example
NEXT_PUBLIC_COINGECKO_API_KEY=pro|CG-xxxxxxxxxxxxxxxxxxxx

NEXT_PUBLIC_BLOCKING_LIST

Smart contract address for the blocking list implementation. The contract must implement isBlackListed(address)(bool).

# Example
NEXT_PUBLIC_BLOCKING_LIST=0x97044531D0fD5B84438499A49629488105Dc58e6

NEXT_PUBLIC_BLOCKING_VPNAPI

VPNAPI.io detection to only allow certain country codes.

# Format
NEXT_PUBLIC_BLOCKING_VPNAPI=key|countryCodes

# Example
NEXT_PUBLIC_BLOCKING_VPNAPI=1234|US,CA

NEXT_PUBLIC_DEMO_MODE

Enable or disable demo mode for testing purposes.

# Example
NEXT_PUBLIC_DEMO_MODE=false

NEXT_PUBLIC_KNOWN_INITIATIVES_URL

URL for fetching known initiatives data (optional).

NEXT_PUBLIC_LIQUITY_STATS_URL

URL for fetching Liquity protocol statistics.

# Example
NEXT_PUBLIC_LIQUITY_STATS_URL=https://api.liquity.org/v2/testnet/sepolia.json

NEXT_PUBLIC_SAFE_API_URL

URL for the Safe transaction service API.

# Example
NEXT_PUBLIC_SAFE_API_URL=https://safe-transaction-mainnet.safe.global/api

NEXT_PUBLIC_SUBGRAPH_URL

URL for The Graph protocol subgraph queries.

# Example
NEXT_PUBLIC_SUBGRAPH_URL=https://api.studio.thegraph.com/query/…

NEXT_PUBLIC_VERCEL_ANALYTICS

Enable or disable Vercel Analytics for tracking application metrics.

# Example
NEXT_PUBLIC_VERCEL_ANALYTICS=false

NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID

A WalletConnect project ID which can be obtained by creating a WalletConnect project.

NEXT_PUBLIC_CONTRACT_…

Addresses of the Liquity contracts.

Folder Structure

src/
  abi/         # ABIs of the Liquity contracts
  app/         # The Next.js app (mostly routing only)
  comps/       # UI Components
  demo-mode/   # Files related to the app running in demo mode
  screens/     # App Screens (used by /app routing components)
  services/    # Service Components
  tx-flows/    # Transaction Flows