feat(cct-sdk):Add createPoolSignerATA option to deploy token pool - #412
Conversation
|
You must have Developer access to commit code to Chainlink Labs on Vercel. If you contact an administrator and receive Developer access, commit again to see your changes. Learn more: https://vercel.com/docs/accounts/team-members-and-roles/access-roles#team-level-roles |
Overview✅ APPROVE — 0 blockers, 0 majors. Correct, type-safe, grounded, and live-proven. Adds What it solves: Closes the mesh gap where a freshly deployed pool couldn't receive a Architecture:
Live Devnet Verification:
Note on CI: The red "Run npm ci" is a trunk-wide [COMMENT 1/4] 🟡 Medium (DX) — Field doc omits the WHYCurrent doc: Problem: This describes what it does but not why you need it. A developer reading this has no context that the Fix: Add the reason to the JSDoc: /**
* Create the pool signer PDA's associated token account (`pool_token_account`) idempotently.
*
* @remarks
* Without this account, the pool cannot lock/release or mint on transfers, and a `ccip-send` fails
* with `AccountNotInitialized (3012)`. Setting this to `true` creates the account in the deploy
* transaction; otherwise you must create it separately before any transfer.
*
* Defaults to false.
*/This gives the developer the context to decide: "If I'm deploying a pool that will immediately receive transfers, set this to |
[COMMENT 2/4] 🟡 Medium (DX) — Name↔protocol-term bridgeProblem: A developer debugging a Impact: The debugging loop is broken: error references Fix: Explicitly name the account in the option's /**
* Create the pool signer PDA's associated token account (`pool_token_account`) idempotently.
*
* @remarks
* The pool requires a `pool_token_account` (the associated token account owned by the pool_signer PDA)
* to lock/release or mint on transfers. Without it, a `ccip-send` fails with `AccountNotInitialized (3012)`.
* Setting `createPoolSignerATA: true` creates this account in the deploy transaction.
*
* Defaults to false.
*/And in the facade /**
* @remarks
* ...
* Set `createPoolSignerATA: true` to also create the pool's `pool_token_account` idempotently;
* otherwise create it separately via `generateUnsignedCreateTokenAccount` before `generateUnsignedSetPool`.
*/Now a dev searching for "pool_token_account" finds this option. |
[COMMENT 3/4] 🟡 Medium (DX) — False-path consequence: state the hard prerequisiteCurrent facade Problem: This reads as a sequencing suggestion ("you can do it in two steps"), not as a hard prerequisite. A developer might interpret it as optional advice rather than understanding that leaving it Impact: Developers deploy pools with Fix: Reframe the false-path as a hard requirement with consequences, mirroring the pattern used for /**
* @remarks
* Initializes a Solana token pool for the canonical `burn-mint` and `lock-release` programs.
*
* **Important:** The pool requires a `pool_token_account` to lock/release or mint on transfers.
* Set `createPoolSignerATA: true` to create this account in the deploy transaction.
* If omitted (defaults to `false`), you must create the account separately via
* `generateUnsignedCreateTokenAccount` before `generateUnsignedSetPool`, or any transfer will fail
* with `AccountNotInitialized (3012)`.
*/And in /**
* @throws {@link CCTTxFailedError} If the transaction fails (e.g., `AccountNotInitialized (3012)`
* if `createPoolSignerATA: false` and the pool's `pool_token_account` was not created separately).
*/This makes the hard prerequisite explicit: if you leave it |
[COMMENT 4/4] 🔵 Nits — Placement asymmetry & parity notesPlacement asymmetry (architectural intent)This PR appends the ATA creation (
Fix: Document this intentional difference so maintainers understand the asymmetry: if (createPoolSignerATA) {
// Append ATA creation after initialize (initialize must be main instruction index 0)
instructions.push(...ata.instructions)
}Cross-family/parity notes
|
[COMMENT 5/5] 📋 Informational — CI status (not this PR)The red "Run npm ci" is a trunk-wide Issue:
This causes This PR's code quality: Green across the board:
Fix (once, at Full write-up: See the |
…eate-pool-signer-ata
CI Test Report✅ 2506/2512 tests passed (650 suites) in 4m 59s SummaryCoverage report |
@aelmanaa Addressed all comments except for #5 which was already handled by different PR. |
f2357e1
into
feat/DAPP-11371-get-token-info
* feat: add transfer pool ownership op solana * feat: add accept pool ownership op solana * feat: add transfer authority op solana * fix: update export barrel * feat: add mint tokens op solana * fix: address comments * fix: address comments * feat: add set can accept liquidity op solana * fix: add lock release token pool idl * feat: add set rebalancer op solana * fix: update tsdoc * feat: add approve token op solana * feat: add provider liquidity op solana * fix: address comments * fix: revert unrelated changes * fix: add preflight checks * fix: update tsdoc * fix: extract validate pool liquidity config * feat: add withdraw liquidity op solana * fix: add preflight checks * feat: add update metadata authority op solana * fix: lint errors * fix: lint errors * fix: address comments * fix: refactor unit tests * fix: refactor export * feat: add owner override pending admint op solana * fix: update tsdoc and add preflight check * fix: update tsdoc @example * feat: add includeApproval option in provide liquidity * feat: add createRecipientATA option to mint tokens op * feat: add get token info op solana * fix: address comments * fix: package lock file - remove stale axios version * feat(cct-sdk):Add createPoolSignerATA option to deploy token pool (#412) * feat: add createPoolSignerATA option to deploy token pool op * fix: address comments
What
createPoolSignerATAto Solana CCT token-pool deployment optionsWhy