Andriy-Kulak / zksync-sample

playing around with zksync

Home Page:https://zksnync-sample.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overview

This is Casino Game. Deployed Contracts:

Front-end

  • for frontend, please navigate to frontend/README.md

Steps To Set Up Contract Deployment

  1. Run git clone https://github.com/Andriy-Kulak/zksync-sample.git
  2. Run npm install at the root folder. Please make sure you have npm and node.js installed. Look here for more details.
  3. Ensure you have a metamask account setup so you can deploy & interact with contract. Reference
  4. create .env in root folder based on .env.example file and add ethescan api key and private key there, specifically ZKS_PRIVATE_KEY & ETHERSCAN_API_KEY
  • to generate private key from metamask, refer to this article
  • to gerenate etherscan api key, go to ethescan.io, generate a new key and paste it
  1. npx hardhat compile to generate types and artifacts for contract

  2. npx hardhat deploy-zksync to deploy the contract

  3. Check the logs and you should have 2 successful deployed contracts:

MyCoin was deployed to 0x...
CasinoGame was deployed to 0x...

Now it is time to verify contracts. I've already done the setup for verification so all you nee to do is run the following. Also, for more info, go to verification docs

# verify my coin
npx hardhat verify --network zkSyncTestnet {MyCoin address}
# verify casino game. for this one the last 2 are constructor arguments you need to pass
npx hardhat verify --network zkSyncTestnet {CasinoGame address} {MyCoin address} 42

Congrats! You have now deployed the contract. You can interact with front-end on https://zksync-sample.vercel.app/ and get some ideas.

About

playing around with zksync

https://zksnync-sample.vercel.app


Languages

Language:TypeScript 75.7%Language:Solidity 21.3%Language:JavaScript 2.6%Language:CSS 0.4%