Skip to content

Starter Kit V2#38

Draft
andrejrakic wants to merge 25 commits into
mainfrom
dev
Draft

Starter Kit V2#38
andrejrakic wants to merge 25 commits into
mainfrom
dev

Conversation

@andrejrakic

Copy link
Copy Markdown
Collaborator

This PR is still WIP

andrejrakic and others added 24 commits February 12, 2026 14:19
* feat(cct): deploy CrossChainToken in CCT examples; align with FinalityCodec CCIP APIs

## Description

### Summary

- **CCT token deployment (Examples 06–08):** Replace `FactoryBurnMintERC20` with **`CrossChainToken`** + `BaseERC20.ConstructorParams`, deploying with the broadcaster as pre-mint recipient, CCIP admin, burn/mint admin, and default admin. Register the token admin via **`RegistryModuleOwnerCustom.registerAdminViaGetCCIPAdmin`** (CrossChainToken exposes `getCCIPAdmin()`, not `owner()`).
- **CCIP submodule compatibility:** Update starter code and docs to match current **chainlink-ccip** contracts: **`FinalityCodec`**-based **`bytes4`** finality everywhere the old stack used min-block / `blockConfirmations` fields alone.

### Code

- **`script/EncodeExtraArgsOffchain.s.sol`:** Encode Generic ExtraArgs V3 with **`requestedFinalityConfig`**; implement `encodeV3Basic` using **`FinalityCodec._encodeBlockDepth`** + **`ExtraArgsCodec._getBasicEncodedExtraArgsV3(gasLimit, finalityConfig)`**.
- **`src/BasicMessageReceiverWithCCVs.sol`:** Implement **`getCCVsAndFinalityConfig`** (replaces `getCCVsAndMinBlockDepth`); map stored min block depth to **`FinalityCodec._encodeBlockDepth`** for `allowedFinalityConfig`.
- **`script/examples/Example06.s.sol`:** Pool tuning scripts renamed to **`Example06SetPoolAllowedFinalityConfig`** / **`Example06GetPoolAllowedFinalityConfig`**, calling **`TokenPool.getAllowedFinalityConfig` / `setAllowedFinalityConfig`** (replacing removed min-block-confirmation getters/setters). **`SendCCTTokenWithExtraArgsV3*`** contracts unchanged at the call site; they still use `encodeV3Basic`, which now uses the new encoding path.

### Docs

- **`book/src/examples`:** Example 06–08 chapters updated for CrossChainToken and `registerAdminViaGetCCIPAdmin`; Example 02 and **`book/src/tools/ccip-sdk-ccip-send.md`** updated for **`getCCVsAndFinalityConfig`** / finality terminology.

### Build

- Requires **`FOUNDRY_PROFILE=cct`** for CCT script compilation (unchanged expectation for large pool contracts).

### Breaking / operational notes

- Scripts that previously called **`Example06SetPoolMinBlockConfirmations`** must use **`Example06SetPoolAllowedFinalityConfig`** with a **`bytes4`** allowed finality (per **`FinalityCodec`**), not a `uint16`.
- **`extraArgs`** bytes for ExtraArgs V3 now follow the current **`ExtraArgsCodec` + `FinalityCodec`** layout; semantic “default finality” for `blockConfirmations == 0` is preserved via encoding, but raw payloads differ from pre-upgrade layouts.

* Bumped chainlink-ccip dependency to 2.0-beta commit

* docs(book): update Example 01 optional step 2for Executor allowed finality (FinalityCodec)

Refresh `book/src/examples/example01-token-transfer-faster-than-finality.md` to match
current CCIP contracts: the Executor no longer exposes `getMinBlockConfirmations()`.
Replace the old snippet with an optional check of `getAllowedFinalityConfig() -> bytes4`
and a `cast call` example, plus short context on `FinalityCodec` and how requested
finality relates to `blockConfirmations` (via `FinalityCodec._encodeBlockDepth`).

* feat(ccip): expose allowed-finality encoding helper in EncodeExtraArgsOffchain script

add encodeAllowedFinalityBlockDepthAndSafeFlag
on EncodeExtraArgsOffchain.s.sol as a thin wrapper around
FinalityCodec._encodeBlockDepthAndSafeFlag, with NatSpec clarifying use for
allowed finality (bytes4), not requested finality in sender ExtraArgsV3.

- script: new view helper returning bytes4.
- book (example05): document the Forge script helper next to encodeV3Basic.
- book/book.toml: drop redundant multilingual = false (mdBook compatibility).

* Updated example docs for 03 and 05

- Updated args shape to match CCIP 2.0 in EX05
- Updated description of block confirmations that it is converted to finality config bytes in EX03
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

Invalid CODEOWNERS file detected - @andrejrakic.

1 error(s) were found in the CODEOWNERS file.

See the workflow summary and PR annotations for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants