diff options
Diffstat (limited to 'docs/introduction-to-smart-contracts.rst')
| -rw-r--r-- | docs/introduction-to-smart-contracts.rst | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/docs/introduction-to-smart-contracts.rst b/docs/introduction-to-smart-contracts.rst index 922056ec..eeea85a7 100644 --- a/docs/introduction-to-smart-contracts.rst +++ b/docs/introduction-to-smart-contracts.rst @@ -348,10 +348,12 @@ storage. A contract can neither read nor write to any storage apart from its own. The second memory area is called **memory**, of which a contract obtains -a freshly cleared instance for each message call. Memory can be -addressed at byte level, but read and written to in 32 byte (256-bit) -chunks. Memory is more costly the larger it grows (it scales -quadratically). +a freshly cleared instance for each message call. Memory is linear and can be +addressed at byte level, but reads are limited to a width of 256 bits, while writes +can be either 8 bits or 256 bits wide. Memory is expanded by a word (256-bit), when +accessing (either reading or writing) a previously untouched memory word (ie. any offset +within a word). At the time of expansion, the cost in gas must be paid. Memory is more +costly the larger it grows (it scales quadratically). The EVM is not a register machine but a stack machine, so all computations are performed on an area called the **stack**. It has a maximum size of @@ -453,13 +455,19 @@ receives the address of the new contract on the stack. .. index:: selfdestruct -``selfdestruct`` -================ +Self-destruct +============= The only possibility that code is removed from the blockchain is when a contract at that address performs the ``selfdestruct`` operation. The remaining Ether stored at that address is sent to a designated -target and then the storage and code is removed. +target and then the storage and code is removed from the state. + +.. warning:: Even if a contract's code does not contain a call to ``selfdestruct``, + it can still perform that operation using ``delegatecall`` or ``callcode``. + +.. note:: The pruning of old contracts may or may not be implemented by Ethereum + clients. Additionally, archive nodes could choose to keep the contract storage + and code indefinitely. -Note that even if a contract's code does not contain a call to ``selfdestruct``, -it can still perform that operation using ``delegatecall`` or ``callcode``. +.. note:: Currently **external accounts** cannot be removed from the state. |
