-
Starts: December 05, 2024 Noon UTC
-
Ends: Dec 12, 2024 Noon UTC
-
nSLOC: 326
This project is meant to be a stablecoin where users can deposit WETH and WBTC in exchange for a token that will be pegged to the USD. The system is meant to be such that someone could fork this codebase, swap out WETH & WBTC for any basket of assets they like, and the code would work the same.
- git
- You'll know you've done it right if you can run
git --version
and see a version number.
- You'll know you've done it right if you can run
- anvil
- You'll know you've done it right if you can run
anvil --version
and see an output likeanvil 0.2.0 (fdd321b 2024-10-15T00:21:13.119600000Z)
- You'll know you've done it right if you can run
- era_test_node and zkvyper
- You'll know you've done it right if you can run
zkvyper --version
andera_test_node --version
- You'll know you've done it right if you can run
- moccasin
- You'll know you've done it right if you can run
mox --version
and get an output like:Moccasin CLI v0.3.0
- You'll know you've done it right if you can run
git clone https://github.com/cyfrin/vy-stablecoin
cd vy-stablecoin
mox install
mox run deploy
mox compile --network eravm
mox test
uv run ruff check --select I --fix
uv run ruff check . --fix
uv run mamushi src
./src
├── decentralized_stable_coin.vy
├── dsc_engine.vy
└── oracle_lib.vy
Chains: ZKsync Era Tokens: WETH and WBTC
The following issues can be ignored.
- A known gas issue, is that we use storage variables instead of immutables for storing the addresses of the collateral. You can ignore this.
- If the protocol ever becomes insolvent, there is almost no way to recover. This is a known issue.
- We don't want the constructor marked as payable, as we like the extra protection it gives us from accidentally deploying a contract with ETH.