Would it be cheaper to use enum instead of a string?
vibern0 opened this issue · comments
Bernardo commented
Describe the solution you'd like
In StateMachine, the states (SETUP_STATE, currentState, transitions, and states) are all bytes32. Would it be cheaper to use an enum?
Alberto Cuesta Cañada commented
The states are created at runtime using function _createState(bytes32 _state)
. If we would use enums then all states would have to be specified at compilation time, limiting the flexibility of the contract.