Repository navigation
docs(testnet/examples): four worked walkthroughs for the live testnet integration paths - #742
Merged
phertyameen merged 1 commit intoSep 26, 2026
Conversation
Adds end-to-end examples for the four integration paths integrators hit most, each written against the actual contract source rather than the API summary: - signed-sweep-walkthrough.md: constructing SHA256(dest || nonce || contract_id), signing via tools/sweep-signer, submitting execute_sweep(), plus the failure modes and the shared-nonce race. - gas-free-claim-walkthrough.md: how the recipient builds and signs the Soroban auth entry and a relayer submits it, and how that differs architecturally from the signed path. - multi-asset-sweep.md: recording several SEP-41 assets and reading SweepExecutedMulti.payments, including i128 decoding and why SweepCompleted.amount is not a usable figure. - expiry-and-recovery.md: creating a short-expiry account, letting it lapse, triggering expire()/recover(), and verifying the recovery path. Each doc records behaviour that is easy to get wrong from the API surface alone: account state is set before transfer logic; the signed message does not commit to the payment set or amount; the nonce is shared between execute_sweep() and claim(); expiry uses ledger sequence with an inclusive >= boundary; and AccountExpired does not move tokens in the current implementation. tools/sweep-signer is referenced only, not modified. Closes bridgelet-org#634 Closes bridgelet-org#635 Closes bridgelet-org#636 Closes bridgelet-org#637
|
@devbackend513-ux Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Adds four end-to-end walkthroughs under
testnet/examples/for the integration paths that integrators actually build against. Each one is written from the contract source, not the API summary, so it covers the behaviour you cannot infer from signatures alone.signed-sweep-walkthrough.mdSweepController::execute_sweep()— the primary sweep path, and the only one with real Ed25519 verificationgas-free-claim-walkthrough.mdSweepController::claim()— recipient signs a Soroban auth entry, relayer submitsmulti-asset-sweep.mdrecord_payment→ sweep, and readingSweepExecutedMulti.paymentsexpiry-and-recovery.mdexpire()/recover()→ recovery verificationWhy these need to exist as prose
A few behaviours in this codebase are actively misleading if you only read the function signatures:
EphemeralAccount::sweep()takes anauth_signatureand ignores it. All three walkthroughs route throughSweepControllerand say why, since this is the easiest way to convince yourself signature checking works when it does not. This is called out in more detail in testnet/security/unverified-signature-path-warning.md: a testnet-facing callout that EphemeralAccount::sweep()'s signature isn't checked #651.SweepCompleted.amountis a sum across assets and is not a meaningful monetary figure. The walkthroughs point atSweepExecutedMulti.paymentsinstead and cover thei128→ string decoding trap.execute_sweep()andclaim(), and on the shared testnet controller it is consumed by other integrators too — so the race is real, not theoretical.AccountExpireddoes not move tokens in the current implementation.expire()/recover()set state and emit events; there is noTokenClient::transfer()anywhere inephemeral_account. The expiry doc has a dedicated "What the event does and does not prove" section, because treating that event as a funds-received signal is the most damaging misreading available today.>=, not>, and is ledger-based, so the boundary ledger is already expired.record_payment()has no status or expiry guard — entries can still be appended to an account that can no longer be swept.Scope
tools/sweep-signeris referenced contextually and not modified, per testnet/examples/signed-sweep-walkthrough.md: worked example of constructing and submitting a signed sweep via SweepController #634's constraint.testnet/examples/create-and-fund-ephemeral-account.md,testnet/runbooks/expired-account-recovery-check.md) and flags the fallback path inline where they may not be present yet, so no doc is a dead end on its own.contracts/ephemeral_account/src/lib.rs,contracts/sweep_controller/src/, andcontracts/shared/src/types.rsrather than restated fromdocs/api-reference.md.Closes #634
Closes #635
Closes #636
Closes #637