> For the complete documentation index, see [llms.txt](https://kolektivo.gitbook.io/kolektivo-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kolektivo.gitbook.io/kolektivo-docs/advanced/smart-contracts.md).

# Smart Contracts

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td></td><td><strong>Monetary System</strong></td><td></td><td><a href="/pages/Ya6aCAtJSIEDRap3P6dg">/pages/Ya6aCAtJSIEDRap3P6dg</a></td><td><a href="/files/6im50VPo0UvAkMiQmT2d">/files/6im50VPo0UvAkMiQmT2d</a></td></tr><tr><td></td><td><strong>Governance System</strong></td><td></td><td><a href="/pages/dgFxsx0GfvnD5AA4FjiB">/pages/dgFxsx0GfvnD5AA4FjiB</a></td><td><a href="/files/oYCiE2uFEASuG9euF9WT">/files/oYCiE2uFEASuG9euF9WT</a></td></tr></tbody></table>

{% hint style="danger" %}
Please note that this experimental software is provided on an "as is" and "as available" basis. We do not give any warranties and will not be liable for any loss incurred through any use of this codebase.
{% endhint %}

## Installation

Kolektivo's smart contracts are developed using the [foundry toolchain](https://getfoundry.sh/).

However, the project also uses hardhat *tasks* and also depends on hardhat.

1. Clone the repository
2. `cd` into the repository
3. Run `forge install` to install contract dependencies
4. Run `yarn` to install hardhat dependencies
5. (*Optional*) Run `source dev.env` to setup environment variables

## Usage

Common tasks are executed through a `Makefile`.

The `Makefile` supports a help command, i.e. `make help`.

```
$ make help
> build                    Build project
> clean                    Remove build artifacts
> test                     Run whole testsuite
> update                   Update dependencies
> [...]
```

## Simulation

This project includes a framework to simulate the contracts on a local node.

To start the simulation, first follow each step described in *Installation*.

Afterwards, start an `anvil` node in a second terminal session.

To start the simulation, run `npx hardhat simulation`.

## Dependencies

* [byterocket's solrocket](https://github.com/byterocket/solrocket)
* [Rari Capital's solmate](https://github.com/rari-capital/solmate)
