Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jackhamer09/zksync-era-hardhat-example
This is a simple example of how to use zkSync Era with Hardhat. It will help you to deploy your first zkSync smart contracts and interact with them.
https://github.com/jackhamer09/zksync-era-hardhat-example
ethereum harhat solidity zksync
Last synced: about 2 months ago
JSON representation
This is a simple example of how to use zkSync Era with Hardhat. It will help you to deploy your first zkSync smart contracts and interact with them.
- Host: GitHub
- URL: https://github.com/jackhamer09/zksync-era-hardhat-example
- Owner: JackHamer09
- License: mit
- Created: 2022-09-24T14:59:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-24T07:26:13.000Z (almost 2 years ago)
- Last Synced: 2024-10-14T03:26:06.686Z (3 months ago)
- Topics: ethereum, harhat, solidity, zksync
- Language: TypeScript
- Homepage:
- Size: 503 KB
- Stars: 7
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zkSync Era Hardhat Example
This is a simple example of how to use zkSync Era with [Hardhat](https://v2-docs.zksync.io/api/hardhat/getting-started.html). It will help you to deploy your first zkSync smart contracts, interact with them, and automatically verify its source code on [zkSync Era Block Explorer](https://explorer.zksync.io/).## Setup
1. Install dependencies
```bash
npm install
```
2. Rename or copy file `.env.example` to `.env` and fill in the private key of the account you want to use for deployment.---
## Deploying contracts
1. Compile contracts
```bash
npm run compile
```2. Deploy contracts:
- Greeter - this is a simple contract that allows you to set a greeting message and read it. It will also log SetGreeting event when you set a new greeting message.
```bash
npm run deploy greeter.ts
```- ERC20 Token - this is a multifile contract that will let you deploy your own custom token to zkSync 2.0.
- Fill in the values for your token in `deploy/erc20.ts`
- Deploy the contract
```bash
npm run deploy erc20.ts
```---
### Useful links
- [zkSync Era Hardhat Documentation](https://era.zksync.io/docs/api/hardhat/getting-started.html)
- [zkSync Era Block Explorer](https://explorer.zksync.io/)
- [zkSync Era Documentation](https://era.zksync.io/docs/)