Skip to content

absolute withdrawal amounts + atomically add liquidity provider#1840

Open
0xsuryansh wants to merge 1 commit intodevelopfrom
update-usdc-liquidity-migration-changeset
Open

absolute withdrawal amounts + atomically add liquidity provider#1840
0xsuryansh wants to merge 1 commit intodevelopfrom
update-usdc-liquidity-migration-changeset

Conversation

@0xsuryansh
Copy link
Member

@0xsuryansh 0xsuryansh commented Mar 13, 2026

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 GetLiquidityProvider read 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 {
@github-actions
Copy link

Metric update-usdc-liquidity-migration-changeset develop
Coverage 70.1% 69.8%

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