###### ###### # #######
# # ###### # # ##### # # # # # #
# # # ## # # # # # # # # #
###### ##### # # # # # # # # # # #
# # # # # # # # # # ####### # #
# # # # ## # # # # # # # #
###### ###### # # ##### ###### # # #######
This repository contains the smart contracts source code and markets configuration for BendDAO V2 Protocol. The repository uses Foundry as development environment for compilation, testing and deployment tasks.
BendDAO V2 Protocol brings you composable lending and leverage. It allows anyone to borrow in an overcollateralized fashion, leverage savings on MakerDAO, leverage stake on Lido, leverage restake with EigenLayer derivatives, bringing together lending and leverage in the same protocol!
V2 Protocol has three user sides to it:
Lenders deposit assets to earn passive yield.
Borrowers can use ERC20 & ERC721 as collaterals to borrow assets in an overcollateralized fashion.
Leverage users can use ERC721 as collaterals to borrow assets to create leverage positions, which can be used across DeFi, NFTs, RWA, etc.
All audits are stored in the audits folder and online.
A bug bounty is open on Immunefi. The rewards and scope are defined here.
Testing with Foundry 🔨
For testing, make sure yarn
and foundry
are installed.
Alternatively, if you only want to set up
Refer to the env.example
for the required environment variable.
npm run test
Test coverage is reported using foundry coverage with lcov report formatting (and optionally, genhtml transformer).
To generate the lcov
report, run the following:
npm run coverage:lcov
The report is then usable either:
- via Coverage Gutters following this tutorial
- via HTML, using
npm run coverage:html
to transform the report and openingcoverage/index.html
2 CI pipelines are currently running on every PR to check that the changes introduced are not modifying the storage layout of proxied smart contracts in an unsafe way:
- storage-layout.sh checks that the latest foundry storage layout snapshot is identical to the committed storage layout snapshot
- foundry-storage-check is in test phase and will progressively replace the snapshot check
In the case the storage layout snapshots checked by storage-layout.sh
are not identical, the developer must commit the updated storage layout snapshot stored under snapshots/ by running:
npm run storage-layout-generate
with the appropriate protocol parameters
Documents in the script folder.
For any questions or feedback, you can send an email to developer@benddao.xyz.
The primary license for BendDAO v2 is the Business Source License 1.1 (BUSL-1.1
), see LICENSE
.
However, some files can also be licensed under GPL-2.0-or-later
(as indicated in their SPDX headers).