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:

--

--

Prof Bill Buchanan OBE FRSE
ASecuritySite: When Bob Met Alice

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.