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.
src/
→ Server files (routes, MongoDB, etc.)chain/
→ Smart contracts (Diamond pattern with facets)
Ensure you have the following installed:
- Copy
.env.example
to.env.local
. (The example file includes a local database setup for testing, which we recommend.)
-
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
-
This repository supports deploying cap tables to different EVM chains.
- Check
/src/chains.js
and configure the required chain keys. - When making API requests:
- Issuer creation → Pass
chainId
in the request body. - Other transactions (e.g., creating stakeholders, issuing stock) → Pass
issuerId
in the request body.
- Issuer creation → Pass
- See
/src/routes
for implementation details.
- Create an issuer first.
- Add stakeholders, stock classes, and other relevant data.
- For quick testing, use the example script:
node src/examples/testTransfer.mjs
If you are frequently testing locally, reset the database before redeploying:
yarn deseed
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
This project is licensed under the MIT License. See the LICENSE
file for details.