d40d81ca6a
* remove duplicated prettier from dependencies * use swr for allowances * slight improvements to error cascading * fetch totalsupply with SWR fetch pairs with SWR (except persistent pairs, will be refactored later) * fix lint error * stop using pair context, instead store per-user pairs in local storage * add more pairs to the default list remove unnecessary isWETH fix lint error * add more bases to trade consideration * fix lint warnings * get SWR data on same schedule * don't pass value if it's 0 fix WETH equality checks * clean up fixed/significant formatting * fix slippage calculation bug in swap add slippage to remove * fix token logos * show fewer sig figs * lint error * remove unused signer * add calculateSlippageAmount safety check and tests * fix useAllBalances type stop spuriously sorting token amounts of different tokens use slightly better comparisons for slippage calculations * improve priceSlippage comparison logic * useReserves -> usePair * use checksum for DAI logo address |
||
---|---|---|
.github | ||
cypress | ||
public | ||
src | ||
.env | ||
.eslintrc.json | ||
.gitignore | ||
.prettierrc | ||
cypress.json | ||
LICENSE | ||
netlify.toml | ||
package.json | ||
README.md | ||
tsconfig.json | ||
yarn.lock |
Uniswap Frontend
An open source interface for Uniswap -- a protocol for decentralized exchange of Ethereum tokens.
- Website: uniswap.org
- Docs: uniswap.org/docs/
- Twitter: @UniswapProtocol
- Reddit: /r/Uniswap
- Email: contact@uniswap.org
- Discord: Uniswap
- Whitepaper: Link
Run Uniswap Locally
-
Download and unzip the
build.zip
file from the latest release in the Releases tab. -
Serve the
build/
folder locally, and access the application via a browser.
For more information on running a local server see https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server. This simple approach has one downside: refreshing the page will give a 404
because of how React handles client-side routing. To fix this issue, consider running serve -s
courtesy of the serve package.
Develop Uniswap Locally
Install Dependencies
yarn
Configure Environment
Copy .env
to .env.local
and change the appropriate variables.
Run
yarn start
To run on a testnet, make a copy of .env
named .env.local
, change REACT_APP_NETWORK_ID
to "{yourNetworkId}"
,
and change REACT_APP_NETWORK_URL
to e.g. "https://{yourNetwork}.infura.io/v3/{yourKey}"
.
If deploying with Github Pages, be aware that there's some
tricky client-side routing behavior with create-react-app
.
Contributions
Please open all pull requests against the v2
branch.
CI checks will run against all PRs.