ethereum / langlab

MIT License
9 stars 5 forks source link

More fine-grained definition of "API" #5

Open markusvoelter opened 7 years ago

markusvoelter commented 7 years ago

@pirapira You will soon be tempted to add eight or ten keywords because Ethereum contracts have different execution modes (in init mode / after deployment) (in staticcall / not in staticcall) (in delegatecall / callcode / call instruction / call transaction) ((read-only / read-write) to (storage / balance)).

@pirapira if 'query' means read-only, in the beginning, 'query storage data' is more appropriate than 'api storage data'.

@pirapira 'api' by default should be read-only, and 'api action' should be able to update the state. The more dangerous thing should be harder to use.

kbirken commented 7 years ago

Maybe hierarchical state machines could be used: The top-level states are fixed and represent the generic lifecycles of a contract, and the specific behavior can be added as sub-states.