https://github.com/nikkolasg/foundry-event-flat
https://github.com/nikkolasg/foundry-event-flat
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nikkolasg/foundry-event-flat
- Owner: nikkolasg
- Created: 2022-05-04T15:08:41.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-05-04T16:42:33.000Z (about 3 years ago)
- Last Synced: 2025-01-06T19:35:33.696Z (5 months ago)
- Language: Rust
- Size: 40 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Foundry Rust Monorepo Template


[![Telegram Chat][tg-badge]][tg-url][tg-badge]:
https://img.shields.io/endpoint?color=neon&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Ffoundry_rs
[tg-url]: https://t.me/foundry_rs**Template for quickly getting started with developing Rust applications that
leverage Foundry for EVM smart contract development.**Continuous Integration is already set up to test both your Rust and Solidity
code, as well as ensure formatting and that your Rust bindings match the
Solidity build artifacts.## Directory Structure
The project is structured as a mixed Rust workspace with a Foundry project under
`contracts/` and typesafe auto-generated bindings to the contracts under
`bindings/`.```
├── Cargo.toml
├── app // <-- Your Rust application logic
├── contracts // <- The smart contracts + tests using Foundry
├── bindings // <-- Generated bindings to the smart contracts' abis (like Typechain)
```## Testing
Given the repository contains both Solidity and Rust code, there's 2 different
workflows.### Solidity
Forge is using submodules to manage dependencies. Initialize the dependencies:
```bash
forge install
```If you are in the root directory of the project, run:
```bash
forge test --root ./contracts
```If you are in in `contracts/`:
```bash
forge test
```### Rust
```
cargo test
```## Generating Rust bindings to the contracts
Rust bindings to the contracts can be generated via `forge bind`, which requires
first building your contracts:```
forge build --root ./contracts
forge bind --bindings-path ./bindings --root ./contracts --crate-name bindings
```Any follow-on calls to `forge bind` will check that the generated bindings match
the ones under the build files. If you want to re-generate your bindings, pass
the `--overwrite` flag to your `forge bind` command.## Installing Foundry
First run the command below to get `foundryup`, the Foundry toolchain installer:
```sh
curl -L https://foundry.paradigm.xyz | bash
```Then, in a new terminal session or after reloading your `PATH`, run it to get
the latest `forge` and `cast` binaries:```sh
foundryup
```For more, see the official
[docs](https://github.com/gakonst/foundry#installation).