feat: allow AdminWithdrawManager to specify to address#1441
Conversation
- directWithdraw: new `to` parameter, unrestricted (admin/multisig controls destination) - signedWithdraw: `to` hardcoded to `cloneArgs.userAddress` (signer cannot redirect) - WithdrawImplementation: user path always overrides `to` to `userAddress` Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4b24ae0a4
ℹ️ 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".
| if (msg.sender != admin && msg.sender != userAddress) revert Unauthorized(); | ||
|
|
||
| (address token, uint256 amount) = abi.decode(submitterData, (address, uint256)); | ||
| (address token, uint256 amount, address to) = abi.decode(submitterData, (address, uint256, address)); |
There was a problem hiding this comment.
Accept legacy withdraw payloads without
to
execute now always decodes submitterData as (address token, uint256 amount, address to), which breaks callers still sending the previous two-field payload (token, amount). In that case the call reverts during abi.decode before the user-recipient override runs, so existing user self-withdraw calldata generated by older clients will fail until every integration is updated. Consider supporting both encodings (or defaulting to = userAddress when omitted) to avoid this backward-compatibility regression.
Useful? React with 👍 / 👎.
Summary
directWithdraw: newtoparameter — the admin (typically multisig) can withdraw to any addresssignedWithdraw:tohardcoded tocloneArgs.userAddress— signer can never redirect fundsWithdrawImplementation: user path always overridestotouserAddress, regardless of what's passed insubmitterDataTest plan
testDirectWithdrawSendsToUserAddress— direct withdraw to user still workstestDirectWithdrawToArbitraryAddress— admin can send to non-user addresstestSignedWithdrawSendsToUserAddress— signed path always lands at usertestSignerCannotRedirectFunds— compromised signer cannot redirecttestUserToIsAlwaysOverridden— user passes differentto, funds still go touserAddresstestAdminCanWithdrawToArbitraryAddress— impl-level test for arbitrary adminto🤖 Generated with Claude Code