Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sunweb3sec/defilabs
On-chain test DeFi using Foundry
https://github.com/sunweb3sec/defilabs
defi foundry solidity
Last synced: 7 days ago
JSON representation
On-chain test DeFi using Foundry
- Host: GitHub
- URL: https://github.com/sunweb3sec/defilabs
- Owner: SunWeb3Sec
- Created: 2022-08-12T14:37:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-11T14:24:40.000Z (over 1 year ago)
- Last Synced: 2024-12-26T02:12:04.992Z (14 days ago)
- Topics: defi, foundry, solidity
- Language: Solidity
- Homepage:
- Size: 70.3 KB
- Stars: 195
- Watchers: 5
- Forks: 68
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DeFiLabs
In-progress.
This repo aim to learn DeFi projects; how the functionality works, on-chain testing, bug finding, fuzzing, CI, etc.
## Getting Started
* Follow the [instructions](https://book.getfoundry.sh/getting-started/installation.html) to install [Foundry](https://github.com/foundry-rs/foundry).
* Clone and install dependencies:```git submodule update --init --recursive```
* To see function signatures you shoul add `--etherscan-api-key YOURAPIKEY` at the end of the `forge test`, you coul get an API key on https://etherscan.io/myapikey
### FlashLoan Testing
UniSwapV2 FlashSwap Testing
```sh
forge test --contracts ./src/test/Uniswapv2_flashswap.sol -vv
```DODO FlashLoan Testing
```sh
forge test --contracts ./src/test/DODO_flashloan.sol -vv
```AAVE FlashLoan Testing
```sh
forge test --contracts ./src/test/Aave_flashloan.sol -vv```
Balancer FlashLoan Testing
```sh
forge test --contracts ./src/test/Balancer_flashloan.sol -vv
```Pancakeswap FlashSwap Testing
```sh
forge test --contracts ./src/test/Pancakeswap_flashswap.sol -vv
```Biswap FlashSwap Testing
```sh
forge test --contracts ./src/test/Biswap_flashloan.sol -vv
```
### ChainLink Testing
getLatestPrice | more tests in-progress
```sh
forge test --contracts ./src/test/Chainlink.sol -vv
```
### Compound Testing
ERC20 - cToken Supply/Redeem/Borrow/Repay | more tests in-progress
```sh
forge test --contracts ./src/test/Compound.sol -vv
```
Goverance - submit proposal | more tests in-progress
```sh
forge test --contracts ./src/test/Compound-dao.sol -vv
```
### UniswapV3 Testing
Get Time Widget Avarge Tick | [Periphery](https://github.com/gakonst/v3-periphery-foundry)
```sh
forge test --contracts ./src/test/Uniswapv3_twap.sol -vv
```
### UniswapV2 Testing
Swap | [Router | Pair | Factory | Library](https://github.com/Jeiwan/zuniswapv2)
```sh
forge test --contracts ./src/test/Uniswapv2.sol -vv
```
### Curve Testing
Swap | more tests in-progress
```sh
forge test --contracts ./src/test/Curve.sol -vv
```### GMX Swap Testing
```sh
forge test --contracts ./src/test/gmx_swap.sol -vv
```
### MakerDAO Testing
### Balancer Testing