Adding changes needed for the SetTokenTransferFee Update#1836
Adding changes needed for the SetTokenTransferFee Update#1836sowgandhi11 wants to merge 18 commits intomainfrom
Conversation
|
👋 sowgandhi11, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
There was a problem hiding this comment.
Pull request overview
This PR updates the fee deployment flow to support SetTokenTransferFee across newer CCIP FeeQuoter versions by (a) discovering the deployed fee contract/version from the datastore, (b) returning AddressRef for fee contracts, and (c) adding an EVM CCIP 2.0 fee adapter implementation.
Changes:
- Extend the
FeeAdapterinterface withGetFeeContractRef(...) (datastore.AddressRef, error)and update EVM adapters to returnAddressRefdata. - Update the SetTokenTransferFee changeset to select an adapter based on the discovered on-chain fee contract version.
- Add a CCIP 2.0 EVM fees adapter and adjust v1.6 FeeQuoter “latest address” selection logic.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
deployment/fees/set_token_transfer_fee.go |
Selects fee adapter based on discovered fee contract ref/version before executing the update sequence. |
deployment/fees/product.go |
Extends FeeAdapter interface to expose fee contract AddressRef. |
chains/evm/deployment/v2_0_0/adapters/fees.go |
New CCIP 2.0 EVM fees adapter implementation (FeeQuoter-based). |
chains/evm/deployment/v1_6_0/sequences/adapter.go |
Updates FeeQuoter “latest version” selection to remove the previous upper bound. |
chains/evm/deployment/v1_5_0/adapters/fees.go |
Updates v1.5 fee adapter to return a fee contract AddressRef (OnRamp-based). |
Comments suppressed due to low confidence (1)
deployment/fees/set_token_transfer_fee.go:132
inferTokenTransferFeeArgsis called withadapter(resolved fromcfg.Version), but the actual sequence execution usesupdater(resolved from the on-chain fee contract ref version). Ifcfg.Versiondiffers from the deployed contract version, inference may query the wrong ABI/contract and fail or infer incorrect defaults. Consider selecting a single adapter based on the discovered contract ref version and using it consistently for inference and updates (or error if versions disagree).
settings[dst.Selector] = map[string]*TokenTransferFeeArgs{}
for _, feeCfg := range dst.Settings {
if args, err := inferTokenTransferFeeArgs(adapter, e, src.Selector, dst.Selector, feeCfg); err != nil {
return cldf.ChangesetOutput{}, fmt.Errorf("failed to infer token transfer fee args for token %s: %w", feeCfg.Address, err)
} else {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Removed the upper bound for identifying the latest FQ address
Returning the
AddressRefdata for the FeeQuoterAdded a new method
GetFeeContractRef(e cldf.Environment, src uint64, dst uint64) (AddressRef, error)Added a fees.go adapter implementation for CCIP 2.0