From 895d6e58e779104c0e41f5130b8822345c88a3e9 Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Tue, 23 Apr 2019 16:32:40 +1000 Subject: [PATCH] Polish introductory section of introduction to smart contracts Update docs/introduction-to-smart-contracts.rst Co-Authored-By: ChrisChinchilla Clarify pragma version --- docs/introduction-to-smart-contracts.rst | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/introduction-to-smart-contracts.rst b/docs/introduction-to-smart-contracts.rst index 7d99e94a6..5d5649837 100644 --- a/docs/introduction-to-smart-contracts.rst +++ b/docs/introduction-to-smart-contracts.rst @@ -31,10 +31,9 @@ Storage Example } } -The first line simply tells that the source code is written for -Solidity version 0.4.0 or anything newer that does not break functionality -(up to, but not including, version 0.7.0). This is to ensure that the -contract is not compilable with a new (breaking) compiler version, where it could behave differently. +The first line tells you that the source code is written for +Solidity version 0.4.0, or a newer version of the language up to, but not including version 0.7.0. +This is to ensure that the contract is not compilable with a new (breaking) compiler version, where it could behave differently. :ref:`Pragmas` are common instructions for compilers about how to treat the source code (e.g. `pragma once `_). @@ -42,9 +41,9 @@ A contract in the sense of Solidity is a collection of code (its *functions*) an data (its *state*) that resides at a specific address on the Ethereum blockchain. The line ``uint storedData;`` declares a state variable called ``storedData`` of type ``uint`` (*u*\nsigned *int*\eger of *256* bits). You can think of it as a single slot -in a database that can be queried and altered by calling functions of the +in a database that you can query and alter by calling functions of the code that manages the database. In the case of Ethereum, this is always the owning -contract. And in this case, the functions ``set`` and ``get`` can be used to modify +contract. In this case, the functions ``set`` and ``get`` can be used to modify or retrieve the value of the variable. To access a state variable, you do not need the prefix ``this.`` as is common in @@ -53,9 +52,9 @@ other languages. This contract does not do much yet apart from (due to the infrastructure built by Ethereum) allowing anyone to store a single number that is accessible by anyone in the world without a (feasible) way to prevent you from publishing -this number. Of course, anyone could just call ``set`` again with a different value -and overwrite your number, but the number will still be stored in the history -of the blockchain. Later, we will see how you can impose access restrictions +this number. Anyone could call ``set`` again with a different value +and overwrite your number, but the number is still stored in the history +of the blockchain. Later, you will see how you can impose access restrictions so that only you can alter the number. .. note:: @@ -64,7 +63,7 @@ so that only you can alter the number. .. warning:: Be careful with using Unicode text, as similar looking (or even identical) characters can - have different code points and as such will be encoded as a different byte array. + have different code points and as such are encoded as a different byte array. .. index:: ! subcurrency