|
1 | | -## Foundry |
| 1 | +# ERC-7824 Reference Implementation |
2 | 2 |
|
3 | | -**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** |
| 3 | +This repository is a reference implementation of [ERC-7824](./erc-7824.md), providing a framework for off-chain state channels with built-in dispute resolution and asset management. It features: |
4 | 4 |
|
5 | | -Foundry consists of: |
| 5 | +• Core interfaces for channel definitions and dispute resolution (INitroAdjudicator, IForceMove, IMultiAssetHolder, etc.) |
| 6 | +• Example usage of Nitro-based state channels |
| 7 | +• An optional application pattern (e.g., CountingApp) demonstrating how to extend the framework |
6 | 8 |
|
7 | | -- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools). |
8 | | -- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data. |
9 | | -- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network. |
10 | | -- **Chisel**: Fast, utilitarian, and verbose solidity REPL. |
| 9 | +## Architecture Overview |
11 | 10 |
|
12 | | -## Documentation |
| 11 | +Below is a high-level diagram of how the interfaces in this repository relate to one another: |
13 | 12 |
|
14 | | -https://book.getfoundry.sh/ |
| 13 | +```mermaid |
| 14 | +flowchart LR |
| 15 | + subgraph NitroAdjudicator |
| 16 | + A[INitroAdjudicator] --> B[IMultiAssetHolder] |
| 17 | + A --> C[IForceMove] |
| 18 | + end |
15 | 19 |
|
16 | | -## Usage |
| 20 | + subgraph ForceMove |
| 21 | + C --> D[INitroTypes] |
| 22 | + E[IForceMoveApp] --> D |
| 23 | + end |
17 | 24 |
|
18 | | -### Build |
19 | | - |
20 | | -```shell |
21 | | -$ forge build |
| 25 | + F[IStatusManager]:::gray |
22 | 26 | ``` |
23 | 27 |
|
24 | | -### Test |
| 28 | +Note: |
| 29 | +• INitroAdjudicator extends IForceMove & IMultiAssetHolder. |
| 30 | +• IForceMove and IForceMoveApp rely on the data types in INitroTypes. |
| 31 | +• IStatusManager provides status-tracking (e.g., channel lifecycle). |
25 | 32 |
|
26 | | -```shell |
27 | | -$ forge test |
28 | | -``` |
| 33 | +## Foundry Usage |
29 | 34 |
|
30 | | -### Format |
| 35 | +This project uses Foundry (a fast and portable toolkit for Ethereum application development written in Rust). |
31 | 36 |
|
32 | | -```shell |
33 | | -$ forge fmt |
34 | | -``` |
| 37 | +• Forge → build, test, and manage your Solidity projects (similar to Truffle, Hardhat, or DappTools). |
| 38 | +• Cast → Swiss army knife for interacting with on-chain data. |
| 39 | +• Anvil → Local Ethereum node (similar to Ganache or Hardhat Network). |
| 40 | +• Chisel → Fast and verbose Solidity REPL. |
35 | 41 |
|
36 | | -### Gas Snapshots |
| 42 | +Below are common commands: |
37 | 43 |
|
38 | | -```shell |
39 | | -$ forge snapshot |
| 44 | +### Build and test |
| 45 | +```bash |
| 46 | +forge build |
| 47 | +forge test |
40 | 48 | ``` |
41 | 49 |
|
42 | | -### Anvil |
| 50 | +## Contributing |
43 | 51 |
|
44 | | -```shell |
45 | | -$ anvil |
46 | | -``` |
47 | | - |
48 | | -### Deploy |
| 52 | +Contributions, issues, and pull requests are welcome! Feel free to explore, experiment, and extend this framework to suit various off-chain state channel use cases. |
49 | 53 |
|
50 | | -```shell |
51 | | -$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key> |
52 | | -``` |
| 54 | +## License |
53 | 55 |
|
54 | | -### Cast |
55 | | - |
56 | | -```shell |
57 | | -$ cast <subcommand> |
58 | | -``` |
59 | | - |
60 | | -### Help |
61 | | - |
62 | | -```shell |
63 | | -$ forge --help |
64 | | -$ anvil --help |
65 | | -$ cast --help |
66 | | -``` |
| 56 | +All code is released under an MIT open-source license. See LICENSE for details. |
0 commit comments