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

feat: consider token decimals in transfer #149

Merged

Conversation

lutr0
Copy link
Contributor

@lutr0 lutr0 commented Jun 23, 2024

What πŸ’»

  • When transferring an ERC20 token, considers the decimals to ensure that the correct amount is sent.

Why βœ‹

  • Ensures transfer supports ERC20s with decimals different from the default 18
  • Aligns transfer with the balance, deposit and withdraw commands

Evidence πŸ“·

Transaction using native USDC (6 decimals). It correctly sends 0.1 tokens

npm run dev -- wallet transfer --token 0x1d17CBcF0D6D143135aE902365D2E5e2A16538D4 --chain zksync-mainnet --recipient 0xD1DF83CA61941dbDf28A212F03E106E3FF00E38e --amount 0.1

Transfer sent:
 Transaction hash: 0x615a58c7c8ca9b2e92c364181c075224fd41549f8934b8e1f4fee8a590bc4626
 Transaction link: https://explorer.zksync.io/tx/0x615a58c7c8ca9b2e92c364181c075224fd41549f8934b8e1f4fee8a590bc4626

Notes πŸ“

@lutr0 lutr0 requested a review from a team as a code owner June 23, 2024 11:38
@itsacoyote itsacoyote merged commit d7ab74c into matter-labs:main Jun 24, 2024
2 checks passed
Copy link

github-actions bot commented Jul 9, 2024

πŸŽ‰ This PR is included in version 1.8.0 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect USDT Amount Conversion in zkSync CLI Documentation
2 participants