Skip to content

fix: update depositToHypercore#3162

Open
amateima wants to merge 1 commit intomasterfrom
amatei/fix-hyperliquid-account-creation
Open

fix: update depositToHypercore#3162
amateima wants to merge 1 commit intomasterfrom
amatei/fix-hyperliquid-account-creation

Conversation

@amateima
Copy link
Copy Markdown
Contributor

@amateima amateima commented Apr 6, 2026

Closes ACB-318

@linear
Copy link
Copy Markdown

linear bot commented Apr 6, 2026

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60bbf69999

ℹ️ 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 "@codex address that feedback".

Comment on lines +150 to +151
accountCreationMode === 2 // FromDonationBox: includes activation signature
? ethers.utils.defaultAbiCoder.encode(["address", "uint32", "bytes"], [account, destinationDex, actionData])
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Compare accountCreationMode using BigNumber semantics

In depositToHypercore, the FromDonationBox branch is gated by accountCreationMode === 2, but createHyperCoreAccountIfNotExists passes hookData.accountCreationMode from decodeCctpV2HookData, which is sourced from ethers.utils.defaultAbiCoder.decode without numeric normalization. In ethers v5 this value is a BigNumber-like object, so strict equality to a JS number does not match; the code then encodes message without actionData, producing an invalid payload for donation-box account creation flows. Convert decoded uint fields to numbers at decode time (or use BigNumber .eq(2) here).

Useful? React with 👍 / 👎.

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