Deploy Factory

Deploy the Factory Contract

The factory contract deploys new cap tables and manages their addresses. It uses a beacon proxy pattern so all cap tables can be upgraded together.

Run the deployment script

With Anvil running in another terminal:

pnpm run deploy-factory

Note the contract addresses

The script outputs two addresses you'll need:

========================================
🎉 Deployment Complete!
========================================
CapTable (implementation): <YOUR_IMPLEMENTATION_ADDRESS>
CapTableFactory:           <YOUR_FACTORY_ADDRESS>
========================================
⚠️

These addresses are unique to your deployment. They're derived from your wallet address and transaction nonce, so every developer and issuer will see different values.

Add factory to MongoDB

Open MongoDB Compass and connect using:

mongodb://tap:tap@localhost:27017

Navigate to the mongo database, find (or create) the factories collection, and insert a new document using your addresses from the deployment output:

{
  "implementation_address": "<YOUR_IMPLEMENTATION_ADDRESS>",
  "factory_address": "<YOUR_FACTORY_ADDRESS>"
}

Factories

Next, start the server to begin using the API.