Native NEP5 is an amazing invention for Neo 3, and it would be nice to able to reuse it in several places as well.
So, I propose to move TState structures to somewhere on Neo/Gas Nep5 implementations, but not directly on Nep5 template class. It could be implemented with prefixes in a dettached way, each field on a prefix, or all auxiliary fields in another prefix. It would be nice to have Neo votes on a separated prefix too.
Example (current one):
accountprefix + scripthash -> serialized TState with amount / or possibly many stuff
To allow further optimizations (such as key groupings on storage, if using MPT or any kind of tree), it's better to have a user scripthash _suffix_ for TState.
Example:
accountprefix + scripthash + amountssuffix -> amount
accountprefix + scripthash + votessuffix -> votes
etc.
So, no extra space is spent, and flexibility is much higher.
and if vote is 0, no extraspace is used
Vote can not be 0, default to Red4Sec or NeoResearch node....ehauahheuah
Most helpful comment
Vote can not be 0, default to Red4Sec or NeoResearch node....ehauahheuah