本文へ移動
← すべてのコース
コース · Foundry 習得

Foundry を極める — Rust 規律を Solidity へ移す

openhl 構築コース群が Rust で守っている検証の規律を、Solidity のコントラクトに持ち込む。proptest! / debug_assert! / 保存則 / byte-for-byte の答え合わせを 1:1 で移す。forge test、fuzz テストと invariant テスト、cast、anvil と cheatcodes の順に進む。最後の Capstone では openhl-liquidation の InsuranceFund を Rust から Solidity へ移し、同じ shortfall の保存則を 2 つの言語で確かめる(Foundry 側は 4 つの invariant)。中級のコースで、Foundry の入口になる。

Rust Ethereum のスタックを学ぶ · スタックの内部 — 順不同

コースを始める →中級約 4 時間7 レッスン

Orientation

  1. Foundry を極める — すでに Rust で考えるエンジニアのための Solidity テスト規律15 分

Test discipline

  1. レッスン1 — `forge test` — `cargo test` の Solidity 等価物25 分
  2. レッスン2 — fuzz テスト — Solidity の `proptest!`35 分
  3. レッスン3 — invariant テスト — Handler パターンによる multi-call テスト40 分

CLI & state-aware testing

  1. レッスン4 — `cast` — EVM の curl + jq30 分
  2. レッスン5 — `anvil` + cheatcodes — real な mainnet state でのローカル開発35 分

Capstone

  1. レッスン6 — Capstone — openhl-liquidation の `InsuranceFund` を Solidity へ port し 4 つの invariant を証明する60 分