I’m looking for feedback on a draft ERC for PhaseGuard, a fixed lifecycle state machine for smart contracts.
The goal with PhaseGuard is to make a class of contract lifecycle vulnerabilities structurally impossible using a fixed state machine across initialization, mutation, pause, maintenance, and finalization. I would really appreaciate it if security experts and protocol developers took a look at it and gave feedback on how I can maximize usability and efficiency, especially when it comes into the lifecycle phase implementations and policies defined below. All contributions are welcome. Thank you ![]()
Summary:
The idea is to model contract lifecycle explicitly as a 6-phase system with a fixed transition matrix and a per-phase policy bitmask. The goal is to unify a few things that are usually handled separately:
-
reentrancy (including read-only cases by restricting read-only calls during state mutations)
-
uninitialized state access
-
pause coverage
Instead of treating these as independent patterns, they’re enforced at the state machine level and exposed via a standard interface.
The design is intentionally constrained:
-
fixed allowed phases and transitions (transition matrix)
-
fixed policy matrix (allowed policy per phase)
-
some gas overhead compared to current OZ guards
Repo: https://github.com/athcb/solidity-phaseguard
Magicians thread: https://ethereum-magicians.org/t/draft-erc-phaseguard-standard-interface-for-contract-lifecycle-state/28007