This project contains core smart contracts used for the LooksRare exchange protocol ("v2").
It also contains a peripheral contract (OrderValidatorV2A
) that is used to verify the validity of (maker) orders.
# Yarn
yarn add @looksrare/contracts-exchange-v2
# NPM
npm install @looksrare/contracts-exchange-v2
The NPM package contains the following:
- Solidity smart contracts (".sol")
- ABIs (".json")
ABIs are also distributed in the @looksrare/sdk-v2
package.
The documentation for the exchange smart contracts will be available here.
- Run
yarn
- Install Forge
- Run
forge update
- Run
git submodule update
It is a hybrid Hardhat repo that also requires Foundry to run Solidity tests powered by the ds-test library.
To install Foundry, please follow the instructions here.
- Solidity tests are included in the
foundry
folder in thetest
folder at the root of the repo.
forge build
forge test
forge test -vv
forge tree
npx eslint '**/*.{js,ts}'
npx eslint '**/*.{js,ts}' --fix
npx prettier '**/*.{json,sol,md}' --check
npx prettier '**/*.{json,sol,md}' --write
npx solhint 'contracts/**/*.sol'
npx solhint 'contracts/**/*.sol' --fix
It is required to install lcov.
brew install lcov
To run the coverage report, the below command can be executed.
forge coverage --report lcov
LCOV_EXCLUDE=("test/*" "contracts/libraries/*" "contracts/helpers/ProtocolHelpers.sol")
echo $LCOV_EXCLUDE | xargs lcov --output-file lcov-filtered.info --remove lcov.info
genhtml lcov-filtered.info --output-directory out
open out/index.html