This repository contains the Swaap V2 core smart contracts — along with their tests, configuration, and deployment information.
The monorepo is has 3 main directories:
-
pkg/
: packages meant to be published and deployed. -
dep/
: unpublished smart contract dependencies. -
pvt/
: helpers and scripts for deployment and testing.
v2-interfaces
: Solidity interfaces for all Swaap V2 contracts.v2-errors
: theErrors
solidity library.v2-safeguard-pool
: theSafeguardPool
solidity contract.v2-vault
: theVault
solidity contract, forked from Balancer V2.
This repository uses git submodules to run fuzz tests using forge. Therefore use --recurse-submodules
when cloning:
$ git clone --recurse-submodules https://github.com/swaap-labs/swaap-v2-monorepo.git
Before any tests can be run, the repository needs to be prepared:
$ yarn # install all dependencies
$ yarn build # compile all contracts
In order to run all tests (including those with extra dependencies), run:
$ yarn test # run all tests
To instead run a single package's tests, run:
$ cd pkg/<package> # e.g. cd pkg/vault
$ yarn test
To run fuzz/invariant tests run:
$ cd pkg/<package> # e.g. cd pkg/safeguard-pool
$ yarn test-fuzz
To run test coverage:
$ cd pkg/<package> # e.g. cd pkg/safeguard-pool
$ yarn test-coverage
Swaap v2 SafeguardPool have been audited by Chainsecurity and Quantstamp. The audit reports can be found in the audits folder
of this repository.
All core smart contracts are immutable, and cannot be upgraded.
Most of the Solidity source code is licensed under the GNU General Public License Version 3 (GPL v3): see LICENSE
.
- All files in the
openzeppelin
directory of thebalancer-v2-solidity-utils
package are based on the OpenZeppelin Contracts library, and as such are licensed under the MIT License: see LICENSE. - All other files, including tests and the
pvt
directory are unlicensed.