feat: ✨ Deposit & Withdraw tokens to core#7
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| amount_wei = to_uint64(amount, token_decimals) | ||
|
|
There was a problem hiding this comment.
[P1] Avoid uint64 conversion for ERC‑20 deposit/withdraw amounts
Both deposit_token_to_core and withdraw_token_to_evm pass token amounts through to_uint64(...), which enforces a 64‑bit cap (2**64-1). The Hyperliquid strategy methods accept uint256 values, so this conversion rejects perfectly valid transfers for common 18‑decimal tokens (e.g. depositing 100 ETH throws Value exceeds uint64 maximum before the transaction is constructed). This artificially limits token transfers and will fail for larger balances; the amounts should be encoded without truncating to 64‑bit.
Useful? React with 👍 / 👎.
Adds cross-chain token operations between HyperEVM and HyperCore.
Key Changes
Core Functionality
Refactoring
Infrastructure
Technical Details
The implementation handles token decimal differences between chains automatically, validates payload signatures, and provides proper error handling for failed transactions. The refactoring improves maintainability by consolidating duplicate logic and establishing clear module boundaries.
Testing
Run example/09_evm_core_deposit_withdraw.py to verify the full deposit/withdraw cycle.