FSM-Driven Flow Control and Logic Updating for Modifiable Smart Contracts
Lee Liu, Shun-Wen Hsiao, Fang YuSmart contracts deployed on blockchains are traditionally immutable, yet practical applications may require controlled adaptation to address logic defects, evolving business requirements, or changes in contractual terms. This paper presents an FSM-driven framework for modifiable smart contracts that combines flow control with controlled logic evolution while preserving contract state. The framework separates responsibilities across four components: a control contract that uses a finite state machine (FSM) to enforce valid transaction sequences and manage FSM versions; a storage contract that maintains persistent state variables; a main contract that implements application logic; and an update contract that supplies revised logic. This design supports parameter updates, partial logic replacement, and the addition or reconfiguration of FSM states without requiring replacement of the entire application contract. It further supports user-level version control, allowing users to retain an existing approved version or migrate to a newly introduced version where the application setting permits such coexistence. Two insurance-oriented proof-of-concept implementations, covering travel insurance and annuity insurance, illustrate the framework’s operation under logic-update and extension scenarios. The framework is intended as a design-oriented approach to controlled smart-contract evolution; quantitative benchmarking against alternative upgradeability mechanisms remains future work.