Overview
This is Casino Game. Deployed Contracts:
- web app deployed to https://zksync-sample.vercel.app/
- MyCoin was deployed to 0xC2c6864bcf1cd4d3A126f1201dA668ba18841D7A
- CasinoGame was deployed to 0x7Eb58E4405c01A47Da2075975fFD1dD75295C043
- Lucky Number is 42
Front-end
- for frontend, please navigate to
frontend/README.md
Steps To Set Up Contract Deployment
- Run
git clone https://github.com/Andriy-Kulak/zksync-sample.git
- Run
npm install
at the root folder. Please make sure you havenpm
andnode.js
installed. Look here for more details. - Ensure you have a metamask account setup so you can deploy & interact with contract. Reference
- create
.env
in root folder based on.env.example
file and add ethescan api key and private key there, specificallyZKS_PRIVATE_KEY
ÐERSCAN_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
-
npx hardhat compile
to generate types and artifacts for contract -
npx hardhat deploy-zksync
to deploy the contract -
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.