From 21ba88a7b618aa235145eac122475380941b9a8b Mon Sep 17 00:00:00 2001 From: Samuel Laferriere Date: Wed, 12 Jun 2024 09:38:55 +0800 Subject: [PATCH] clean-up contracts forge folder --- contracts/.github/workflows/test.yml | 34 ---------- contracts/README.md | 66 ------------------- contracts/{tests => }/anvil/README.md | 0 .../anvil/contracts-deployed-anvil-state.json | 0 .../deploy-contracts-save-anvil-state.sh | 0 ...rt-anvil-chain-with-el-and-avs-deployed.sh | 0 contracts/{tests => }/anvil/utils.sh | 0 contracts/test/Counter.t.sol | 24 ------- 8 files changed, 124 deletions(-) delete mode 100644 contracts/.github/workflows/test.yml delete mode 100644 contracts/README.md rename contracts/{tests => }/anvil/README.md (100%) rename contracts/{tests => }/anvil/contracts-deployed-anvil-state.json (100%) rename contracts/{tests => }/anvil/deploy-contracts-save-anvil-state.sh (100%) rename contracts/{tests => }/anvil/start-anvil-chain-with-el-and-avs-deployed.sh (100%) rename contracts/{tests => }/anvil/utils.sh (100%) delete mode 100644 contracts/test/Counter.t.sol diff --git a/contracts/.github/workflows/test.yml b/contracts/.github/workflows/test.yml deleted file mode 100644 index 9282e829..00000000 --- a/contracts/.github/workflows/test.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: test - -on: workflow_dispatch - -env: - FOUNDRY_PROFILE: ci - -jobs: - check: - strategy: - fail-fast: true - - name: Foundry project - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - - name: Run Forge build - run: | - forge --version - forge build --sizes - id: build - - - name: Run Forge tests - run: | - forge test -vvv - id: test diff --git a/contracts/README.md b/contracts/README.md deleted file mode 100644 index 9265b455..00000000 --- a/contracts/README.md +++ /dev/null @@ -1,66 +0,0 @@ -## Foundry - -**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** - -Foundry consists of: - -- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools). -- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data. -- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network. -- **Chisel**: Fast, utilitarian, and verbose solidity REPL. - -## Documentation - -https://book.getfoundry.sh/ - -## Usage - -### Build - -```shell -$ forge build -``` - -### Test - -```shell -$ forge test -``` - -### Format - -```shell -$ forge fmt -``` - -### Gas Snapshots - -```shell -$ forge snapshot -``` - -### Anvil - -```shell -$ anvil -``` - -### Deploy - -```shell -$ forge script script/Counter.s.sol:CounterScript --rpc-url --private-key -``` - -### Cast - -```shell -$ cast -``` - -### Help - -```shell -$ forge --help -$ anvil --help -$ cast --help -``` diff --git a/contracts/tests/anvil/README.md b/contracts/anvil/README.md similarity index 100% rename from contracts/tests/anvil/README.md rename to contracts/anvil/README.md diff --git a/contracts/tests/anvil/contracts-deployed-anvil-state.json b/contracts/anvil/contracts-deployed-anvil-state.json similarity index 100% rename from contracts/tests/anvil/contracts-deployed-anvil-state.json rename to contracts/anvil/contracts-deployed-anvil-state.json diff --git a/contracts/tests/anvil/deploy-contracts-save-anvil-state.sh b/contracts/anvil/deploy-contracts-save-anvil-state.sh similarity index 100% rename from contracts/tests/anvil/deploy-contracts-save-anvil-state.sh rename to contracts/anvil/deploy-contracts-save-anvil-state.sh diff --git a/contracts/tests/anvil/start-anvil-chain-with-el-and-avs-deployed.sh b/contracts/anvil/start-anvil-chain-with-el-and-avs-deployed.sh similarity index 100% rename from contracts/tests/anvil/start-anvil-chain-with-el-and-avs-deployed.sh rename to contracts/anvil/start-anvil-chain-with-el-and-avs-deployed.sh diff --git a/contracts/tests/anvil/utils.sh b/contracts/anvil/utils.sh similarity index 100% rename from contracts/tests/anvil/utils.sh rename to contracts/anvil/utils.sh diff --git a/contracts/test/Counter.t.sol b/contracts/test/Counter.t.sol deleted file mode 100644 index 54b724f7..00000000 --- a/contracts/test/Counter.t.sol +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.13; - -import {Test, console} from "forge-std/Test.sol"; -import {Counter} from "../src/Counter.sol"; - -contract CounterTest is Test { - Counter public counter; - - function setUp() public { - counter = new Counter(); - counter.setNumber(0); - } - - function test_Increment() public { - counter.increment(); - assertEq(counter.number(), 1); - } - - function testFuzz_SetNumber(uint256 x) public { - counter.setNumber(x); - assertEq(counter.number(), x); - } -}