State Data Transition Risk
State data transition risk occurs during protocol upgrades when the internal record-keeping of a smart contract, such as user balances or position data, is moved to a new contract architecture. If the mapping of this data is corrupted or if the new contract fails to correctly read the legacy state, users may lose access to their deposited funds or collateral.
This risk is particularly high in complex DeFi protocols where state data is heavily interdependent. Ensuring the integrity of the data migration requires careful script execution and verification.
Inadequate testing of these migration scripts can lead to incorrect accounting of financial assets, resulting in severe imbalances within the protocol.