HQ20 / contracts

A set of reusable smart-contracts

Home Page:https://hq20-contracts.netlify.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Would it be cheaper to use enum instead of a string?

vibern0 opened this issue · comments

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?

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.