Algo Ssstablecoinsss

AI First Flight #2
Beginner FriendlyDeFi
EXP
View results
Submission Details
Impact: high
Likelihood: high
Invalid

Configured eth_usd_price_feed and btc_usd_price_feed addresses have no deployed code on zkSync Era mainnet -- the protocol is completely non-functional as configured

Summary

moccasin.toml's [networks.zksync.contracts] section hardcodes the production price feed addresses that dsc_engine.vy is deployed with. Both eth_usd_price_feed (0xfEefF7c3fB57d18C5C6Cdd71e45D2D0b4F9377bF) and btc_usd_price_feed (0x95Bc57e794aeb02E4a16eff406147f3ce2531F83) have zero deployed bytecode on real zkSync Era mainnet -- verified directly on-chain against two independent RPC endpoints. Any latestRoundData() call the engine makes against either address will fail against an address with no code, making every collateral-value/price-dependent function (deposit_collateral_and_mint_dsc, mint_dsc, liquidate, health_factor, etc.) permanently revert. As configured, the protocol cannot function at all on its actual target chain.

Description

# moccasin.toml
[networks.zksync.contracts]
eth_usd_price_feed = { address = "0xfEefF7c3fB57d18C5C6Cdd71e45D2D0b4F9377bF" }
btc_usd_price_feed = { address = "0x95Bc57e794aeb02E4a16eff406147f3ce2531F83" }
weth = { address = "0xf00DAD97284D0c6F06dc4Db3c32454D4292c6813" }
wbtc = { address = "0xBBeB516fb02a01611cBBE0453Fe3c580D7281011" }

Verified directly against zkSync Era mainnet with cast code <address> --rpc-url https://mainnet.era.zksync.io (cross-checked against a second independent RPC, https://zksync.drpc.org, with identical results):

eth_usd_price_feed (0xfEefF7...) -> code: 0x (NO CONTRACT DEPLOYED)
btc_usd_price_feed (0x95Bc57...) -> code: 0x (NO CONTRACT DEPLOYED)
weth (0xf00DAD...) -> code: 18499 bytes, symbol() = "WETH", decimals() = 18 (correct, real token)
wbtc (0xBBeB51...) -> code: 18499 bytes, symbol() = "WBTC", decimals() = 8 (correct, real token)

The weth/wbtc addresses are genuinely correct, live tokens on zkSync Era -- only the two price feed addresses are wrong/non-existent. dsc_engine.vy's oracle_lib._stale_check_latest_round_data does a staticcall to price_price.latestRoundData(); calling a function on an address with no deployed code returns empty returndata, which fails ABI decoding and reverts. Since every single price-dependent path (_get_usd_value, _get_token_amount_from_usd, and therefore mint_dsc, liquidate, health_factor, deposit_collateral_and_mint_dsc) routes through this call, the entire protocol is unusable the moment it's deployed with this configuration -- deposits alone would work, but nothing that needs a price ever will.

Risk

Likelihood:

  • Deterministic and unconditional -- this isn't a race condition or edge case, it's the literal address baked into the deployment config for the protocol's actual target network (zkSync Era, per the README's own "Compatibilities: Chains: ZKsync Era" and moccasin.toml's dedicated [networks.zksync] section).

Impact:

  • Complete denial of service for the entire protocol on its real target chain -- no one can mint DSC, get liquidated correctly, or read a collateral value, from the moment of deployment. This is the exact class of bug that bricked a real deployment in this same "AI First Flight" series (AirDropper's wrong hardcoded USDC/Merkle-root addresses in Deploy.s.sol).

Proof of Concept

$ cast code 0xfEefF7c3fB57d18C5C6Cdd71e45D2D0b4F9377bF --rpc-url https://mainnet.era.zksync.io
0x
$ cast code 0x95Bc57e794aeb02E4a16eff406147f3ce2531F83 --rpc-url https://mainnet.era.zksync.io
0x

Both configured price feed addresses return empty bytecode on the real, live zkSync Era mainnet -- confirmed against two independent RPC providers to rule out a single-provider indexing issue.

Recommended Mitigation

Replace both price feed addresses with the correct, currently-deployed Chainlink (or equivalent) ETH/USD and BTC/USD price feed contracts on zkSync Era mainnet, and add a deployment-time sanity check (e.g. assert the address has nonzero extcodesize and that a latestRoundData() call succeeds) before considering the engine live.

Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 7 hours ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!