GithubHelp home page GithubHelp logo

ileskov / zksync-amm-contract Goto Github PK

View Code? Open in Web Editor NEW
16.0 2.0 3.0 144 KB

ZK-rollups use ZKPs by combining a large number of Layer 2 transactions (off-chain) into one transaction that then gets mined on the Ethereum mainnet. Instead of mining 100s of transactions individually, they can be rolled up into a single transaction.

Solidity 68.76% TypeScript 31.24%
ethereum layer2 rollup smart-contracts solidity zk-snarks zksync amm constant-product unis

zksync-amm-contract's Introduction

πŸ—žοΈ Constant Product Automated Market Maker (AMM) Contract build on zkSync ZK rollup layer2 solution πŸ—žοΈ

There are 3 contracts: token0.sol and token1.sol are erc20 tokens and CPAMM is AMM contract to swap these two tokens. Instructions how to deploy and verify contracts on zkSync explorer below

πŸ“ Table of Contents

🚩 General Information

  • Contract allows users to set and get greeting message on zkSync network

πŸ’» Technologies Used

  • zksync-web3 library
  • layer2 zk rollup

🌟 Features

ZK-Rollup has absolute dominance in user experience, which can be concretely expressed as a :

  • high level of security,
  • fast
  • economic transactions.

πŸ‘€ Requirements For Initial Setup

πŸ“Ÿ Setup

1. πŸ’Ύ Clone/Download the Repository

2. πŸ“¦ Install Dependencies:

$ cd repository_file
$ yarn

3. πŸ” .env environment variables required to set up

Create .env file inside project folder

  • You can get your private key from your wallet(⚠️Don't share your private key with untrusted parties)
PRIVATE_KEY = <Private key of your wallet u want to deploy contracts from>

4. πŸ“ Run Compile

$ yarn hardhat compile

5. πŸš€ Deploy to zkSync ( ⚠️ Make sure to have ETH on your wallet in GOERLI testnet ⚠️)

$ yarn hardhat deploy-zksync

7. πŸ“œ Verify contracts

  • πŸ”Ž Go to zkScan explorer and find your deployed contract.
  • β˜‘οΈ Go to "Π‘ode" tab and click "Verify & Publish": Example screenshot
  • πŸ€” Choose how you want to verify: Via flattened source code || Via Standard Input JSON.
  • βœ… Enter the required data and you have successfully verified your contract.

πŸ’¬ Contact

Created by @LESKOV - feel free to contact me!

zksync-amm-contract's People

Contributors

ileskov avatar

Stargazers

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

Watchers

 avatar  avatar

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.