Skip to content

fix: resolve 8 EVM handler bugs#35

Merged
BitHighlander merged 2 commits intodevelopfrom
bugfix/evm-handler-fixes
Apr 5, 2026
Merged

fix: resolve 8 EVM handler bugs#35
BitHighlander merged 2 commits intodevelopfrom
bugfix/evm-handler-fixes

Conversation

@BitHighlander
Copy link
Copy Markdown
Collaborator

Summary

  • net_version: stop double-converting decimal chainId as hex (BSC returned 86 instead of 56)
  • convertToHex/handleTransfer: use ethers.parseEther instead of lossy parseFloat*1e18
  • eth_gasPrice: handle null gasPrice on EIP-1559 chains
  • wallet_addEthereumChain: require user approval before adding custom chains (was auto-approve)
  • signTypedData: handle both JSON string and object params from dApps
  • eth_sign: use correct EIP-191 param order [address, message]
  • failedRpcs: TTL-based cleanup prevents unbounded Map growth

Test plan

  • Switch to BSC, verify net_version returns "56" not "86"
  • Send ETH transfer with many decimal places, verify precision
  • Call eth_gasPrice on an EIP-1559 chain, verify no crash
  • dApp calls wallet_addEthereumChain — verify approval popup shown
  • Sign typed data from a dApp that sends object (not string)
  • Test personal_sign and eth_sign both work correctly

🤖 Generated with Claude Code

BitHighlander and others added 2 commits April 3, 2026 16:00
…iance

- Bug 1: net_version no longer double-converts decimal chainId as hex
- Bug 2: convertToHex uses parseEther instead of lossy float math
- Bug 3: handleTransfer uses parseEther for amount conversion
- Bug 4: eth_gasPrice handles null gasPrice on EIP-1559 chains
- Bug 6: wallet_addEthereumChain requires user approval before adding
- Bug 7: signTypedData handles both string and object typed data
- Bug 8: eth_sign uses correct param order [address, message]
- Bug 10: failedRpcs map cleaned up on each getProvider call

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- personal_sign now prefers dApp-supplied params[1] address so multi-account
  wallets use the correct derivation path (EIP-191 params = [message, address]).
  Falls back to global ADDRESS when not provided.
- Drop @ts-expect-error on addEthereumChain approval event by including the
  required unsignedTx field (null) and narrowing status literal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@BitHighlander BitHighlander merged commit 7869be1 into develop Apr 5, 2026
3 of 4 checks passed
BitHighlander added a commit that referenced this pull request Apr 5, 2026
Ships 5 merged bug-fix PRs: vault messaging (#34), content-ui bar
removal (#33), balance forceRefresh dedup (#36), 8 EVM handler fixes
(#35), 7 Solana handler fixes (#37).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant