|
1 |
| -<div align="center"> |
2 |
| - <a href="https://github.com/victormimo/open-captable-protocol/blob/main/LICENSE"> |
3 |
| - <img alt="License" src="https://img.shields.io/github/license/victormimo/open-captable-protocol"> |
4 |
| - </a> |
5 |
| -</div> |
| 1 | +# Open Cap Table Protocol (OCP) |
6 | 2 |
|
7 |
| -# Documentation |
| 3 | +This repository implements the **Open Cap Table Protocol (OCP)** for managing cap tables on-chain. It adheres to the **Open Cap Format (OCF)** standard for data modeling and validation. OCP supports managing cap tables across multiple **EVM-compatible chains**. |
8 | 4 |
|
9 |
| -This repo is based on the [Open Cap Table Coalition](https://github.com/Open-Cap-Table-Coalition/Open-Cap-Format-OCF) standard, with the license included in its entirety. |
| 5 | +## Repo Organization |
| 6 | +- **`src/`** → Server files (routes, MongoDB, etc.) |
| 7 | +- **`chain/`** → Smart contracts (Diamond pattern with facets) |
10 | 8 |
|
11 |
| -## License |
| 9 | +## Prerequisites |
| 10 | +Ensure you have the following installed: |
| 11 | +- [Forge](https://book.getfoundry.sh/) |
| 12 | +- [Node.js](https://nodejs.org/) |
| 13 | +- [Yarn](https://yarnpkg.com/) |
| 14 | + |
| 15 | +## Setup & Running Locally |
| 16 | +1. Copy `.env.example` to `.env`. (The example file includes a local database setup for testing, which we recommend.) |
| 17 | +2. Start dependencies: |
| 18 | + - **Terminal 1:** Start Anvil |
| 19 | + ```sh |
| 20 | + anvil |
| 21 | + ``` |
| 22 | + - **Terminal 2:** Run the backend server |
| 23 | + ```sh |
| 24 | + yarn dev |
| 25 | + ``` |
| 26 | + - **Terminal 3:** Deploy contracts locally |
| 27 | + ```sh |
| 28 | + yarn deploy:local |
| 29 | + ``` |
| 30 | +3. You should see the factory contracts successfully deployed. |
| 31 | + |
| 32 | +## Multi-Chain Support |
| 33 | +This repository supports deploying cap tables to different **EVM chains**. |
| 34 | +- Check `/src/chain.js` and configure the required chain keys. |
| 35 | +- When making API requests: |
| 36 | + - **Issuer creation** → Pass `chainId` in the request body. |
| 37 | + - **Other transactions** (e.g., creating stakeholders, issuing stock) → Pass `issuerId` in the request body. |
| 38 | +- See `/src/routes` for implementation details. |
12 | 39 |
|
13 |
| -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
| 40 | +## Usage |
| 41 | +1. Create an **issuer** first. |
| 42 | +2. Add **stakeholders**, stock classes, and other relevant data. |
| 43 | +3. For quick testing, use the example script: |
| 44 | + ```sh |
| 45 | + node src/examples/testTransfer.mjs |
| 46 | + ``` |
14 | 47 |
|
| 48 | +## Resetting Local Testing |
| 49 | +If you are frequently testing locally, reset the database before redeploying: |
| 50 | +```sh |
| 51 | +yarn deseed |
| 52 | +``` |
| 53 | + |
| 54 | +## Deployment |
| 55 | +Use the appropriate command to deploy contracts: |
| 56 | +- **Local:** |
| 57 | + ```sh |
| 58 | + yarn deploy:local |
| 59 | + ``` |
| 60 | +- **Testnet:** |
| 61 | + ```sh |
| 62 | + yarn deploy:testnet |
| 63 | + ``` |
| 64 | +- **Mainnet:** |
| 65 | + ```sh |
| 66 | + yarn deploy:mainnet |
| 67 | + ``` |
| 68 | + |
| 69 | +## License |
| 70 | +This project is licensed under the MIT License. See the [`LICENSE`](LICENSE) file for details. |
0 commit comments