Skip to content

Fully functional Uniswap clone. Built with CRANQ & React.js. Pairs with Metamask & swaps tokens. All on chain. 😎

Notifications You must be signed in to change notification settings

jenperez613/uniswap_clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Uniswap Clone

crypto swap

This project was bootstrapped with Create Eth App.

Project Structure

The default template is a monorepo created with Yarn Workspaces.

Workspaces makes it possible to setup multiple packages in such a way that we only need to run yarn install once to install all of them in a single pass. Dependencies are hoisted at the root.

my-eth-app
β”œβ”€β”€ README.md
β”œβ”€β”€ node_modules
β”œβ”€β”€ package.json
β”œβ”€β”€ .gitignore
└── packages
    β”œβ”€β”€ contracts
    β”‚   β”œβ”€β”€ README.json
    β”‚   β”œβ”€β”€ package.json
    β”‚   └── src
    β”‚       β”œβ”€β”€ abis
    β”‚       β”‚   β”œβ”€β”€ erc20.json
    β”‚       β”‚   └── ownable.json
    β”‚       β”œβ”€β”€ addresses.js
    β”‚       └── index.js
    β”œβ”€β”€ react-app
    β”‚   β”œβ”€β”€ README.md
    β”‚   β”œβ”€β”€ node_modules
    β”‚   β”œβ”€β”€ package.json
    β”‚   β”œβ”€β”€ public
    β”‚   β”‚   β”œβ”€β”€ favicon.ico
    β”‚   β”‚   β”œβ”€β”€ index.html
    β”‚   β”‚   β”œβ”€β”€ logo192.png
    β”‚   β”‚   β”œβ”€β”€ logo512.png
    β”‚   β”‚   β”œβ”€β”€ manifest.json
    β”‚   β”‚   └── robots.txt
    β”‚   └── src
    β”‚       β”œβ”€β”€ App.css
    β”‚       β”œβ”€β”€ App.js
    β”‚       β”œβ”€β”€ App.test.js
    β”‚       β”œβ”€β”€ ethereumLogo.svg
    β”‚       β”œβ”€β”€ index.css
    β”‚       β”œβ”€β”€ index.js
    β”‚       β”œβ”€β”€ serviceWorker.js
    β”‚       └── setupTests.js
    └── subgraph
        β”œβ”€β”€ README.md
        β”œβ”€β”€ abis
        β”‚   └── erc20.json
        β”œβ”€β”€ package.json
        β”œβ”€β”€ schema.graphql
        β”œβ”€β”€ src
        β”‚   └── mappings
        β”‚       β”œβ”€β”€ tokens.ts
        β”‚       └── transfers.ts
        └── subgraph.yaml

Owing to this dependency on Yarn Workspaces, Create Eth App can't be used with npm.

Available Scripts

In the project directory, you can run:

React App

yarn react-app:start

Runs the React app in development mode.
Open http://localhost:3000 to view it in the browser.

The page will automatically reload if you make changes to the code.
You will see the build errors and lint warnings in the console.

yarn react-app:test

Runs the React test watcher in an interactive mode.
By default, runs tests related to files changed since the last commit.

Read more about testing React.

yarn react-app:build

Builds the React app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the React documentation on deployment for more information.

yarn react-app:eject

Note: this is a one-way operation. Once you react-app:eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject the React app at any time. This command will remove the single build dependency from your React package.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into the react-app package so you have full control over them. All of the commands except react-app:eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use react-app:eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

Subgraph

The Graph is a tool for for indexing events emitted on the Ethereum blockchain. It provides you with an easy-to-use GraphQL API.

To learn more, check out the The Graph documentation.

yarn subgraph:codegen

Generates AssemblyScript types for smart contract ABIs and the subgraph schema.

yarn subgraph:build

Compiles the subgraph to WebAssembly.

yarn subgraph:auth

Before deploying your subgraph, you need to sign up on the Graph Explorer. There, you will be given an access token. Drop it in the command below:

GRAPH_ACCESS_TOKEN=your-access-token-here yarn subgraph:auth

yarn subgraph:deploy

Deploys the subgraph to the official Graph Node.

Replace paulrberg/create-eth-app in the package.json script with your subgraph's name.

You may also want to read more about the hosted service.

About

Fully functional Uniswap clone. Built with CRANQ & React.js. Pairs with Metamask & swaps tokens. All on chain. 😎

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published