Ocp
No description available
Install / Use
/learn @Open-Captable-Protocol/OcpREADME
Open Cap Table Protocol (OCP)
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.
Repo Organization
src/→ Server files (routes, MongoDB, etc.)chain/→ Smart contracts (Diamond pattern with facets)
Prerequisites
Ensure you have the following installed:
Setup & Running Locally
- Copy
.env.exampleto.env.local. (The example file includes a local database setup for testing, which we recommend.)
Setup
-
Install dependencies:
yarn install -
You should see the factory contracts successfully deployed.
-
Start services:
-
Terminal 1: Start Anvil (local blockchain)
anvil- Take one of the output's "Private Keys" and set your env file's
PRIVATE_KEY
- Take one of the output's "Private Keys" and set your env file's
-
Terminal 2: Deploy contracts
yarn deploy:local-
Set your env file's variables using output of deploy script
DIAMOND_CUT_FACET= ISSUER_FACET= STAKEHOLDER_FACET= STOCK_CLASS_FACET= STOCK_FACET= CONVERTIBLES_FACET= EQUITY_COMPENSATION_FACET= STOCK_PLAN_FACET= WARRANT_FACET= STAKEHOLDER_NFT_FACET=
-
-
Terminal 3: Run the mongo instance
docker compose up -
Terminal 4: Run the backend server
yarn dev
-
Multi-Chain Support
This repository supports deploying cap tables to different EVM chains.
- Check
/src/chains.jsand configure the required chain keys. - When making API requests:
- Issuer creation → Pass
chainIdin the request body. - Other transactions (e.g., creating stakeholders, issuing stock) → Pass
issuerIdin the request body.
- Issuer creation → Pass
- See
/src/routesfor implementation details.
Usage
- Create an issuer first.
- Add stakeholders, stock classes, and other relevant data.
- For quick testing, use the example script:
node src/examples/testTransfer.mjs
Resetting Local Testing
If you are frequently testing locally, reset the database before redeploying:
yarn deseed
Deployment
Use the appropriate command to deploy contracts:
- Local:
# Clear envvars in .env.local if they exist from a previous deployment yarn deploy:local - Testnet:
yarn deploy:testnet - Mainnet:
yarn deploy:mainnet
License
This project is licensed under the MIT License. See the LICENSE file for details.
