fix(community-tax): SendFrom listed-pair Sell extra-debits beyond allowance #1233
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!1233
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue/1228"
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
execute_send_fromclassifies viatax::previewbeforededuct_allowance, then deductsTaxPreview.debit(pair-direct listed-pair Sell =amount + tax, T592-2 / A-allow).amount(ordebit - 1) reverts before balances move.TransferFromstill deductsamountonly (T592-7). Pair/router/factory wasm unchanged (H-01).make verify-issue-1228. Live 11611 / 11619 still need a later store+migrate (ops, not this PR).Fixes #1228
Acceptance
SendFrom+Swapwith allowance == declaredamountreverts; no owner debit, no pair credit, no sink credit, allowance unchanged.TaxPreview.debitsucceeds; owner −debit, pair +amount, sinks +tax, remaining allowance 0.SendFromcannot skip sell tax (same extra-debit as ownerSendfor pair-direct).TransferFromto the listed pair (no Swap hook) remains 1:1; allowance decreases byamountonly.SendFromdebit =amount; allowance =amount.traderdoes not move the victim; owner is extra-debited (T592-13).amount.sell_extra_debit_on_swap_send/ greedy extra-debit tests stay green.Test plan
cargo test -p cl8y-community-tax-token(crate suite)make verify-issue-1228(first pass + retest)execute_send_fromdeductspreview.debitandexecute_transfer_fromstill deductsamountdrain skip: hard-blocked (needs-human / high-risk / human topic); remaining continue