Protocol SpecificationSolidity Cap Table

Solidity Cap Table

Contracts store issuer, stock class, stakeholder, position, and transaction state. The API calls them. The poller syncs their events to MongoDB.

      • CapTable.sol
      • CapTableFactory.sol

Roles

RoleHolderPower
ADMIN_ROLEIssuer or asset manager (wallet that called createCapTable).Manage roles; adjust authorized shares. Admins count as operators.
OPERATOR_ROLETransfer-agent server wallet or delegate.Day-to-day writes: classes, stakeholders, issue/transfer stock, etc.
Factory ownerWallet that deployed that CapTableFactory.Upgrade the beacon implementation for all of that factory’s cap tables.

Business reading: protocol builder owns IP and any demo factory; a licensed transfer agent should own their factory; issuers own ADMIN on each issuer table. Mongo factory registration is offchain config only.

How these roles map to local env vars (PRIVATE_KEY, NEXT_PUBLIC_OPERATOR_ADDRESS, browser wallet) is documented under Three wallets / keys.

createCapTable is permissionless. It makes msg.sender admin and can grant an operator in the same transaction. It does not make the caller the factory owner.

Upgrade model

ContractPatternNotes
CapTableFactoryOwnable UpgradeableBeacon factory.One beacon, many proxies.
CapTableBeacon implementation.Initialized per issuer.
Cap table proxyBeaconProxy.Reads implementation from the beacon.

Only the factory owner can upgrade the implementation.

Surfaces

SurfaceFilePurpose
CapTablechain/src/CapTable.solIssuer-level state and writes.
CapTableFactorychain/src/CapTableFactory.solProxy creation and beacon upgrades.
ICapTablechain/src/interfaces/ICapTable.solCap table interface.
ICapTableFactorychain/src/interfaces/ICapTableFactory.solFactory interface.
Structschain/src/lib/Structs.solShared structs.
StockLibchain/src/lib/Stock.solStock lifecycle logic.
TxHelperchain/src/lib/TxHelper.solTransaction payloads and TxCreated.
DeleteContextchain/src/lib/DeleteContext.solActive position deletes.
Adjustmentchain/src/lib/transactions/Adjustment.solAuthorized-share changes.