https://github.com/flashbots/dealer-smart-contract
Integral DEX smart contract
https://github.com/flashbots/dealer-smart-contract
Last synced: 9 months ago
JSON representation
Integral DEX smart contract
- Host: GitHub
- URL: https://github.com/flashbots/dealer-smart-contract
- Owner: flashbots
- Created: 2023-07-14T19:43:02.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-25T20:37:42.000Z (almost 3 years ago)
- Last Synced: 2025-01-11T15:15:13.786Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 256 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dealer smart contract
This repository contains a smart contract called "Dealer" with some test cases.
Read description and purposes [here](https://collective.flashbots.net/t/new-trends-in-decentralized-exchange-applications-exploring-the-design-space/2268).
## Install and run instructions
Clone this repository
```
git clone https://github.com/flashbots/dealer-smart-contract
```
Install dependencies. From /dealer-smart-contract run
```
npm install
```
Patch Uniswap v2.
Note: when running the tests, Uniswap may throw an error that can be fixed with this patch. The patched code seems to hurt the intention of the original code but it is good enough for testing the Dealer contract. The original code can be read as commented code at the function pairFor in the patched file.
Replace the file
```
node_modules/@uniswap/v2-periphery/contracts/libraries/UniswapV2Library.sol
```
by the file
```
contracts/patched/UniswapV2Library.solx
```
The extension .solx prevents compilation. The replacement has to be renamed to .sol.
To run tests:
```shell
npx hardhat test
```
or
```shell
REPORT_GAS=true npx hardhat test
```
to display gas costs.