Restore unconditional IgnoreFreeze in VaultWithdraw::doApply when
fixCleanup3_3_0 is enabled. That accountHolds reads the submitter's
share balance, which recurses into the underlying asset, so freeze
gating must stay in preclaim; a dstAcct==issuer guard there wrongly
blocked self-withdrawal under a regular freeze.
Apply issuer-aware freeze handling to LoanBrokerCoverWithdraw::preclaim
so the issuer can redeem their own token from the broker pseudo-account
even under a global freeze, matching AMM and Vault. Here accountHolds
reads the pseudo-account's holdings, so the issuer-only IgnoreFreeze is
both necessary and sufficient.
Rename the checkWithdrawFreeze source parameter to srcAcct to match its
definition, drop a misleading comment, and hoist the fixCleanup feature
flags into named locals.
Migrate AMMDeposit and AMMWithdraw to use the unified freeze helpers
introduced for Vault and LoanBroker, gated on fixCleanup3_3_0.
AMMDeposit: checkDepositFreeze for both pool assets replaces the
two-layer checkAsset + checkAmount freeze logic. If either pool asset
is frozen (depositor or AMM account), all deposits are blocked.
AMMWithdraw: checkWithdrawFreeze per withdrawn amount replaces
checkFrozen(AMM) + checkIndividualFrozen(user). Regular IOU freeze
no longer blocks self-withdrawal; only deep freeze does. The issuer
exemption allows the token issuer to withdraw from a frozen pool;
issuerFreezeHandling() ensures doApply uses IgnoreFreeze so pool
math does not divide by zero.
Rename checkWithdrawFreezes -> checkWithdrawFreeze (singular) and
update all callers. Document both helpers with full freeze semantics.
Extract all IOU freeze and MPT lock tests from testWithIOU and
testWithMPT into two focused test functions covering VaultDeposit
and VaultWithdraw respectively.
Each function tests both IOU (global, depositor regular/deep,
vault-account regular/deep) and MPT (global lock, depositor lock,
vault-account lock) for both pre- and post-fixCleanup3_3_0, plus
clawback-while-frozen assertions.
Add checkDepositFreeze that checks the depositor for regular freeze and
the destination pseudo-account for deep freeze only. A regular freeze on
the vault account's trust line no longer blocks deposits.
Update checkWithdrawFreezes to skip the submitter freeze check when
submitter == destination (withdrawing to self).
Gate VaultDeposit with fixCleanup3_3_0; pre-fix path preserves the old
isFrozen-based checks. Use checkDepositFreeze in LoanBrokerCoverDeposit.
Reflect the new deposit freeze semantics: only a deep-frozen
pseudo-account blocks deposits; a regular freeze on the vault account's
trust line no longer does. Also account for the checkWithdrawFreezes
change where submitter == destination skips the submitter freeze check.
Parameterize the pre/post-fix test variants via runTest lambdas instead
of withFix ternaries. Add a dedicated deep-freeze deposit test.
Introduce checkWithdrawFreezes helper gated behind fixCleanup3_3_0 that
consolidates source, submitter, and destination freeze checks for
pseudo-account withdrawals. The issuer-redemption exemption is now
handled in one place rather than scattered across callers.
Add MPT individual-lock tests for depositor and 3rd-party destination
withdrawal scenarios, and extend LoanBrokerCoverWithdraw with the same
consolidated freeze logic.