EVM direct Asgard ERC20 deposits: add safe auto-refund path for ERC20 inbound transfers
Context (Incident Follow-up)
This issue is created in reaction to the recent memoless / direct-Asgard deposit incident discussed in THORChain Discord (InstaSwap user case, Feb 25–27, 2026): https://discord.com/channels/838986635756044328/1476157453736476703
Related follow-up issues from the same incident:
- #2776 - Memo preflight: validate memoless asset eligibility
- #2773 - Quote API: enforce memoless eligibility
Problem
Direct ERC20 transfers to Asgard (not via router / not executable as inbound swap) are left stranded, requiring manual recovery/refund and causing poor UX.
Proposal
Implement guarded auto-refund handling for direct ERC20 deposits to active Asgard vaults:
- Detect direct token deposits that are not valid router-based inbound swaps.
- Auto-refund when all safety conditions hold:
- asset is supported/pool asset
- amount exceeds refund gas + penalty threshold
- amount exceeds "not dust" threshold
- Emit clear event/telemetry for refunded vs non-refundable cases.
- Add feature gate (Mimir/config) if needed for rollout safety.
Acceptance Criteria
- Direct
ETH.USDTto Asgard (non-router) is detected and refunded when economically valid. - No interference with valid router-based flows.
- Non-refundable deposits are logged - observable for manual handling.
Edited by ZlyDevMaya