Skip to content

Starter Kit V2 - #38

Merged
andrejrakic merged 30 commits into
mainfrom
dev
Sep 28, 2026
Merged

andrejrakic merged 30 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

Thank you for adding a CODEOWNERS file - @andrejrakic.

andrejrakic and others added 3 commits June 18, 2026 10:50
* fix: align CCIP v2 examples with pool finality requirements

- Use Cancun and correct the lint configuration.
- Add Example 06 pool finality configuration and a read-only check of the pool, executor, CCVs, and sample fee quotes.
- Update the guides for Sepolia → Amoy, using faucet-issued
CCIP-BnM in Examples 01, 03, and 04 while keeping custom token deployment
in Examples 06–08.

* chore: bump chainlink-ccip to contracts-ccip-v2.0.0, rename FTF to Fast Transfers

- Bump lib/chainlink-ccip from contracts-ccip-v2.0.0-beta.1 to contracts-ccip-v2.0.0 (c2c125c); no compile changes needed
- Use 'Fast Transfers (FTF)' naming in book docs to match docs.chain.link
- Suggest bytes4 hex values for pool allowed finality config (PR review)

---------

Co-authored-by: andrejrakic <andrej.rakic@smartcontract.com>
@andrejrakic
andrejrakic marked this pull request as ready for review September 28, 2026 15:41
@andrejrakic
andrejrakic requested review from a team and Nalon as code owners September 28, 2026 15:41
…advisories

- Bump @chainlink/ccip-sdk ^0.97.0 -> ^1.14.0 (pins axios 1.20.0; fixes Vulnerabilities check)
- Require Node >=24 (SDK 1.x uses explicit resource management syntax)
- ccip-send: extraArgs blockConfirmations -> finality ('finalized' for 0)
- ccip-track: replace removed getMessagesForSender with getMessagesInRange + sender filter; map 'finalized' to default finality
@andrejrakic
andrejrakic merged commit 3888dcb into main Sep 28, 2026
5 checks passed
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