Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uf4no/hardhat-evm-zksync-example
Project with example scripts to deploy and test contracts on EVM networks and ZKsync out of the box
https://github.com/uf4no/hardhat-evm-zksync-example
ethereum evm hardhat zksync
Last synced: 10 days ago
JSON representation
Project with example scripts to deploy and test contracts on EVM networks and ZKsync out of the box
- Host: GitHub
- URL: https://github.com/uf4no/hardhat-evm-zksync-example
- Owner: uF4No
- Created: 2024-09-12T12:17:41.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-20T11:49:30.000Z (5 months ago)
- Last Synced: 2024-12-01T19:34:05.616Z (2 months ago)
- Topics: ethereum, evm, hardhat, zksync
- Language: Solidity
- Homepage:
- Size: 537 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hardhat EVM-ZKsync example project
This is a sample project showcasing different contracts and scripts to deploy them to both Sepolia (or other EVM equivalent chain) and ZKsync Era reusing the same scripts.
## Project structure
- `/contracts`: contains a basic smart contract and different proxies.
- `/deploy`: contains a `hardhat-deploy` script to deploy a basic contract `ZeekMessages.sol`.
- `/scripts`: contains scripts to deploy all contracts with `hardhat-ethers`.## EVM / ZKsync target networks
The networks section of the `hardhat.config.ts` file contains both ZKsync and Sepolia networks. All scripts can be used in both Sepolia and ZKsync, showcasing compatibility between chains.
To target a specific network use the `--network sepolia` or `--network zksyncSepolia` flag.
## Run deployment scripts
### hardhat-ethers scripts
Examples:
- `npx hardhat run scripts/deploy-uups-proxy.ts --network sepolia`
- `npx hardhat run scripts/deploy-transparent-proxy-v2.ts --network zksyncSepolia`### hardhat-deploy script
Example:
`npx hardhat deploy --network sepolia`
## Tests
| Contract | Type | EVM | ZKsync |
|----|--|--|----|
|Basic contract | `hardhat-deploy`| ✅ |✅ |
|Basic contract | `hardhat-ethers`| ✅ |✅ |
|Transparent proxy | `hardhat-ethers`| ✅ |✅ |
|Transparent proxy upgrade | `hardhat-ethers`| ✅ | ✅ |
|Beacon proxy | `hardhat-ethers`| ✅ | ✅ |
|Beacon proxy upgrade | `hardhat-ethers`| ✅ | ✅ |
|UUPS proxy | `hardhat-ethers`| ✅ |✅ |
|UUPS proxy upgrade | `hardhat-ethers`| ✅ |✅ |