Skip to content

Core: decode the WalletConnect transaction value once - #1631

Merged
gemcoder21 merged 1 commit into
mainfrom
core/evm-transaction-value
Oct 22, 2026
Merged

gemcoder21 merged 1 commit into
mainfrom
core/evm-transaction-value

Conversation

@gemcoder21

Copy link
Copy Markdown
Contributor
  1. WCEthereumTransaction reads value as a hex amount when the request is parsed, so a value that is not a hex number refuses the request there, and every reader takes the parsed amount.
  2. decode_transaction_kind takes the value: an approval that also sends coins decodes as a contract call, so the review shows the coins it sends and the predicted balance changes.
  3. The dapp simulation and WalletConnect Pay act on that decoded kind instead of their own checks, so simulation::evm::is_approval goes.
  4. docs/product/wallet_connector.md gets the matching row.

Supersedes #1622.

Transaction Result Test
Approval with no value or 0x0 token approval test_decode_transaction_kind, test_decode_ethereum_approval_data
Approval with a value contract call test_decode_transaction_kind, test_decode_ethereum_transaction_kind_from_payload
No calldata, with a value transfer test_decode_transaction_kind, test_decode_ethereum_transaction_kind_from_payload
Value absent, null or 0x none or zero test_deserialize_wc_ethereum_transaction
Value that is not hex request refused test_deserialize_wc_ethereum_transaction, test_map_send
WalletConnect Pay approval with a value refused test_map_approval

Checks: cargo test for primitives, gem_evm, gem_wallet_connect, payment, simulation and gemstone pass; cargo clippy --all-features -D warnings on each, just lint, just format, just check-docs and just check-ffi are clean; just fuzz found nothing in 600 s per target (about 13M runs each for wallet_connect_transaction and wallet_connect_request).

1. WCEthereumTransaction reads value as a hex amount when the request is parsed, so a value that is not a hex number refuses the request there, and every reader takes the parsed amount.
2. decode_transaction_kind takes the value: an approval that also sends coins decodes as a contract call, so the review shows the coins it sends and the predicted balance changes.
3. The dapp simulation and WalletConnect Pay act on that decoded kind instead of their own checks, so simulation::evm::is_approval goes.
4. docs/product/wallet_connector.md gets the matching row.
@gemcoder21
gemcoder21 merged commit abee7a5 into main Oct 22, 2026
9 checks passed
@gemcoder21
gemcoder21 deleted the core/evm-transaction-value branch October 22, 2026 18:12
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