absolute withdrawal amounts + atomically add liquidity provider#1840
Open
0xsuryansh wants to merge 1 commit intodevelopfrom
Open
absolute withdrawal amounts + atomically add liquidity provider#18400xsuryansh wants to merge 1 commit intodevelopfrom
0xsuryansh wants to merge 1 commit intodevelopfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the CCTP liquidity migration flow to migrate absolute USDC amounts per remote chain (instead of a percentage), and expands the MCMS batch to authorize the liquidity provider and transfer lockbox ownership as part of the same atomic proposal.
Changes:
- Replace percent-based migration inputs with
WithdrawAmounts(selector → absolute USDC amount). - Add a
GetLiquidityProviderread operation and use it to authorize LPs and propose lockbox ownership transfers. - Refactor the migration sequence into explicit phases (authorize → migrate → ownership transfer) with stable selector ordering.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
deployment/v1_7_0/adapters/cctp.go |
Updates adapter input type to accept per-chain absolute withdrawal amounts. |
chains/evm/deployment/v1_6_2/operations/hybrid_lock_release_usdc_token_pool/hybrid_lock_release_usdc_token_pool.go |
Adds a read operation to fetch the liquidity provider for a remote chain selector. |
ccv/chains/evm/deployment/v1_7_0/sequences/cctp/migrate_hybrid_lock_release_liquidity.go |
Implements the new absolute-amount migration flow and adds LP authorization + ownership transfer into the same MCMS batch. |
ccv/chains/evm/deployment/v1_7_0/changesets/migrate_hybrid_lock_release_liquidity.go |
Updates changeset config/validation and wiring to the new WithdrawAmounts input. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+63
to
+66
| // Sorting the selectors before iterating gives a stable, reproducible order (e.g. by chain selector) | ||
| // and keeps the generated proposal and batch structure consistent for a given input. | ||
| selectors := sortedSelectors(input.WithdrawAmounts) | ||
|
|
Comment on lines
+300
to
+308
| lpReport, err := cldf_ops.ExecuteOperation(ctx.b, hybrid_lock_release_usdc_token_pool.GetLiquidityProvider, ctx.chain, contract_utils.FunctionInput[uint64]{ | ||
| ChainSelector: ctx.input.ChainSelector, | ||
| Address: ctx.hybridPoolAddr, | ||
| Args: sel, | ||
| }) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("transferLockboxOwnershipToLPs: chain %d lockbox %s: get liquidity provider: %w", sel, lockBoxAddr.Hex(), err) | ||
| } | ||
| lp := lpReport.Output |
|
|
||
| lockBoxes := make(map[uint64]common.Address, len(lockBoxReport.Output)) | ||
| lockBoxes := make(map[uint64]common.Address, len(configs)) | ||
| for _, cfg := range lockBoxReport.Output { |
|
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.
Updates the MigrateHybridLockReleaseLiquidity changeset to use absolute per-chain withdraw amounts instead of percentages, and to port liquidity providers config when migrating from HybridLockReleaseUSDCTokenPool to siloed lockboxes.