fix(frontend): multihop swap preflight false positives (#341) #847
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!847
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "local1/341-preflight-multihop"
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
preflightSwapRouteSpreadenrichSwapOperationsWithHopMinReturnsops (submit parity)Test plan
npm test -- swapRoutePreflight.test.tsDocs
Merge after prior stacked MRs.
changed the description
mentioned in issue #341
changed the description
Stale Security Review comment
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issues.
Reviewed by Cursor Bugbot for commit
76723cf513. Configure here.Native preflight uses gross offer
Medium Severity
For native-input multihop routes,
simulateNativeSwapnow simulates with net post-wrap offer, butpreflightSwapRouteSpreadstill starts from grossrawInputAmount. Hop spread checks no longer match the quoted output or on-chain CW20 leg size.Reviewed by Cursor Bugbot for commit
76723cf513. Configure here.Wrap deposit uses net amount
High Severity
Native-wrap provide liquidity overwrites
rawA/rawBwith post-tax net amounts, then passes those same values towrap_depositcoins.wrap_depositmust attach the user’s gross native deposit; only CW20 allowance andprovide_liquidityamounts should use net minted units.Reviewed by Cursor Bugbot for commit
76723cf513. Configure here.Tax cache ignores denom
Low Severity
fetchNativeTransferTaxParamscaches tax params for 60s without recording which denom was fetched. A later call for another native denom (e.g.uusdafteruluna) can reuse the wrong tax cap until the cache expires.Reviewed by Cursor Bugbot for commit
76723cf513. Configure here.added 1 commit
465c66ab- fix(frontend): gross wrap deposit, net preflight offer, denom tax cacheCompare with previous version
changed the description
resolved all threads
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
465c66ab82. Configure here.Max reserve omits unwrap gas
Medium Severity
This change adds
needsUnwrapOutputtoestimateNativeSwapUlunaFeesTotalso router swaps withunwrap_outputincludeUNWRAP_GAS_LIMIT, but the Swap page Max helper still passesnativeSwapHintswithoutneedsUnwrapOutput. Native-input routes that unwrap (e.g. LUNC→USTC) can Max out pay amount and leave too littleulunafor fees.Additional Locations (1)
frontend-dapp/src/services/terraclassic/transactions.ts#L95-L118Reviewed by Cursor Bugbot for commit
465c66ab82. Configure here.added 1 commit
7ed3ede6- fix(frontend): include unwrap gas in Swap Max reserveCompare with previous version
changed the description
resolved all threads
mentioned in commit
a6c43cab31