Skip to content

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.

Notifications You must be signed in to change notification settings

ILESKOV/zkSync-AMM-contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗞️ 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!

About

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.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published