Swaap Earn Protocol contracts.
Getting Started
Before attempting to setup the repo, first make sure you have Foundry installed and updated, which can be done here.
Building
Install Foundry dependencies and build the project.
forge install
forge build
To install new libraries.
forge install <GITHUB_USER>/<REPO>
Example
forge install transmissions11/solmate
Whenever you install new libraries using Foundry, make sure to update your remappings.txt
file.
Testing
Before running the tests, rename sample.env
to .env
, and add your RPC urls specified.
You can then run the tests with Foundry:
npm run test
or
forge test
To run a specific test file use:
forge test --match-path "path-to-file"
To get the coverage run:
npm run coverage
Use sample.env
as an example to define EXCLUDE
in your .env
which will prune unwanted files from the coverage report. Run the following to visualize the pruned coverage report and open coverage/index.html
:
source .env
lcov --rc lcov_branch_coverage=1 --output-file forge-pruned-lcov.info --remove lcov.info $EXCLUDE
genhtml --branch-coverage --output-directory coverage forge-pruned-lcov.info