Please read and get familiar with Vesper. This repository contains set of smart contracts and test cases of Vesper pools.
-
Install
git clone --recursive https://github.com/vesperfi/vesper-pools-v2.git cd vesper-pools-v2 npm install npm run compile
-
set NODE_URL in env
export NODE_URL=<eth mainnet url>
-
Test
Note: These tests will fork the mainnet as required in step 3. It is not recommended to run all tests at once, but rather to specify a single file.
- Run single file
npm test test/veth-aave.js
- Or run them all (but some will fail, because of state modifications to the forked chain)
npm test
Fork mainnet using ganache
npm run fork
Coverage will launch its own in-process ganache server, so all you need to run is below command.
npm run coverage
Coverage for one file
npm run coverage -- --testfiles "<<filename>>"
If you get heap memory error in solidity coverage then try below command
node --max-old-space-size=4096 ./node_modules/.bin/hardhat coverage --testfiles "fileName"