mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge the selfdestruct sections
This commit is contained in:
parent
3413b8b7b3
commit
c41effd7c8
@ -71,13 +71,6 @@ several blockchain explorers.
|
|||||||
Contracts on the blockchain should have their original source
|
Contracts on the blockchain should have their original source
|
||||||
code published if they are to be used by third parties.
|
code published if they are to be used by third parties.
|
||||||
|
|
||||||
Does ``selfdestruct()`` free up space in the blockchain?
|
|
||||||
========================================================
|
|
||||||
|
|
||||||
It removes the contract bytecode and storage from the current block
|
|
||||||
into the future, but since the blockchain stores every single block (i.e.
|
|
||||||
all history), this will not actually free up space on full/archive nodes.
|
|
||||||
|
|
||||||
Create a contract that can be killed and return funds
|
Create a contract that can be killed and return funds
|
||||||
=====================================================
|
=====================================================
|
||||||
|
|
||||||
|
@ -455,13 +455,17 @@ receives the address of the new contract on the stack.
|
|||||||
|
|
||||||
.. index:: selfdestruct
|
.. index:: selfdestruct
|
||||||
|
|
||||||
``selfdestruct``
|
Self-destruct
|
||||||
================
|
=============
|
||||||
|
|
||||||
The only possibility that code is removed from the blockchain is
|
The only possibility that code is removed from the blockchain is
|
||||||
when a contract at that address performs the ``selfdestruct`` operation.
|
when a contract at that address performs the ``selfdestruct`` operation.
|
||||||
The remaining Ether stored at that address is sent to a designated
|
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.
|
||||||
|
|
||||||
Note that even if a contract's code does not contain a call to ``selfdestruct``,
|
.. warning:: Even if a contract's code does not contain a call to ``selfdestruct``,
|
||||||
it can still perform that operation using ``delegatecall`` or ``callcode``.
|
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.
|
||||||
|
Loading…
Reference in New Issue
Block a user