Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Carbonable/carbon-protocol

Carbon Starknet Protocol written in Cairo.
https://github.com/Carbonable/carbon-protocol

cairo carbon-offsetting starknet

Last synced: about 1 month ago
JSON representation

Carbon Starknet Protocol written in Cairo.

Awesome Lists containing this project

README

        


Carbon Protocol on Starknet










Carbonable contracts written in Cairo for StarkNet.


## Usage

> ## ⚠️ WARNING! ⚠️
>
> This repo contains highly experimental code.
> Expect rapid iteration.
> **Use at your own risk.**

### Set up the project

#### πŸ“¦ Install the requirements

- [protostar](https://github.com/software-mansion/protostar)

### πŸŽ‰ Install

```bash
protostar install
```

### ⛏️ Compile

```bash
protostar build
```

### 🌑️ Test

```bash
# Run all tests
protostar test

# Run only unit tests
protostar test tests/units

# Run only integration tests
protostar test tests/integrations
```

### 🌐 Test account

If you want a fresh account for tests, you can deploy an account with the following command:

```bash
starknet deploy_account --network=
```

It will generate the account information into the `~/.starknet_accounts/starknet_open_zeppelin_accounts.json` file.
See also starknet [documentation](https://www.cairo-lang.org/docs/hello_starknet/account_setup.html#creating-an-account) for more details.

### πŸ’‹ Format code

```bash
cairo-format -i src/**/*.cairo tests/**/**/*.cairo
```

### πŸ“ Documentation

#### Requirements

- python environment (python >=3.9)
- [`mdutils`](https://pypi.org/project/mdutils/) dependency installed
- [`kaaper-cli`](https://github.com/onlydustxyz/kaaper) installed
- [`thoth`](https://github.com/FuzzingLabs/thoth) installed

#### Generation

```bash
cd docs
kaaper generate ../src ./data
python build.py
callgraphs.sh
```

## πŸš€ Deployment

See [How to deploy Carbonable Protocol](https://carbonable.notion.site/How-to-deploy-Carbonable-Protocol-099b947ee1c74ff0923bbcf2178b5979)

### Inputs

To manage inputs sent to constructor during the deployment, you can customize the [config files](./scripts/configs/).

### Prepare the contracts before tests

After deployment, the **admin** account (according to parameters) is the owner of all contracts.
So far, you have to do the following actions manually:

- Change the NFT contract owner from **admin** to **Minter contract**
- How: _Voyager > Write contract > `transferOwnership`_
- Verify: _Voyager > Read contract > `owner`_
- Approve the **Minter contract** to spend the **admin payment tokens**
- How: Voyager > _Write contract > `approve`_
- Verify: Voyager > _Read contract > `allowance`_
- Buy NFT through the **Minter contract**
- How: _Voyager > Write contract > `buy`_
- Verify: _Voyager > Read contract > `balanceOf` (of the NFT contract)_

## πŸ“„ License

**carbon-protocol** is released under the [Apache License, Version 2.0](LICENSE).

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):



Aβ‚Ώdel ∞/21M 🐺 - 🐱
Aβ‚Ώdel ∞/21M 🐺 - 🐱

πŸ’»
Bal7hazar
Bal7hazar

πŸ’»
Trunks @ Carbonable
Trunks @ Carbonable

πŸ’»
Ainur
Ainur

πŸ’»
Nico
Nico

πŸ’»
rmzlb
rmzlb

πŸ’»
Arn0d
Arn0d

πŸ’»


valdo.carbonaboyz.stark
valdo.carbonaboyz.stark

πŸ’»

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!