feat: probe contract recipient for withdraw() entry point - #520
Open
ZacLou wants to merge 3 commits into
Open
Conversation
…otocol#458) When the recipient is a contract address, the create form now simulates a read-only withdraw() call to check if the contract exposes that function. If the simulation fails, the user sees a warning that funds may become stranded and submit is blocked. - New lib/contract-recipient-probe.ts with checkContractHasWithdraw() - Two new recipient statuses: 'contract-checking', 'contract-no-withdraw' - UI shows progress and warning for the probe result - Submit blocked when probe finds no withdraw() capability - Falls back to 'valid' if the probe itself fails (network error) Addresses conduit-protocol#458
ZacLou
force-pushed
the
feat/contract-recipient-withdraw-probe-458
branch
from
September 5, 2026 13:44
678821a to
258c03c
Compare
Contributor
Author
|
Rebased onto latest Note: the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #458
Problem
The create form warned users about contract recipients but didn't actually probe for a
withdrawentry point. Users had to guess whether the contract could pull funds.Solution
lib/contract-recipient-probe.ts(new) —checkContractHasWithdraw()function that simulates a read-onlywithdraw()call viasimulateReadOnly(). Returnstrueif the simulation succeeds,falseif it fails (function not found, wrong signature, etc.)app/create/page.tsx— after the recipient existence check passes for a contract address, the form now:contract-checkingstatuswithdraw()capabilitycontract-no-withdrawstatus if the probe failsvalidif the probe itself errors (network issue)UI — two new status displays:
contract-checking: blue status text 'Checking if this contract can call withdraw()...'contract-no-withdraw: orange warning about potential stranded fundsSubmit guard — blocks submission when
contract-no-withdrawis activeFiles changed
lib/contract-recipient-probe.ts(new)app/create/page.tsx(probe logic + UI)