Giter Club home page Giter Club logo

univ3_simple_router's Introduction

UNIV3_SIMPLE_ROUTER

Simple router to perform buys against UniswapV3 liquidity pools

RouterProcessorV3 and UniversalRouter are complicated to use, specially for bots so I decided to develop my own approach, more simple and gas efficient trading directly against the liquidity pool contract

Solidity testing CI using hardhat Coverage Status

INSTRUCTIONS

pnpm install

Using pnpm run you can check the commands you will need to test your smart contract and run linter and prettier for solidity or typescript files

DEPLOYMENT

If you want to test deployments you have to include your pk on .pk.example and remove the .example
Also edit the deploy.js script and the deploy command to include the network you want to deploy against, this network has to be previously configured in hardhat.config.ts
Check https://hardhat.org/hardhat-runner/docs/guides/deploying if you are lost here

Verification

You have to include your API KEY if you desire to test the verification plugin, also you have to configure the networks you want to use, if your constructor receives complex arguments you also will have to create a file Everything is explained here: https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-verify

GAS REPORTER

We are using the gas reporter included in hardhat and codechecks integration for github actions, for this you have to add your repo here https://app.codechecks.io/, copy the code and add it as a secret for your repository named CC_SECRET, check the codecheks.yml and the .yml for github actions depending on your branch name changes could be needed.
https://github.com/codechecks/docs/blob/master/getting-started.md
Diff parameters can be configured in hardhat.config.ts so will end in a failure if the gas spent rises too much.

image

You can see the avg column is empty, if you need that include your CMC key in .cmc.example and remove the .example CI=true in enviroment variables is required so it generates the required json output in gasReporterOutput.json

If you want see previous output locally you have to run pnpm run codechecks

Coverage

Coveralls integration for github actions is also included, for this you have to add your repo here https://coveralls.io/repos and add a secret for your repository COVERALLS_REPO_TOKEN and set there your repo token, there you will also find a link in order to add your coverage badge in your readme. You can also configure coverage decrease thresholds for failure so if someone ruins the coverage the merge will be blocked.

image

Locally once you run pnpm run coverage a report summary will be generated where you can see the % of lines covered for your tests etc, also folder named coverage will be generated with an index.html file inside, if you click it you can check the coverage report similar to the summary you saw after execution but you can also navigate using your browser and check inside each contract which lines are covered which not and how much times each line.

image

univ3_simple_router's People

Contributors

miguelggmm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

scobru

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.