# Kanji Smart Contracts

## Preparation
1. Install [foundry](https://github.com/foundry-rs/foundry);
2. Run `foundry install`;

## Architecture
The smart contracts logic is split by encapsulated abstractions, that are located in `/src/extension/`. Some of them referr to the ThirdWeb contracts, but with many functionalities being modified/cut.

Main contracts are located in the root `/src` directory and are:
- `KanjiDropERC721A.sol`
- `KanjiDropERC721R.sol`
- `KanjiDropERC1155.sol`

> **Warning**: ERC1155 is not currently test-covered

## Tests
Tests are located in the `/src/test` folder, and mapped to the layout of the contracts used from the `/src` itself.

To run them, use `foundry test`.

To get more specific data on the internall calls, run `foundry test -vvvv`.

## Coverage
Unfortunately foundry still has some issues with coverage (does not catch up with the constructor internal calls and marks internal functions as non-covered, though they can't be covered, just as in `RoyaltySplitter.sol`)

To run the coverage checks use `foundry coverage`

To get more specific info on the coverage and what branches are covered and not, follow the next command sequence:

> **Warning**: You will need **lcov** installed.
```
$ forge coverage --report lcov
$ genhtml lcov.info -o report --branch-coverage 
$ open report/index.html
```