Starter Kit V2#38
Draft
andrejrakic wants to merge 25 commits into
Draft
Conversation
…IAny2EVMMessageReceiverV2 interface
…CCVs for Faster Than Finality
* 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
Invalid CODEOWNERS file detected - @andrejrakic.1 error(s) were found in the CODEOWNERS file. See the workflow summary and PR annotations for more information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is still WIP