From d5b69756525f21442d218f526358ff6858c29c7e Mon Sep 17 00:00:00 2001 From: David Philipson Date: Wed, 15 Feb 2023 18:14:58 -0800 Subject: [PATCH] Rename foundry/ to contracts/ --- .github/workflows/ci.yml | 6 +++++- .gitignore | 8 ++++---- .gitmodules | 6 +++--- build.rs | 6 +++--- {foundry => contracts}/README.md | 2 +- {foundry => contracts}/lib/account-abstraction | 0 {foundry => contracts}/lib/forge-std | 0 {foundry => contracts}/lib/openzeppelin-contracts | 0 {foundry => contracts}/src/imports.sol | 0 foundry.toml | 8 ++++---- remappings.txt | 4 ++-- 11 files changed, 22 insertions(+), 18 deletions(-) rename {foundry => contracts}/README.md (94%) rename {foundry => contracts}/lib/account-abstraction (100%) rename {foundry => contracts}/lib/forge-std (100%) rename {foundry => contracts}/lib/openzeppelin-contracts (100%) rename {foundry => contracts}/src/imports.sol (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b49a75d1a..21e534ce8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,11 @@ jobs: cache-on-failure: true - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 - + # Build to generate the ABI bindings. + - name: cargo build + uses: actions-rs/cargo@v1 + with: + command: build - name: cargo fmt uses: actions-rs/cargo@v1 with: diff --git a/.gitignore b/.gitignore index 195f5a44d..51c917ea8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Generated by Cargo # will have compiled files and executables -target/ +/target/ # These are backup files generated by rustfmt *.rs.bk @@ -11,8 +11,8 @@ target/ .vscode # Foundry, configured in foundry.toml -foundry/cache/ -foundry/out/ +/contracts/cache/ +/contracts/out/ # Generated contract bindings, created in build.rs -src/common/contracts +/src/common/contracts diff --git a/.gitmodules b/.gitmodules index 4d05dfb6d..6a73ac4d1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,11 +1,11 @@ [submodule "contracts/lib/account-abstraction"] - path = foundry/lib/account-abstraction + path = contracts/lib/account-abstraction url = https://github.com/eth-infinitism/account-abstraction branch = develop [submodule "contracts/lib/forge-std"] - path = foundry/lib/forge-std + path = contracts/lib/forge-std url = https://github.com/foundry-rs/forge-std branch = v1.3.0 [submodule "foundry/lib/openzeppelin-contracts"] - path = foundry/lib/openzeppelin-contracts + path = contracts/lib/openzeppelin-contracts url = https://github.com/OpenZeppelin/openzeppelin-contracts diff --git a/build.rs b/build.rs index 6847aa39a..de513ce2a 100644 --- a/build.rs +++ b/build.rs @@ -5,8 +5,8 @@ use std::process::Command; use std::{env, error}; fn main() -> Result<(), Box> { - println!("cargo:rerun-if-changed=foundry/lib"); - println!("cargo:rerun-if-changed=foundry/src"); + println!("cargo:rerun-if-changed=contracts/lib"); + println!("cargo:rerun-if-changed=contracts/src"); println!("cargo:rerun-if-changed=proto"); generate_contract_bindings()?; generate_protos()?; @@ -28,7 +28,7 @@ fn generate_contract_bindings() -> Result<(), Box> { fn abigen_of(contract: &str) -> Result> { Ok(Abigen::new( contract, - format!("foundry/out/{contract}.sol/{contract}.json"), + format!("contracts/out/{contract}.sol/{contract}.json"), )? .add_event_derive("serde::Deserialize") .add_event_derive("serde::Serialize")) diff --git a/foundry/README.md b/contracts/README.md similarity index 94% rename from foundry/README.md rename to contracts/README.md index f319e0d8e..e55efb9e9 100644 --- a/foundry/README.md +++ b/contracts/README.md @@ -1,4 +1,4 @@ -# Foundry +# Contracts This directory is a [Foundry](https://getfoundry.sh/) project, although its `foundry.toml` is at the repo root, as is required for the Git submodules that diff --git a/foundry/lib/account-abstraction b/contracts/lib/account-abstraction similarity index 100% rename from foundry/lib/account-abstraction rename to contracts/lib/account-abstraction diff --git a/foundry/lib/forge-std b/contracts/lib/forge-std similarity index 100% rename from foundry/lib/forge-std rename to contracts/lib/forge-std diff --git a/foundry/lib/openzeppelin-contracts b/contracts/lib/openzeppelin-contracts similarity index 100% rename from foundry/lib/openzeppelin-contracts rename to contracts/lib/openzeppelin-contracts diff --git a/foundry/src/imports.sol b/contracts/src/imports.sol similarity index 100% rename from foundry/src/imports.sol rename to contracts/src/imports.sol diff --git a/foundry.toml b/foundry.toml index c19f4de24..bae647032 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,7 +1,7 @@ [profile.default] -src = 'foundry/src' -out = 'foundry/out' -libs = ['foundry/lib'] -cache_path = 'foundry/cache' +src = 'contracts/src' +out = 'contracts/out' +libs = ['contracts/lib'] +cache_path = 'foundrys/cache' # See more config options https://github.com/foundry-rs/foundry/tree/master/config diff --git a/remappings.txt b/remappings.txt index a3c230065..4fb63ee65 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,2 +1,2 @@ -account-abstraction/=foundry/lib/account-abstraction/contracts/ -@openzeppelin/=foundry/lib/openzeppelin-contracts/ +account-abstraction/=contracts/lib/account-abstraction/contracts/ +@openzeppelin/=contracts/lib/openzeppelin-contracts/