1/5
## ZkSync Demo This is a demo showing how to work with ZkSync. We'll use the code we've written previously and make a few changes so that it can be executed on ZkSync. The only change we need to make is to set up a ZkSync chain, and then add the contract addresses for each of the contracts that we're using. We've done this in our `mocassin.toml` file. ```toml [networks.zksync] url = "$ZKSYNC_RPC_URL" fork = false is_zksync = true explorer_url = "https://api-era.zksync.network/api" explorer_type = "zksyncExplorer" explorer_api_id = "$ETHERCAN_ZKSYNC_API_KEY" chain_id = 324 ``` We'll then run our script, which will deposit funds, rebalance, and withdraw our funds. ```bash mox run deposit_and_rebalance --network zksync --account smallmoney ``` This will deposit our funds into ZkSync, trade some of the funds, and withdraw the funds again.
A practical demonstration of rebalancing a portfolio on Zksync. The lesson shows how to set up a Zksync chain and contract addresses in a codebase, and how to rebalance the portfolio by withdrawing ETH from Aave Zksync and swapping it for USDC.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
How to build a DeFi stablecoin and customized NFT
How to deploy your smart contract on ZKsync with Moccasin
Advanced testing techniques like stateful and stateless Python fuzzing
How to write algorithmic trading scripts in Python
Hashing signatures, proxies, delegate calls, upgradable contracts, random numbers, and more!
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on April 21, 2025
Duration: 2h 21min
Duration: 1h 58min
Duration: 2h 55min
Duration: 1h 55min
Duration: 46min
Course Overview
About the course
How to build a DeFi stablecoin and customized NFT
How to deploy your smart contract on ZKsync with Moccasin
Advanced testing techniques like stateful and stateless Python fuzzing
How to write algorithmic trading scripts in Python
Hashing signatures, proxies, delegate calls, upgradable contracts, random numbers, and more!
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on April 21, 2025