Developer Quickstart
Getting starting developing with ZKsync OS
You can use all standard EVM tooling for ZKsync OS.
You can find instructions for bridging testnet ETH to ZKsync OS Developer Preview testnet
in the Network Details page.
To get started with Foundry or Hardhat, follow the steps below:
- Create a new foundry project:
forge init Countercd Counter - Build the project
forge build - Set your private key for deploying:
export TESTNET_PRIVATE_KEY="0x..." - Deploy the contract:
forge script script/Counter.s.sol --rpc-url https://zksync-os-testnet-alpha.zksync.dev --broadcast --skip-simulation --private-key $TESTNET_PRIVATE_KEY - Set the number value:
cast send 0x<YOUR_CONTRACT_ADDRESS> \ "setNumber(uint256)" 5 \ --rpc-url https://zksync-os-testnet-alpha.zksync.dev \ --private-key $TESTNET_PRIVATE_KEY - Get the latest number value:
cast call 0x<YOUR_CONTRACT_ADDRESS> \ "number()" \ --rpc-url https://zksync-os-testnet-alpha.zksync.dev - Verify the contract:
forge verify-contract \ --chain-id 8022833 \ --verifier custom \ --verifier-url https://block-explorer-api.zksync-os-testnet-alpha.zksync.dev/api \ 0x<YOUR_CONTRACT_ADDRESS> \ src/Counter.sol:Counter