Skip to content

improve(TokenUtils): Replace getL1TokenInfo #1024

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

Merged
merged 2 commits into from
May 7, 2025
Merged

Conversation

nicholaspai
Copy link
Member

@nicholaspai nicholaspai commented May 7, 2025

This function is kind of dangerous in that it intuitively returns the TokenInfo for the L1 token matching the passed in l2 token/chain but it actually returns the L2 token decimals. I could see this function being misused in the future.

This PR will force users to use getL1TokenAddress to get the L1 token address for an l2 token and use getTokenInfo to get the decimals/symbol for the same l2 token.

Paired with across-protocol/relayer#2235

This function is kind of dangerous in that it intuitively returns the `TokenInfo` for the L1 token matching the passed in l2 token/chain but it actually returns the L2 token decimals. I could see this function being misused in the future.

This PR will force users to use `getL1TokenAddress` to get the L1 token address for an l2 token and use `getTokenInfo` to get the decimals/symbol for the same l2 token.
@nicholaspai nicholaspai requested review from bmzig and pxrl May 7, 2025 16:19
@nicholaspai nicholaspai merged commit 50716a7 into master May 7, 2025
4 checks passed
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