# Echidna: 高速スマートコントラクトファザー <a href="https://raw.githubusercontent.com/crytic/echidna/master/echidna.png"><img src="https://assets.kitploit.com/production/public/readmes/2659/763a0b6f546e53fe33e871cd7359ba47272d81be37527f1cceaa827256af0337.png" width="75"/></a>

Echidnaはバグを食べる奇妙な生き物で、非常に感電しやすい(Jacob Stanleyに謝罪します)
真面目な話、EchidnaはEthereumスマートコントラクトのファジング/プロパティベーステスト用に設計されたHaskellプログラムです。ユーザー定義の述語や[Solidityアサーション](https://docs.soliditylang.org/en/develop/control-structures.html#error-handling-assert-require-revert-and-exceptions)を反証するために、[コントラクトABI](https://docs.soliditylang.org/en/develop/abi-spec.html)に基づいた高度な文法ベースのファジングキャンペーンを使用します。Echidnaはモジュール性を考慮して設計されているため、新しいミューテーションを追加したり、特定のケースで特定のコントラクトをテストするために簡単に拡張できます。
## 機能
* 実際のコードに合わせた入力を生成
* オプションのコーパス収集、ミューテーション、カバレッジガイダンスにより、より深いバグを発見
* ファジングキャンペーン前に有用な情報を抽出するために[Slither](https://github.com/crytic/slither)を採用
* ファジングキャンペーン後にどの行がカバーされたかを特定するソースコード統合
* インタラクティブなターミナルUI、テキストのみまたはJSON出力
* 迅速なトリアージのための自動テストケース最小化
* 開発ワークフローへのシームレスな統合
.. そして[美しい高解像度のハンドクラフトロゴ](https://raw.githubusercontent.com/crytic/echidna/master/echidna.png)。
<a href="https://i.imgur.com/saFWti4.png"><img src="https://assets.kitploit.com/production/public/readmes/2659/ec117cf17d5b4eeb75f52a3654df19ba615818f232d5e9238093cf010431fedc.png" width="650"/></a>
## 使用方法
### テストランナーの実行
Echidnaのコア機能は`echidna`と呼ばれる実行ファイルで、コントラクトと不変条件(常に真であり続けるべきプロパティ)のリストを入力として受け取ります。各不変条件について、コントラクトへのランダムな呼び出しシーケンスを生成し、不変条件が成立するかどうかをチェックします。不変条件を反証する方法を見つけられれば、それを実現する呼び出しシーケンスを出力します。見つけられなければ、コントラクトが安全であるというある程度の保証が得られます。
### 不変条件の記述
不変条件は、名前が`echidna_`で始まり、引数がなく、ブール値を返すSolidity関数として表現されます。例えば、`20`を下回ってはならない`balance`変数がある場合、コントラクトに次のような追加関数を書くことができます:```solidity
function echidna_check_balance() public returns (bool) {
return(balance >= 20);
}
```
不変条件を確認するには、次を実行します:```sh
$ echidna myContract.sol
```
テスト付きのコントラクト例は [tests/solidity/basic/flags.sol](https://github.com/crytic/echidna/blob/master/tests/solidity/basic/flags.sol) にあります。実行するには、次を実行してください:```sh
$ echidna tests/solidity/basic/flags.sol
```
Echidna は `echidna_sometimesfalse` を偽造する呼び出しシーケンスを見つけるべきであり、`echidna_alwaystrue` に対する偽造入力を見つけることはできないはずです。
### テストモード
上記の例ではデフォルトの **property** モードを使用していますが、Echidna はいくつかのテストモードをサポートしており、設定ファイルの `testMode` または CLI の `--test-mode` で設定できます:
* **`property`**(デフォルト):`bool` を返す `echidna_` プレフィックス付き関数をテストします。
* **`assertion`**:`assert()` および Foundry の `assertX` ヘルパー(`assertTrue`、`assertEq` など)によるアサーション失敗を検出します。
* **`foundry`**:Foundry スタイルのテストを実行し、その命名規則に従います:`test` プレフィックス付きのユニットテストおよびファズテスト(`testFail` プレフィックス付きのものは revert が期待されます)と、`invariant` または `statefulFuzz` プレフィックス付きのステートフル不変条件です。`check` および `prove` プレフィックス付き関数はシンボリックエントリポイントですが、このモードはファジングキャンペーンであるため、他のテスト関数と同様にファズされます。
* **`verification`**:単一トランザクションを使用してコントラクトの各関数をシンボリックに検証します。`check` および `prove` プレフィックス付き関数は常にエントリポイントとして使用されます。
* **`overflow`**:整数のオーバーフロー/アンダーフローを検出します(Solidity >= 0.8.0)。
* **`optimization`**:`int256` を返す `echidna_` プレフィックス付き関数の戻り値を最大化します(property モードと同じ設定可能なプレフィックスを使用)。
* **`exploration`**:プロパティをチェックせずにカバレッジを収集します。
### カバレッジの収集と可視化
キャンペーン終了後、Echidna は `corpusDir` 設定オプションで指定された特別なディレクトリに、カバレッジを最大化する **コーパス** を保存できます。このディレクトリには 2 つのエントリが含まれます:(1) Echidna で再生可能な JSON ファイルを含む `coverage` という名前のディレクトリ、および (2) カバレッジ注釈付きのソースコードのコピーである `covered.txt` という名前のプレーンテキストファイルです。
`tests/solidity/basic/flags.sol` の例を実行すると、Echidna は `coverage` ディレクトリにシリアライズされたトランザクションのいくつかのファイルと、以下の行を含む `covered.$(date +%s).txt` ファイルを保存します:```text
*r | function set0(int val) public returns (bool){
* | if (val % 100 == 0)
* | flag0 = false;
}
*r | function set1(int val) public returns (bool){
* | if (val % 10 == 0 && !flag0)
* | flag1 = false;
}
```
私たちのツールは、コーパス内の各実行トレースに以下の「行マーカー」を付けて示します:
* `*` 実行が STOP で終了した場合
* `r` 実行が REVERT で終了した場合
* `o` 実行が out-of-gas エラーで終了した場合
* `e` 実行がその他のエラー(ゼロ除算、アサーション失敗など)で終了した場合
### スマートコントラクトビルドシステムのサポート
Echidna は、[crytic-compile](https://github.com/crytic/crytic-compile) を使用して、[Foundry](https://book.getfoundry.sh/)、[Hardhat](https://hardhat.org/)、[Truffle](https://archive.trufflesuite.com/) など、さまざまなスマートコントラクトビルドシステムでコンパイルされたコントラクトをテストできます。現在のコンパイルフレームワークで Echidna を呼び出すには、`echidna .` を使用します。
さらに、Echidna は複雑なコントラクトをテストするための 2 つのモードをサポートしています。第一に、[既存のネットワーク状態を利用](https://secure-contracts.com/program-analysis/echidna/advanced/state-network-forking.html)し、それを Echidna のベース状態として使用できます。第二に、Echidna は CLI で対応する Solidity ソースを渡すことにより、既知の ABI を持つ任意のコントラクトを呼び出すことができます。これを有効にするには、設定で `allContracts: true` を使用します。
### Echidna のクラッシュコース
私たちの [Building Secure Smart Contracts](https://github.com/crytic/building-secure-contracts/tree/master/program-analysis/echidna#echidna-tutorial) リポジトリには、例、レッスン、演習を含む Echidna のクラッシュコースが含まれています。
### GitHub Actions ワークフローでの Echidna の使用
GitHub Actions ワークフローの一部として `echidna` を実行するために使用できる Echidna アクションがあります。使用方法と例については、[crytic/echidna-action](https://github.com/crytic/echidna-action) リポジトリを参照してください。
### 設定オプション
Echidna の CLI を使用して、テストするコントラクトを選択し、設定ファイルを読み込むことができます。```sh
$ echidna contract.sol --contract TEST --config config.yaml
```
設定ファイルでは、ユーザーが EVM およびテスト生成パラメータを選択できます。デフォルトオプションを含む完全で注釈付きの設定ファイルの例は、
[tests/solidity/basic/default.yaml](https://github.com/crytic/echidna/blob/master/tests/solidity/basic/default.yaml) にあります。
利用可能な設定オプションの詳細については、[ドキュメント](https://secure-contracts.com/program-analysis/echidna/configuration.html)を参照してください。
Echidna は 3 種類の異なる出力ドライバをサポートしています。デフォルトの `text`
ドライバ、`json` ドライバ、そしてすべての `stdout` 出力を抑制する `none`
ドライバがあります。JSON ドライバはキャンペーン全体を次のように報告します。```
Campaign = {
"success" : bool,
"error" : string?,
"tests" : [Test],
"seed" : number,
"coverage" : Coverage
}
Test = {
"contract" : string,
"name" : string,
"status" : string,
"error" : string?,
"testType" : string,
"transactions" : [Transaction]?
}
Transaction = {
"contract" : string,
"function" : string,
"arguments" : [string]?,
"gas" : number,
"gasprice" : number
}
```
`Coverage` は、特定のカバレッジを増加させる呼び出しを記述する dict です。これらのインターフェースは、後日、もう少しユーザーフレンドリーになるように変更される可能性があります。`testType` は `property`、`assertion`、`optimization`、`exploration`、または `call` のいずれかであり、`status` は常に `fuzzing`、`shrinking`、`solved`、`passed`、または `error` のいずれかを取ります。
### パフォーマンス問題のデバッグ
Echidna のパフォーマンス問題を診断する一つの方法は、プロファイリングを有効にして `echidna` を実行することです。
基本的なプロファイリングで Echidna を実行するには、元の `echidna` コマンドに `+RTS -p -s` を追加します:```sh
$ nix develop # alternatively nix-shell
$ cabal --enable-profiling run echidna -- ... +RTS -p -s
$ less echidna.prof
```
これにより、どの関数が最も多くの CPU とメモリを使用しているかを示すレポートファイル(`echidna.prof`)が生成されます。
基本的なプロファイリングで問題が解決しない場合は、より[高度なプロファイリング手法](https://haskell.foundation/hs-opt-handbook.github.io/src/Measurement_Observation/Haskell_Profiling/eventlog.html)を使用できます。
私たちが観察したパフォーマンス問題の一般的な原因:
- ホットパスで呼び出される高コストな関数
- thunk を蓄積する遅延データコンストラクタ
- ホットパスで使用される非効率なデータ構造
これらを確認することは良い出発点です。ある計算が遅延しすぎてメモリをリークしている疑いがある場合は、`Control.DeepSeq` の `force` を使用して確実に評価させることができます。
## 制限事項と既知の問題
EVM エミュレーションとテストは困難です。Echidna の最新リリースにはいくつかの制限があります。これらの一部は [hevm](https://github.com/argotorg/hevm) から継承されたものであり、一部は設計/パフォーマンス上の決定や単なるコードのバグによるものです。ここでは、対応する issue とステータス("wont fix"、"on hold"、"in review"、"fixed")とともに一覧を示します。"fixed" の issue は、次の Echidna リリースに含まれる予定です。
| 説明 | Issue | ステータス |
| :--- | :---: | :---: |
| Vyper のサポートは限定的 | [#652](https://github.com/crytic/echidna/issues/652) | *wont fix* |
| テスト用のライブラリサポートが限定的 | [#651](https://github.com/crytic/echidna/issues/651) | *wont fix* |
## インストール
### コンパイル済みバイナリ
始める前に、Slither が[インストール](https://github.com/crytic/slither)されていることを確認してください(`pip3 install slither-analyzer --user`)。Linux または MacOS で Echidna を素早くテストしたい場合、Ubuntu 上でビルドされた静的にリンクされた Linux バイナリと、ほぼ静的な MacOS バイナリを[リリースページ](https://github.com/crytic/echidna/releases)で提供しています。[CI パイプライン](https://github.com/crytic/echidna/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush)からも同じ種類のバイナリを入手できます。コミットをクリックして Linux または MacOS 用のバイナリを見つけてください。
### Homebrew (macOS / Linux)
Mac または Linux マシンに Homebrew がインストールされている場合、`brew install echidna` を実行することで Echidna とそのすべての依存関係(Slither、crytic-compile)をインストールできます。
`brew install --HEAD echidna` を実行することで、最新の `master` ブランチのコードをコンパイルしてインストールすることもできます。
詳細については、[`echidna` Homebrew Formula](https://formulae.brew.sh/formula/echidna) ページを参照してください。Formula 自体は [homebrew-core リポジトリ](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/e/echidna.rb)の一部として維持されています。
### Docker コンテナ
ビルド済みの Docker コンテナを使用したい場合は、GitHub Actions で自動ビルドされる [docker パッケージ](https://github.com/orgs/crytic/packages?repo_name=echidna)をチェックしてください。`echidna` コンテナは `ubuntu:noble` をベースにしており、Echidna を使用するのに十分な柔軟性を持つ小さなイメージとなることを意図しています。`echidna` のビルド済みバージョンに加えて、`slither`、`crytic-compile`、`solc-select`、`nvm`、および `foundry`(`forge`、`cast`、`anvil`、`chisel` を含む)を 200 MB 未満で提供します。
コンテナイメージは現在 x86 システムでのみビルドされることに注意してください。Mac M1 システムなどの ARM デバイスでの実行は、CPU エミュレーションによるパフォーマンス低下のため推奨されません。
Docker コンテナイメージには異なるタグが利用可能です:
| タグ | タグ内のビルド
|---------------|-------------
| `vx.y.z` | リリース `vx.y.z` に対応するビルド
| `latest` | 最新の Echidna タグ付きリリース。
| `edge` | デフォルトブランチの最新コミット。
| `testing-foo` | `foo` ブランチに基づくテストビルド。
最新バージョンの Echidna でコンテナを対話的に実行するには、次のようなコマンドを使用できます。現在のディレクトリをコンテナ内の `/src` としてマップし、`echidna` を使用できるシェルを提供します:```sh
$ docker run --rm -it -v "$(pwd)":/src ghcr.io/crytic/echidna/echidna
```
そうでなければ、Echidnaの最新バージョンをローカルでビルドしたい場合は、Dockerの使用を推奨します。このリポジトリのクローン内で、以下のコマンドを実行してDockerコンテナイメージをビルドします:```sh
$ docker build -t echidna -f docker/Dockerfile --target final-ubuntu .
```
次に、`echidna` イメージをローカルで実行できます。例えば、solc
0.5.7 をインストールして `tests/solidity/basic/flags.sol` をチェックするには、次のように実行します:```sh
$ docker run -it -v "$(pwd)":/src echidna bash -c "solc-select install 0.5.7 && solc-select use 0.5.7 && echidna /src/tests/solidity/basic/flags.sol"
```
Dockerイメージには、包括的なスマートコントラクトの開発とテストのためのFoundryツールも含まれています。コンテナ内で `forge`、`cast`、`anvil`、`chisel` を直接使用できます:```sh
# Run an interactive shell with Foundry tools available
$ docker run -it -v "$(pwd)":/src echidna bash
# Inside the container, you can use Foundry commands:
$ forge --version
$ cast --version
$ anvil --version
$ chisel --version
# Example: Initialize a new Foundry project
$ forge init my-project
$ cd my-project
$ forge build
$ forge test
```
### Stack を使用したビルド
ソースからビルドしたい場合は、[Stack](https://docs.haskellstack.org/en/stable/) を使用してください。`stack install` で `echidna` がビルドおよびコンパイルされ、`~/.local/bin` に配置されます。libreadline と libsecp256k1(recovery を有効にしてビルドされたもの)に対してリンクする必要があり、これらはお好みのパッケージマネージャーでインストールしてください。また、[libff](https://github.com/scipr-lab/libff) の最新リリースもインストールする必要があります。手順については[CI テスト](https://github.com/crytic/echidna/blob/master/.github/scripts/install-libff.sh)を参照してください。
一部の Linux ディストリビューションでは、Haskell が必要とする特定のものに対して静的ライブラリを提供していません(例: Arch Linux)。これは `-static` フラグを使用しているため、`stack build` がリンクエラーで失敗する原因となります。その場合は、`--flag echidna:-static` を使用して動的にリンクされたバイナリを生成してください。
リンク関連のビルドエラーが発生する場合は、`--extra-include-dirs` と `--extra-lib-dirs` を調整してみてください。
### Nix を使用したビルド(Apple M1 システムでネイティブに動作)
[Nix ユーザー](https://nixos.org/download/)は、以下で最新の Echidna をインストールできます:```sh
$ nix-env -i -f https://github.com/crytic/echidna/tarball/master
```
With flakes を有効にすると、このリポジトリから直接 Echidna を実行できます:```sh
$ nix run github:crytic/echidna # master
$ nix run github:crytic/echidna/v2.1.1 # specific ref (tag/branch/commit)
```
Nix以外のmacOSシステム向けにスタンドアロンリリースをビルドするには、以下によりEchidnaをほぼ静的リンクされたバイナリとしてビルドできます。これはLinuxシステムでも使用でき、完全に静的リンクされたバイナリを生成できます。```sh
$ nix build .#echidna-redistributable
```
Nixは`crytic-compile`や`solc`を含む、開発に必要なすべての依存関係を自動的にインストールします。Echidnaの開発を素早く始める方法は次のとおりです:```sh
$ git clone https://github.com/crytic/echidna
$ cd echidna
$ nix develop # alternatively nix-shell
[nix-shell]$ cabal run echidna
[nix-shell]$ cabal run tests
[nix-shell]$ cabal new-repl
```
### テストスイートの実行
`cabal run tests` は Haskell スイートであり、Echidna がプロセス内で行うすべてをカバーします。
MCP サーバーは代わりにプロセス外でテストされます。実際のキャンペーンを開始し、エージェントクライアントが行うように操作することでテストされます。このスイートは Python で、`$PATH` 上に `echidna` が必要です:```sh
$ pip install -r tests/mcp/requirements-test.txt
$ pytest tests/mcp -v
```
`ECHIDNA_MCP_URL` で自分で開始したキャンペーンを指定するか、`ECHIDNA_MCP_PORT` で別のポートを、`ECHIDNA_BIN` で特定のバイナリを指定できます。同じインターフェースを通じてエージェントがキャンペーンを実行する例は [examples/](https://github.com/crytic/echidna/blob/master/examples/README.md) にあります。
## Echidna の公開利用事例
### プロパティテストスイート
以下は Echidna をテストに使用しているスマートコントラクトプロジェクトの一部です:
* [Curvance](https://github.com/curvance/Curvance-CantinaCompetition/tree/CodeFAQAndAdjustments/tests/fuzzing)
* [Primitive](https://github.com/primitivefinance/rmm-core/tree/main/contracts/crytic)
* [Uniswap-v3](https://github.com/search?q=org%3AUniswap+echidna&type=commits)
* [Balancer](https://github.com/balancer/balancer-core/tree/master/echidna)
* [MakerDAO vest](https://github.com/makerdao/dss-vest/pull/16)
* [Optimism DAI Bridge](https://github.com/makerdao/optimism-dai-bridge/blob/master/contracts/test/DaiEchidnaTest.sol)
* [WETH10](https://github.com/WETH10/WETH10/tree/main/contracts/fuzzing)
* [Yield](https://github.com/yieldprotocol/fyDai/pull/312)
* [Convexity Protocol](https://github.com/opynfinance/ConvexityProtocol/tree/dev/contracts/echidna)
* [Aragon Staking](https://github.com/aragon/staking/blob/82bf54a3e11ec4e50d470d66048a2dd3154f940b/packages/protocol/contracts/test/lib/EchidnaStaking.sol)
* [Centre Token](https://github.com/circlefin/stablecoin-evm/tree/release-2024-03-15T223309/echidna_tests)
* [Tokencard](https://github.com/tokencard/contracts/tree/master/tools/echidna)
* [Minimalist USD Stablecoin](https://github.com/usmfum/USM/pull/41)
### セキュリティレビュー
以下は Echidna を使用して脆弱性を発見した公開セキュリティレビューです
- [Advanced Blockchain](https://github.com/trailofbits/publications/blob/master/reviews/AdvancedBlockchain.pdf)
- [Amp](https://github.com/trailofbits/publications/blob/master/reviews/amp.pdf)
- [Ampleforth](https://github.com/trailofbits/publications/blob/master/reviews/ampleforth.pdf)
- [Atlendis](https://github.com/trailofbits/publications/blob/master/reviews/2023-03-atlendis-atlendissmartcontracts-securityreview.pdf)
- [Balancer](https://github.com/trailofbits/publications/blob/master/reviews/2021-04-balancer-balancerv2-securityreview.pdf)
- [Basis](https://github.com/trailofbits/publications/blob/master/reviews/basis.pdf)
- [Dai](https://github.com/trailofbits/publications/blob/master/reviews/mc-dai.pdf)
- [Frax](https://github.com/trailofbits/publications/blob/master/reviews/FraxQ22022.pdf)
- [Liquity](https://github.com/trailofbits/publications/blob/master/reviews/LiquityProtocolandStabilityPoolFinalReport.pdf)
- [LooksRare](https://github.com/trailofbits/publications/blob/master/reviews/LooksRare.pdf)
- [Maple](https://github.com/trailofbits/publications/blob/master/reviews/2022-03-maplefinance-securityreview.pdf)
- [Optimism](https://github.com/trailofbits/publications/blob/master/reviews/2022-11-optimism-securityreview.pdf)
- [Opyn](https://github.com/trailofbits/publications/blob/master/reviews/Opyn.pdf)
- [Origin Dollar](https://github.com/trailofbits/publications/blob/master/reviews/OriginDollar.pdf)
- [Origin](https://github.com/trailofbits/publications/blob/master/reviews/origin.pdf)
- [Paxos](https://github.com/trailofbits/publications/blob/master/reviews/paxos.pdf)
- [Primitive](https://github.com/trailofbits/publications/blob/master/reviews/Primitive.pdf)
- [RocketPool](https://github.com/trailofbits/publications/blob/master/reviews/RocketPool.pdf)
- [Seaport](https://github.com/trailofbits/publications/blob/master/reviews/SeaportProtocol.pdf)
- [Set Protocol](https://github.com/trailofbits/publications/blob/master/reviews/setprotocol.pdf)
- [Shell protocol](https://github.com/trailofbits/publications/blob/master/reviews/ShellProtocolv2.pdf)
- [Sherlock](https://github.com/trailofbits/publications/blob/master/reviews/Sherlockv2.pdf)
- [Pegasys Pantheon](https://github.com/trailofbits/publications/blob/master/reviews/pantheon.pdf)
- [TokenCard](https://github.com/trailofbits/publications/blob/master/reviews/TokenCard.pdf)
- [Uniswap](https://github.com/trailofbits/publications/blob/master/reviews/UniswapV3Core.pdf)
- [Yearn](https://github.com/trailofbits/publications/blob/master/reviews/YearnV2Vaults.pdf)
- [Yield](https://github.com/trailofbits/publications/blob/master/reviews/YieldProtocol.pdf)
- [88mph](https://github.com/trailofbits/publications/blob/master/reviews/88mph.pdf)
- [0x](https://github.com/trailofbits/publications/blob/master/reviews/0x-protocol.pdf)
### トロフィー
以下のセキュリティ脆弱性は Echidna によって発見されました。本ツールを使用してセキュリティ脆弱性を発見した場合は、関連情報を添えて PR を送信してください。
| Project | Vulnerability | Date |
|--|--|--|
[0x Protocol](https://github.com/trailofbits/publications/blob/master/reviews/0x-protocol.pdf) | 注文が約定できない場合、キャンセルすることもできない | Oct 2019
[0x Protocol](https://github.com/trailofbits/publications/blob/master/reviews/0x-protocol.pdf) | 注文をゼロで部分約定できる場合、1トークンで部分約定できる | Oct 2019
[0x Protocol](https://github.com/trailofbits/publications/blob/master/reviews/0x-protocol.pdf) | 有効な入力パラメータを使用した場合、cobbdouglas 関数がリバートしない | Oct 2019
[Balancer Core](https://github.com/trailofbits/publications/blob/master/reviews/BalancerCore.pdf) | 攻撃者はパブリックプールから資産を盗むことができない | Jan 2020
[Balancer Core](https://github.com/trailofbits/publications/blob/master/reviews/BalancerCore.pdf) | 攻撃者は joinPool で無料のプールトークンを生成できない | Jan 2020
[Balancer Core](https://github.com/trailofbits/publications/blob/master/reviews/BalancerCore.pdf) | joinPool-exitPool を呼び出しても無料のプールトークンにはつながらない | Jan 2020
[Balancer Core](https://github.com/trailofbits/publications/blob/master/reviews/BalancerCore.pdf) | exitswapExternAmountOut を呼び出しても無料の資産にはつながらない | Jan 2020
[Liquity Dollar](https://github.com/trailofbits/publications/blob/master/reviews/Liquity.pdf) | [トローブを閉じるには、発行された LUSD の全額を保有する必要がある](https://github.com/liquity/dev/blob/echidna_ToB_final/packages/contracts/contracts/TestContracts/E2E.sol#L242-L298) | Dec 2020
[Liquity Dollar](https://github.com/trailofbits/publications/blob/master/reviews/Liquity.pdf) | [トローブが不適切に削除される可能性がある](https://github.com/liquity/dev/blob/echidna_ToB_final/packages/contracts/contracts/TestContracts/E2E.sol#L242-L298) | Dec 2020
[Liquity Dollar](https://github.com/trailofbits/publications/blob/master/reviews/Liquity.pdf) | 初回の redeem が予期せずリバートする可能性がある | Dec 2020
[Liquity Dollar](https://github.com/trailofbits/publications/blob/master/reviews/Liquity.pdf) | 償還なしの redeem が依然として成功を返す可能性がある | Dec 2020
[Origin Dollar](https://github.com/trailofbits/publications/blob/master/reviews/OriginDollar.pdf) | ユーザーは保有量を超えるトークンを送金することが許可されている | Nov 2020
[Origin Dollar](https://github.com/trailofbits/publications/blob/master/reviews/OriginDollar.pdf) | ユーザー残高が総供給量を超える可能性がある | Nov 2020
[Yield Protocol](https://github.com/trailofbits/publications/blob/master/reviews/YieldProtocol.pdf) | トークンの売買における算術計算が不正確である | Aug 2020
### 研究
Echidna を使用してスマートコントラクトファジング論文の研究例を再現し、どれだけ迅速に解決策を見つけられるかを示すこともできます。これらはすべて、ラップトップコンピュータ上で数秒から1〜2分で解決できます。
| Source | Code
|--|--
[Using automatic analysis tools with MakerDAO contracts](https://forum.openzeppelin.com/t/using-automatic-analysis-tools-with-makerdao-contracts/1021) | [SimpleDSChief](https://github.com/crytic/echidna/blob/master/tests/solidity/research/vera_dschief.sol)
[Integer precision bug in Sigma Prime](https://github.com/muellerberndt/sabre#example-2-integer-precision-bug) | [VerifyFunWithNumbers](https://github.com/crytic/echidna/blob/master/tests/solidity/research/solcfuzz_funwithnumbers.sol)
[Learning to Fuzz from Symbolic Execution with Application to Smart Contracts](https://files.sri.inf.ethz.ch/website/papers/ccs19-ilf.pdf) | [Crowdsale](https://github.com/crytic/echidna/blob/master/tests/solidity/research/ilf_crowdsale.sol)
[Harvey: A Greybox Fuzzer for Smart Contracts](https://arxiv.org/abs/1905.06944) | [Foo](https://github.com/crytic/echidna/blob/master/tests/solidity/research/harvey_foo.sol), [Baz](https://github.com/crytic/echidna/blob/master/tests/solidity/research/harvey_baz.sol)
### 学術論文
| Paper Title | Venue | Publication Date |
| --- | --- | --- |
| [echidna-parade: Diverse multicore smart contract fuzzing](https://agroce.github.io/issta21.pdf) | [ISSTA 2021](https://conf.researchr.org/home/issta-2021) | July 2021 |
| [Echidna: Effective, usable, and fast fuzzing for smart contracts](https://agroce.github.io/issta20.pdf) | [ISSTA 2020](https://conf.researchr.org/home/issta-2020) | July 2020 |
| [Echidna: A Practical Smart Contract Fuzzer](https://github.com/trailofbits/publications/blob/master/papers/echidna_fc_poster.pdf) | [FC 2020](https://fc20.ifca.ai/program.html) | Feb 2020 |
Echidna を学術研究に使用している場合は、[Crytic $10k Research Prize](https://blog.trailofbits.com/2019/11/13/announcing-the-crytic-10k-research-prize/) への応募を検討してください。
## ヘルプの入手
Echidna の使用や拡張についてのサポートが必要な場合は、[Empire Hacking](https://slack.empirehacking.nyc/) の #ethereum Slack チャンネルにお気軽にお越しください。
* まずはこれらのシンプルな [Echidna インバリアント](https://github.com/crytic/echidna/blob/master/tests/solidity/basic/flags.sol) を確認して始めましょう
* より詳細な質問については、Echidna 開発チームに直接[メール](mailto:[email protected])することを検討してください
## ライセンス
Echidna は [AGPLv3 ライセンス](https://github.com/crytic/echidna/blob/master/LICENSE) の下でライセンスされ、配布されています。