Skip to content

feat(frontend): add preflight simulation before value-moving transactions #264

Description

@arisu6804

Problem

Users can reach the wallet-signing step with stale balances, paused contracts, unsupported amounts, or provider conditions that would make a value-moving transaction fail.

Objective

Add a safe, read-only preflight step that catches deterministic failures before requesting a signature while preserving the authoritative on-chain result.

Implementation scope

  • Run the configured simulation or validation endpoint against the current wallet, network, and transaction payload.
  • Present actionable failure reasons and invalidate the preflight when relevant state changes.
  • Never treat a successful simulation as confirmation and never bypass contract-side validation.

Acceptance criteria

  • Deposits and withdrawals do not request a signature when preflight detects a deterministic failure.
  • Preflight results are tied to the exact serialized transaction and connected network.
  • Provider timeouts and unsupported simulation responses produce a safe retry path.

Required validation

  • Add tests for success, contract rejection, timeout, stale balance, network switch, and changed payload.
  • Existing tests and CI remain passing.
  • Do not weaken, delete, or skip unrelated tests to obtain a green build.

PR quality bar

  • Explain the simulation trust boundary, race handling, user-visible states, and test evidence.
  • Keep the PR focused; avoid unrelated UI polish or documentation-only changes.

Out of scope

  • Replacing authoritative contract validation or redesigning wallet integrations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GRANTFOX OSSOpen-source issue tracked by GrantFoxMAYBE REWARDEDThis issue may carry a rewardThird CampaignThird Campaign contributionenhancementNew feature or requestpriority:highHigh implementation priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions