DEFINE
User assembles intent. Validation only — never produces a terminal failure.
Every module's lifecycle is a closed set of states. Validation states are disjoint from terminal failures. Forbidden post-submit causes are named explicitly. Invented states are violations.
Binding source:
01-STANDARDS/State-Modeling-Standard.md.
Every wallet movement follows the same four-phase lifecycle. Backwards transitions are forbidden; phase mixing is forbidden.
The biggest source of state-model bugs is conflating a validation block with a post-submit failure. They live in different enums and mean different things.
EMPTYNO_ASSETINVALID_AMOUNTINSUFFICIENT_BALANCEBELOW_MINIMUM (Deposit only)NO_ADDRESS (Withdraw only)USER_CANCELLED — pre-submission navigationUSER_REJECTED — out of scope unless signing surface existsINSUFFICIENT_BALANCE — DEFINE-stage onlyBELOW_MINIMUM — DEFINE-stage only