Deploy the Factory Contract
The factory contract is the onchain entry point for creating new cap tables. You deploy it once, then every issuer cap table is created from that single factory address.
Run the deployment script
With Anvil running in another terminal:
pnpm run deploy-factoryNote 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:27017Navigate 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>"
}
Next, start the server to begin using the API.