Fix: Terra broadcast → confirming UI phase (GitLab #305) #778
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic!778
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "cursor/gitlab-issue-workflow-49bf"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements GitLab #305 (part 1 of #304): retail submit buttons now distinguish wallet signing/broadcast from on-chain confirmation.
What changed
broadcastTerraExecuteContractsfires optionalonPhaseChangeatsigning→broadcasting→confirming(withtxHash) boundaries; canonical #127 path preserved.terraBroadcastScope+useTerraBroadcastMutationthread phase callbacks into existing service layers without per-function option parameters.TerraBroadcastPendingLink.localnet-trading-swarmbroadcast.tsaligned with the same phase callback shape.docs/frontend.md§ Broadcast phase UI.Acceptance checklist
pollTxresolvesterraBroadcast.test.tsphase ordering;useTerraBroadcastMutationhook; Swap/Limits/Trade button labelssigning→broadcasting→confirmingsequenceterraBroadcast.test.tsfailure casesmake test-frontend(832 tests)Verification for third parties
Manual (LocalTerra): Simulated Wallet swap on
/swap— button should read Signing… / Broadcasting… then Confirming… with a tx hash link until confirmation; success alert shows final hash.Blockers
None.
Related: #305 (issue stays open until merge).
changed the description
changed the description
changed the description
mentioned in issue #305
Stale Security Review comment
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Reviewed by Cursor Bugbot for commit
18479446d2. Configure here.Global scope misroutes phases
Medium Severity
Module-level
scopeStackplusgetTerraBroadcastScopeOptions()on everyexecuteTerraContract*call ties phase updates to whichever scope was pushed last. Overlapping txs (e.g. cancel via plainuseMutationwhile auseTerraBroadcastMutationis confirming, or add and withdraw on Pool) can drive the wrong mutation’sphaseandpendingTxHash.Additional Locations (1)
frontend-dapp/src/services/terraclassic/transactions.ts#L175-L189Reviewed by Cursor Bugbot for commit
18479446d2. Configure here.changed this line in version 2 of the diff
added 1 commit
5944a0c3- Fix Terra broadcast scope misrouting overlapping mutationsCompare with previous version
changed the description
changed the description
resolved all threads
Security review
Commit reviewed:
5944a0cScope: 17 files — Terra broadcast phase UI (
onPhaseChangecallbacks,terraBroadcastScope,useTerraBroadcastMutation,TerraBroadcastPendingLink), retail surface wiring (Swap, Trade, Limits, Pool), docs, andlocalnet-trading-swarmbroadcast helper alignment.Method: Diff review with attacker-controlled-input tracing for injection, XSS/open-redirect, authz bypass, secret leakage, and unsafe deserialization. Prior Bugbot thread on global scope misrouting re-checked against the
5944a0cfix (activeScopes+scopedExecutionDepth; ambiguous overlap returnsundefined).Outcome: FINDINGS: 0 medium+
No inline security threads — nothing met the medium+ bar with a plausible exploit path.
Areas examined (no issues)
TerraBroadcastPendingLink,getExplorerTxUrl)txHashis wallet-returned chain hash, not user/API input. React escapes JSX text/attributes; explorer URLs are prefixed with a trusted base from build-timeNETWORKS/ chainlist — same pattern as existingTxResultAlert.5944a0c. Remaining ambiguity only suppresses phase callbacks (fallback button copy) — UX, not a permission or fund-safety boundary.isPendingdisable guards unchanged.executeCw20AllowanceThen)Security review: no medium+ findings on this diff.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Reviewed by Cursor Bugbot for commit
5944a0c3e3. Configure here.Broadcast scope lost after await
Medium Severity
invokeScopeddecrementsscopedExecutionDepthin a synchronousfinallyas soon as the wrapped function returns its promise, whilegetTerraBroadcastScopeOptionsrefuses to resolve when depth is zero. Later broadcasts in the same mutation (after anawait) no longer receiveonPhaseChange, so the button can stay on Confirming… with a stale tx link during the next wallet step.Additional Locations (1)
frontend-dapp/src/pages/PoolPage.tsx#L382-L401Reviewed by Cursor Bugbot for commit
5944a0c3e3. Configure here.added 1 commit
186b82cc- fix: keep broadcast scope depth until async mutation settlesCompare with previous version
changed the description
resolved all threads
Security review
Commit reviewed:
186b82cScope: 17 files — Terra broadcast phase UI (
onPhaseChange,terraBroadcastScope,useTerraBroadcastMutation,TerraBroadcastPendingLink), retail surface wiring (Swap, Trade, Limits, Pool), docs, andlocalnet-trading-swarmbroadcast helper alignment. Re-reviewed after the186b82cfix that keepsscopedExecutionDepthuntil the scoped promise settles.Method: Full diff review with attacker-controlled-input tracing for injection, XSS/open-redirect, authn/authz bypass, secret leakage, SSRF, and unsafe deserialization. Prior security review on
5944a0cand resolved Bugbot threads (global scope misrouting, async scope depth) re-checked on this head.Outcome: FINDINGS: 0 medium+
No inline security threads — nothing met the medium+ bar with a plausible exploit path.
Areas examined (no issues)
TerraBroadcastPendingLink,getExplorerTxUrl)pendingTxHashis set only fromonPhaseChangeafterwallet.broadcastTxreturns — not user/API/query input. React escapes JSX text/attributes; explorer URLs prefix a build-time-trusted base (NETWORKS/ chainlist) and append the hash as a path segment — same pattern as existingTxResultAlert. A crafted hash cannot yield ajavascript:href.requireConnectedWalletForAddressunchanged. Phase callbacks are observability only.terraBroadcastScope)activeScopes+scopedExecutionDepth; ambiguous overlap (size !== 1) returnsundefinedand suppresses callbacks. Misrouting affects button copy only — not tx construction, gas, or approval.isPendingdisable guards unchanged.186b82cfixes sequential in-mutation scope loss (UX).executeCw20AllowanceThen)console.erroron broadcast failure unchanged.localnet-trading-swarmchanges are dev-tooling only.Security review: no medium+ findings on this diff.
Security review
Commit reviewed:
186b82cScope: 17 files — Terra broadcast phase UI (
onPhaseChange,terraBroadcastScope,useTerraBroadcastMutation,TerraBroadcastPendingLink), retail surface wiring (Swap, Trade, Limits, Pool), docs, andlocalnet-trading-swarmbroadcast helper alignment.Method: Full diff review with attacker-controlled-input tracing for injection, XSS/open-redirect, authn/authz bypass, secret leakage, SSRF, and unsafe deserialization. Prior Bugbot threads (global scope misrouting, async
scopedExecutionDepth) and earlier security reviews on5944a0c/186b82cre-checked on this head.Outcome: FINDINGS: 0 medium+
No inline security threads — nothing met the medium+ bar with a plausible exploit path.
Areas examined (no issues)
TerraBroadcastPendingLink,getExplorerTxUrl)pendingTxHashis set only fromonPhaseChangeafterwallet.broadcastTxreturns — not user/API/query input. React escapes JSX text/attributes; explorer URLs prefix a build-time-trusted base (NETWORKS/ chainlist) and append the hash as a path segment — same pattern as existingTxResultAlert. A crafted hash cannot yield ajavascript:href.requireConnectedWalletForAddressunchanged. Phase callbacks are observability only.terraBroadcastScope)activeScopes+scopedExecutionDepth; ambiguous overlap (size !== 1) returnsundefinedand suppresses callbacks. Misrouting affects button copy only — not tx construction, gas, or approval.isPendingdisable guards unchanged.186b82ckeeps scope depth until the scoped promise settles (sequential in-mutation UX).executeCw20AllowanceThen)console.erroron broadcast failure unchanged.localnet-trading-swarmchanges are dev-tooling only.Security review: no medium+ findings on this diff.
mentioned in commit
531d00ef55mentioned in issue #330
mentioned in merge request !827