Working on an Existing Project
If you download an existing project that uses Foundry, it is really easy to get going.
First, get the project from somewhere. In this example, we will clone the femplate
repository from GitHub:
$ git clone https://github.com/abigger87/femplate
$ cd femplate
$ forge install
We run forge install
to install the submodule dependencies that are in the project.
To build, use forge build
:
$ forge build
Compiling 6 files with 0.8.13
Compiler run successful
And to test, use forge test
:
$ forge test
No files changed, compilation skipped
Running 2 tests for src/test/Greeter.t.sol:GreeterTest
[PASS] testExpectArithmetic() (gas: 8802)
[PASS] testSetGm() (gas: 112032)
Test result: ok. 2 passed; 0 failed; finished in 1.42ms