M-L05: docs(contracts): document native token deposits#685
Conversation
📝 WalkthroughWalkthroughThis PR adds documentation and inline NOTE comments explaining that ERC20 deposits are pulled via Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
contracts/SECURITY.md (1)
380-387: Optional wording tweak: prefer “native token” over “ETH” for multi-chain precision.Since this applies on non-Ethereum chains too, consider phrasing as “native token (ETH on Ethereum)” to avoid chain-specific ambiguity in integrator docs.
Also applies to: 400-403
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@contracts/SECURITY.md` around lines 380 - 387, Update the section titled "Native ETH vs ERC20 Deposit Asymmetry" to use chain-neutral wording: replace occurrences of "ETH" with "native token" and where helpful add parenthetical clarification like "(ETH on Ethereum)" so the text reads e.g. "Native token (ETH on Ethereum) vs ERC20 Deposit Asymmetry" and the bullets refer to "native token" instead of "Native ETH"; also apply the same replacement to the related lines referenced (around lines 400-403) so all mentions are consistent across the section.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@contracts/SECURITY.md`:
- Around line 380-387: Update the section titled "Native ETH vs ERC20 Deposit
Asymmetry" to use chain-neutral wording: replace occurrences of "ETH" with
"native token" and where helpful add parenthetical clarification like "(ETH on
Ethereum)" so the text reads e.g. "Native token (ETH on Ethereum) vs ERC20
Deposit Asymmetry" and the bullets refer to "native token" instead of "Native
ETH"; also apply the same replacement to the related lines referenced (around
lines 400-403) so all mentions are consistent across the section.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a39fa75a-aa4b-4633-8d4f-d80df27b1248
📒 Files selected for processing (2)
contracts/SECURITY.mdcontracts/src/ChannelHub.sol
✅ Files skipped from review due to trivial changes (1)
- contracts/src/ChannelHub.sol
H-H01: fix(contracts): disallow challenge with CLOSE or FIN_MIG intents (#631) H-M01: fix(contracts/ChannelHub): remove transferred amount check (#636) fix(contracts/ChannelHub): allow unblocking escrow ops after migration (#637) M-C01: feat(contracts): add token check between states (#639) H-L03: fix(contracts/ChannelHub): skip disputed escrow during purge (#640) M-H04: feat(contracts/ChannelHub): purge during escrow challenge finalization, count both skip and purge (#641) M-M02: fix(contracts): require zero allocs on close (#643) M-C02: fix(rpc/core): apply finalize escrow deposit correctly (#644) H-L02: fix(contracts/ChannelHub): revert on withdrawFromVault failure (#651) M-H03: fix(clearnode): log correct fields on failure (#647) M-C03: fix(pkg/core): disallow negative amount transitions (#645) H-L01: fix(contracts/ChannelHub): add CH address to prevent val addition replay (#650) M-H06(clearnode): restrict max channel challenge duration (#654) M-M03(clearnode): revert EscrowLock on insufficient home user balance (#655) M-M04(clearnode): support default signer even if it is not approved (#656) M-M05(clearnode): require correct intent on FinalizeEscrowWithdrawal (#657) M-M09: reject asset decimals exceeding its token's decimals (#659) M-L01: return correct errors during state advancement validation (#660) M-L03: limit number of related ids per session key state (#662) M-I02: normalize input hex addresses (#663) M-H01: feat(contracts/ChannelHub): restrict to one node (#649) M-H07: fix(contracts/ChannelHub): emit stored, not arbitrary candidate state (#664) M-I01: feat(contracts/ChannelHub): remove updateLastState flag (#665) H-L06: fix(contracts/ChannelHub): remove payable from methods, clarify in create (#666) H-L09: feat(contracts/ChannelEngine): add non-home migration version check (#669) YNU-839: fix blockchain listener lifecycle (#658) M-H09: use channel signer for all channel state node sigs (#667) H-L07: fix(contracts/ChannelHub): restrict createChannel to non-existing channels (#668) H-I02: docs(contracts): add a note that rebasing tokens are not supported (#670) H-I03: fix(contracts/ChannelHub): use CIE pattern in depositToHub (#671) M-H11: revert empty signatures on quorum verification (#672) M-H11: reject issuance of receiver state during escrow ops (#674) H-I01: docs(contracts): note that fee-on-transfer tokens are not supported (#675) M-L04: docs: mention liquidity monitoring (#677) fix(contracts/ChannelHub): fix initialize escrow deposit dos (#679) M-H08: enforce strict transition ordering after MutualLock and EscrowLock (#680) fix: run forge fmt (#681) M-L05: docs(contracts): document native token deposits (#685) fix(clearnode): resolve a set of audit findings (#686) M-H13: feat(contract): add validateChallengeSignature, revert in SK validator (#688)
Description
_pullFunds()enforces different funding mechanics for native assets vs ERC20. Whentoken == address(0), it requiresmsg.value == amount, so the caller must supply native funds even if the logical funding party isdef.user. By contrast, the ERC20 path usesIERC20.safeTransferFrom()with the from address’ allowance.In result, state submissions that require funds movement cannot be enforced by anyone, unless they are willing to pay for it. This asymmetry is not obvious from
createChannel()/depositToChannel()and can surprise integrators who assume identical funding mechanics across asset types.Summary by CodeRabbit