The SOR (Smart Order Router) SmartContract repository contains the implementation of a decentralized exchange (DEX) router. This router facilitates split trading on the Dex platform, allowing users to swap tokens efficiently using various strategies and protocols. The primary contract in this repository is DexRouter
, which integrates multiple functionalities and libraries to provide a comprehensive trading solution.
contracts/8/DexRouter.sol
: Main contract for the DexRouter, handling split trading.contracts/8/UnxswapV3Router.sol
: Contract for handling Uniswap V3 swaps.contracts/8/UnxswapV2Router.sol
: Contract for handling Uniswap V2 swaps.contracts/8/interfaces/
: Directory containing interface definitions.contracts/8/libraries/
: Directory containing various utility libraries.contracts/8/storage/
: Directory containing storage contracts.contracts/8/adapters/
: Directory containing adapter contracts for integrating with different protocols.
- Split Trading: The DexRouter allows for split trading, enabling users to execute trades across multiple liquidity sources.
- Uniswap V3 Integration: The UnxswapV3Router contract provides integration with Uniswap V3 for efficient token swaps.
- Uniswap V2 Integration: The UnxswapV2Router contract provides integration with Uniswap V2 for efficient token swaps.
- Security: The contracts has been audited by okx innter audit team.
- Utility Libraries: Various utility libraries are included to facilitate common tasks such as token transfers, ETH wrapping, and more.
To use the contracts in this repository, you need to have the following prerequisites:
- Node.js and npm (or yarn)
- Hardhat (for development and testing)
-
Clone the repository:
git clone https://github.com/okx/WEB3-DEX-OPENSOURCE.git cd WEB3-DEX-OPENSOURCE
-
Install dependencies:
npm install # or yarn install
-
Compile the contracts:
npx hardhat compile
-
Run tests:
npx hardhat test
There are several ways you can contribute to the SOR SmartContract project:
Join our Discord community to help other developers troubleshoot their integration issues and share your experience with the SOR SmartContract. Our Discord is the main hub for technical discussions, questions, and real-time support.
- Open issues to suggest features or report minor bugs
- Before opening a new issue, search existing issues to avoid duplicates
- When requesting features, include details about use cases and potential impact
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests
npx hardhat test
- Submit a pull request
- Discuss non-trivial changes in an issue first
- Include tests for new functionality
- Update documentation as needed
- Add a changelog entry describing your changes in the PR
- PRs should be focused and preferably address a single concern
- Look for issues labeled "good first issue"
- Read through our documentation
- Set up your local development environment following the Installation guide
- A maintainer will review your PR
- Address any requested changes
- Once approved, your PR will be merged
- Open a discussion issue for general questions
- Join our community for real-time discussions
- Review existing issues and discussions
Thank you for contributing to the SOR SmartContract repo!