Photo by Dimitri Karastelev on Unsplash

Storing State in a Smart Contract

Smart contracts give us the opportunity to store data in a stateful way, and where we can add and delete data within the smart contract, and then view a current state. So let’s do a simple contact of adding cities to a string array. Overall it will cost us some gas to add and delete strings, but not to view the state. The contract we will use is:

--

--

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store