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

ZKsync: provide public actions for fetching token addresses on L1 and L2 chains #3087

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

danijelTxFusion
Copy link
Contributor

@danijelTxFusion danijelTxFusion commented Dec 3, 2024

To enable seamless bridging of assets across chains, it is necessary to retrieve the corresponding token address on the other chain for a given asset. This involves implementing two public actions to facilitate the mapping between L1 and L2 token addresses.

Implementend the following public actions:

  • getL1TokensAddress() - returns the L1 token address equivalent for a L2 token address.
  • getL2TokensAddress() - returns the L2 token address equivalent for a L1 token address.

PR-Codex overview

This PR focuses on adding two public actions, getL1TokenAddress and getL2TokenAddress, to the ZKsync extension, enhancing the functionality for retrieving token addresses between L1 and L2.

Detailed summary

  • Added getL1TokenAddress action to ZKsync extension.
  • Added getL2TokenAddress action to ZKsync extension.
  • Updated sidebar with links for getL1TokenAddress and getL2TokenAddress.
  • Documented usage and parameters for both new actions.
  • Implemented corresponding functions in src/zksync/actions.
  • Added tests for both actions in getL1TokenAddress.test.ts and getL2TokenAddress.test.ts.
  • Defined l2SharedBridgeAbi in src/zksync/constants/abis.ts.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

changeset-bot bot commented Dec 3, 2024

🦋 Changeset detected

Latest commit: 7f0825d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Dec 3, 2024

@danijelTxFusion is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Dec 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
viem ✅ Ready (Inspect) Visit Preview Dec 5, 2024 6:39am

@danijelTxFusion danijelTxFusion force-pushed the zksync/l1-l2-token-addresses branch from 61c12aa to 7f0825d Compare December 13, 2024 08:38
@jxom jxom merged commit 5d81780 into wevm:main Dec 14, 2024
19 of 33 checks passed
@github-actions github-actions bot mentioned this pull request Dec 14, 2024
@tmm tmm mentioned this pull request Dec 21, 2024
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.

3 participants