Skip to content

Uviswap is a decentralized automated market maker (AMM) that allows users to swap tokens and provide liquidity to earn fees. This repository contains the smart contracts for the Uviswap Pair and Factory, along with testing scripts and deployment instructions.

License

Notifications You must be signed in to change notification settings

rafael-abuawad/uviswap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uviswap: Decentralized Automated Market Maker (AMM)

Uviswap is a decentralized automated market maker (AMM) that allows users to swap tokens and provide liquidity to earn fees. This repository contains the smart contracts for the Uviswap Pair and Factory, along with testing scripts and deployment instructions.

Table of Contents

Guide

This repository comes with a full guide on how to implement it from scratch, you can find it here. Create your own Uniswap DeFi Application🦄! From scratch using Vyper & Python🐍

Overview

Uviswap is built on the principles of automated market makers, providing a decentralized solution for token swaps and liquidity provision. It utilizes a pair-based model where users can add liquidity to pairs of tokens, and swaps are executed based on the liquidity available in the pairs.

Smart Contracts

UviswapPair

The UviswapPair smart contract represents an individual token pair. It includes functions for adding liquidity, removing liquidity, swapping tokens, and collecting fees.

UviswapFactory

The UviswapFactory smart contract is responsible for creating and managing pairs of tokens. It includes a method for creating new pairs and deploying instances of the UviswapPair contract.

Testing

The testing scripts are provided in the tests folder, specifically in the test_uviswap.py file. These tests cover various functionalities, including adding and removing liquidity, swapping tokens, and collecting fees.

To run the tests locally, use the following command:

$ ape test

Make sure to configure the testing fixtures and accounts in conftest.py based on your requirements.

Deployment

To deploy the Uviswap application, follow these steps:

  1. Install the Base plugin:

    $ ape plugins install base
  2. Configure the RPC URL endpoints in ape-config.yaml for the desired network (mainnet or testnet).

  3. Create accounts for deployment:

    $ ape accounts generate <name_of_your_account>

Make sure to replace <name_of_your_account> in the instructions with the actual name you used for the deployment account. Additionally, customize the content based on any specific details or features of your Uviswap application.

  1. Customize the deployment script in deploy.py if needed.

  2. Run the deployment script:

    $ ape run deploy --network base:sepolia  # For Base Testnet
    $ ape run deploy --network base:mainnet  # For Base Mainnet

Contributing

Contributions are welcome! If you have any improvements, bug fixes, or additional features to add, please open an issue or submit a pull request.

License

This project is licensed under the MIT License

About

Uviswap is a decentralized automated market maker (AMM) that allows users to swap tokens and provide liquidity to earn fees. This repository contains the smart contracts for the Uviswap Pair and Factory, along with testing scripts and deployment instructions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published