Git Product home page Git Product logo

jediswap's Introduction

JediSwap

Clone of Uniswap V2 to Cairo. AMM for StarkNet.

Testing and Development

We use Protostar for our testing and development purposes. Protostar is a StarkNet smart contract development toolchain, which helps you with dependencies management, compiling and testing cairo contracts.

Install Protostar

  1. Copy and run in a terminal the following command:
curl -L https://raw.githubusercontent.com/software-mansion/protostar/master/install.sh | bash
  1. Restart the terminal.
  2. Run protostar -v to check Protostar and cairo-lang version.

Note

Protostar requires version 2.28 or greater of Git.

Install Protostar Dependencies

protostar install

Compile Contracts

protostar build

Run Tests

protostar test

Run Scripts

Setup a local virtual env

python -m venv ./venv
source ./venv/bin/activate

Install dependencies

pip install -r requirements.txt

Find more info about the installed dependencies here:

Run Scripts

All scripts are placed in scripts folder. testnet config is not committed, please create your own in scripts/config

To run scripts on local system, you first need to run a devnet server:

starknet-devnet

Run script by specifying the path to the script file. Example:

python scripts/deploy.py local

jediswap's People

Contributors

milancermak avatar princearoragithub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jediswap's Issues

Integrate Protostar

Integrate protostar. Write as many tests as possible. Try to see if fuzzing is useful. For now, have both protostar and pytest.

OZ extensibility pattern

Use standard OZ cairo contracts and extend it for our ERC20 implementation. Right now, the code is copy pasted directly into the file.

Upgrade to components

-- Upgrade to components
-- Include OZ ERC20 and upgradeable implementations
-- Make sure the admin remains same after rewrite (admin is in Proxy right now)
-- No changes should be made in tests to verify everything is working fine

Move to Protostar

  • Remove nile dependency
  • Remove pytest dependency
  • Check scripts are running
  • Change github workflow
  • Cleanup - Refactor, readme

Factory pattern

  • Upgrade to cairo 0.9.0
  • Enable deployment on demand with deterministic address
  • Update the docs

Update tests for upgrade

For Cairo 2.x implementation, the contracts will remain upgradeable for some time. Write tests for following scenarios:

  1. Upgrade Factory contract from cairo 0.x to latest.
  2. Update pair class hash (for the latest Pair contract) in the factory contract.
  3. Create a pair after 1) and 2).
  4. Upgrade Router contract from cairo 0.x to latest.
  5. Upgrade all the Pair contracts from cairo 0.x to latest.
  6. Check owner is correct after each upgrade.
  7. Check upgrades are possible after upgrade.

Run these tests on mainnet fork as well.

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.