Conversation
Created with git submodule add --name fairmint-canton --force https://github.com/Fairmint/canton src/chain-operations/canton/lib/fairmint-canton
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a proof-of-concept integration with Canton for onchain operations, enabling specialized handling for transfers, issuances, stock classes, and cap table deployments when the chain ID corresponds to Canton.
- Added new schema fields and branch logic to handle Canton-specific operations
- Integrated new modules under src/chain-operations/canton for issuance, transfer, stock class and cap table deployments
- Updated configuration files, ESLint and Prettier ignores, and submodules to support the Canton integration
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/db/objects/Stakeholder.js | Added new fields (party_id, stock_position_contract_id) |
| src/db/objects/Issuer.js | Added party_id field |
| src/controllers/transactions/transferController.js | Integrated Canton branch for transfer operations via new helper |
| src/controllers/transactions/issuanceController.js | Updated issuance flow to conditionally invoke Canton-specific logic |
| src/controllers/stockClassController.js | Updated stock class controller signature to support Canton handling |
| src/chain-operations/issuanceControllerCanton.js | Added Canton-specific issuance function |
| src/chain-operations/getProvider.js | Throws an error for Canton chains, indicating unsupported behavior |
| src/chain-operations/getContractInstances.js | Logs unsupported Canton chain and returns null |
| src/chain-operations/deployCapTable.js | Updated deployCapTable to branch for Canton integration |
| src/chain-operations/canton/* | New modules for Canton-specific chain operations and configuration |
| eslint.config.js, .prettierignore, .gitmodules, .env.example | Adjusted config files to include Canton-related paths and settings |
There was a problem hiding this comment.
Bug: Issuer Creation Fails on Canton Chains
The deployCapTable function was updated to accept a fourth issuer argument, which is then passed to deployCapTableCanton for Canton chains. deployCapTableCanton attempts to access properties like issuer.legal_name and issuer.party_id. However, the /issuer/create-fairmint-reflection route in src/routes/issuer.js was not updated and still calls deployCapTable with only three arguments. Consequently, when this route is used for a Canton chain ID, the issuer parameter is undefined, leading to a TypeError ("Cannot read properties of undefined") and preventing issuer creation.
src/chain-operations/deployCapTable.js#L23-L30
open-captable-protocol/src/chain-operations/deployCapTable.js
Lines 23 to 30 in aa4597c
src/routes/issuer.js#L124-L135
open-captable-protocol/src/routes/issuer.js
Lines 124 to 135 in aa4597c
Was this report helpful? Give feedback by reacting with 👍 or 👎
What?
POC of how we might integrate Canton for the upcoming demo. It makes just the first Canton call we might need.
Why?
Validate the approach / seeking tips on how to get started.
Screenshots (optional)