Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liquidity manager tokens and transfer tokens check #859

Conversation

amirylm
Copy link
Collaborator

@amirylm amirylm commented May 15, 2024

Motivation

The GetTransfers() functions (bridges), are lacking checks that the L1 and L2 liquidity manager tokens match the addresses provided as remoteToken and localToken.

Solution

Get liquidity managers token in bridge constructor and save for reuse, upon calls to GetTransfer() use the address to compare with remoteToken and localToken.

Copy link
Contributor

I see you updated files related to core. Please run pnpm changeset in the root directory to add a changeset.

@amirylm amirylm force-pushed the LM-103-rebalancer-tokens-and-transfer-tokens-check-missing branch from cef2042 to 2f61c07 Compare May 15, 2024 13:13
@amirylm amirylm requested a review from ogtownsend May 15, 2024 14:58
@amirylm amirylm marked this pull request as ready for review May 15, 2024 15:09
Comment on lines +164 to +167
l2Token, err := l2GatewayWrapper.CalculateL2TokenAddress(nil, l1Token)
if err != nil {
return nil, fmt.Errorf("get local token from liquidityManager: %w", err)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This might change when we flatten everything and the LM is no longer powering a single i_localToken right? The call to l1Token, err := l1LiquidityManager.ILocalToken(nil) above might return a list of tokens

@amirylm amirylm merged commit 32c5ae4 into ccip-develop May 16, 2024
75 checks passed
@amirylm amirylm deleted the LM-103-rebalancer-tokens-and-transfer-tokens-check-missing branch May 16, 2024 06:41
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.

None yet

3 participants