-
Notifications
You must be signed in to change notification settings - Fork 24
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
fix: deposit ERC-20 #160
fix: deposit ERC-20 #160
Conversation
WalkthroughThe recent changes involve updates to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Client
participant CustodyContract
User->>Client: Call deposit(options)
Client->>Client: Process options (rename sourceChain to chain, encode recipient and message)
Client->>CustodyContract: Call deposit(recipient, erc20, value, data)
CustodyContract-->>Client: Transaction Response
Client-->>User: Response
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Depositing gas:
Depositing ERC-20:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Outside diff range and nitpick comments (2)
packages/client/src/deposit.ts (1)
15-15
: Update the function documentation to reflect the changes.The documentation for the
options.recipient
parameter should be updated to indicate that it is now required.- * @param options.recipient - Recipient address for the deposit. If not provided, - * the deposit is made to the signer's address. + * @param options.recipient - Recipient address for the deposit. This parameter is required.packages/tasks/src/deposit.ts (1)
151-151
: Update the function documentation to reflect the changes.The documentation for the
recipient
parameter should be updated to indicate that it is now required.- .addParam("recipient", "Recipient address") + .addParam("recipient", "Recipient address (required)")
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- contracts/BytesHelperLib.sol (2 hunks)
- packages/client/src/deposit.ts (4 hunks)
- packages/tasks/src/deposit.ts (2 hunks)
Files skipped from review due to trivial changes (1)
- contracts/BytesHelperLib.sol
Additional context used
Biome
packages/client/src/deposit.ts
[error] 95-106: This else clause can be omitted because previous branches break early.
Unsafe fix: Omit the else clause.
(lint/style/noUselessElse)
Additional comments not posted (1)
packages/client/src/deposit.ts (1)
42-42
: Ensure consistent parameter naming.The parameter
sourceChain
has been renamed tochain
. Ensure that all references tosourceChain
are updated tochain
.Verification successful
Consistent parameter naming verified.
All references to
sourceChain
have been successfully updated tochain
. No instances ofsourceChain
were found in the codebase.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all references to `sourceChain` are updated to `chain`. # Test: Search for the old parameter name. Expect: No occurrences of `sourceChain`. rg --type typescript 'sourceChain'Length of output: 69
Script:
#!/bin/bash # Description: Verify all references to `sourceChain` are updated to `chain`. # Test: Search for the old parameter name. Expect: No occurrences of `sourceChain`. rg 'sourceChain'Length of output: 918
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/client/src/deposit.ts (4 hunks)
Additional context used
Biome
packages/client/src/deposit.ts
[error] 94-105: This else clause can be omitted because previous branches break early.
Unsafe fix: Omit the else clause.
(lint/style/noUselessElse)
Fix
deposit
to always include a recipient address in the message when depositing ERC-20, because of zeta-chain/node#2435Summary by CodeRabbit
New Features
Refactor
options.sourceChain
tooptions.chain
.recipient
from optional to required parameter.Bug Fixes
bytesToBool
function formatting and parameter alignment for better clarity.