Skip to content

docs(bridge): native withdraw sets tx.value to the scaled amount#239

Open
poszu wants to merge 1 commit into
mainfrom
docs/native-bridge-withdraw-value
Open

docs(bridge): native withdraw sets tx.value to the scaled amount#239
poszu wants to merge 1 commit into
mainfrom
docs/native-bridge-withdraw-value

Conversation

@poszu

@poszu poszu commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Why

Companion to podnetwork/pod#1479, which changes native-token bridge withdrawals to move the coin via tx.value (standard EVM value path) instead of burning it internally. The existing docs tell users to "set tx.value to 0, even for native token withdrawals" — that's now incorrect and would make every native withdraw revert.

Changes

doc/api-reference/guides/bridge-from-pod.md

  • Rewrote the warning hint: native token → tx.value = amount scaled up to Pod's 18 decimals (e.g. 1 USDC → amount=1e6, tx.value=1e18); ERC20 → tx.value=0.
  • Updated the TypeScript and Rust examples to compute value from the token + its Ethereum decimals (native → scaled, ERC20 → 0), and the Rust example now passes .value(value).

doc/protocol/native-bridge.md

  • Extended the Pod → Ethereum decimal-scaling note: native withdrawals carry the coin as tx.value (= amount scaled to 18 dec), subject to the usual native >= tx.value + gas check, so you can't bridge your whole balance and leave nothing for gas.

amount remains in the destination chain's decimals (unchanged) — only the tx.value guidance changes.

🤖 Generated with Claude Code

Native-token withdrawals now move the coin via tx.value instead of being
burned internally, so the guidance "set tx.value to 0 even for native" is
wrong. Update the bridge-from-pod guide (warning hint + TS/Rust examples) and
the native-bridge decimal-scaling section: for the native token tx.value must
equal the amount scaled up to Pod's 18 decimals; ERC20 withdrawals still send
zero value.

Co-Authored-By: Claude Opus 4.8 (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