Update docs to reflect deprecation warning

This commit is contained in:
Nikola Matic 2023-01-24 11:43:34 +01:00
parent e7543d487d
commit 83a937423f
4 changed files with 17 additions and 4 deletions

View File

@ -562,6 +562,11 @@ is removed from the state. Removing the contract in theory sounds like a good
idea, but it is potentially dangerous, as if someone sends Ether to removed idea, but it is potentially dangerous, as if someone sends Ether to removed
contracts, the Ether is forever lost. contracts, the Ether is forever lost.
.. warning::
From version 0.8.18 and up, the use of ``selfdestruct`` in both Solidity and Yul will trigger a
deprecation warning, since the ``SELFDESTRUCT`` opcode will eventually undergo breaking changes in behaviour
as stated in `EIP-6049 <https://eips.ethereum.org/EIPS/eip-6049>`_.
.. warning:: .. warning::
Even if a contract is removed by ``selfdestruct``, it is still part of the Even if a contract is removed by ``selfdestruct``, it is still part of the
history of the blockchain and probably retained by most Ethereum nodes. history of the blockchain and probably retained by most Ethereum nodes.

View File

@ -327,11 +327,13 @@ Contract Related
- the receiving contract's receive function is not executed. - the receiving contract's receive function is not executed.
- the contract is only really destroyed at the end of the transaction and ``revert`` s might "undo" the destruction. - the contract is only really destroyed at the end of the transaction and ``revert`` s might "undo" the destruction.
Furthermore, all functions of the current contract are callable directly including the current function. Furthermore, all functions of the current contract are callable directly including the current function.
.. warning::
From version 0.8.18 and up, the use of ``selfdestruct`` in both Solidity and Yul will trigger a
deprecation warning, since the ``SELFDESTRUCT`` opcode will eventually undergo breaking changes in behaviour
as stated in `EIP-6049 <https://eips.ethereum.org/EIPS/eip-6049>`_.
.. note:: .. note::
Prior to version 0.5.0, there was a function called ``suicide`` with the same Prior to version 0.5.0, there was a function called ``suicide`` with the same
semantics as ``selfdestruct``. semantics as ``selfdestruct``.

View File

@ -899,6 +899,7 @@ the ``dup`` and ``swap`` instructions as well as ``jump`` instructions, labels a
| revert(p, s) | `-` | B | end execution, revert state changes, return data mem[p...(p+s)) | | revert(p, s) | `-` | B | end execution, revert state changes, return data mem[p...(p+s)) |
+-------------------------+-----+---+-----------------------------------------------------------------+ +-------------------------+-----+---+-----------------------------------------------------------------+
| selfdestruct(a) | `-` | F | end execution, destroy current contract and send funds to a | | selfdestruct(a) | `-` | F | end execution, destroy current contract and send funds to a |
| | | | (deprecated) |
+-------------------------+-----+---+-----------------------------------------------------------------+ +-------------------------+-----+---+-----------------------------------------------------------------+
| invalid() | `-` | F | end execution with invalid instruction | | invalid() | `-` | F | end execution with invalid instruction |
+-------------------------+-----+---+-----------------------------------------------------------------+ +-------------------------+-----+---+-----------------------------------------------------------------+
@ -956,6 +957,11 @@ the ``dup`` and ``swap`` instructions as well as ``jump`` instructions, labels a
Please note that irrelevant to which EVM version is selected in the compiler, the semantics of Please note that irrelevant to which EVM version is selected in the compiler, the semantics of
instructions depend on the final chain of deployment. instructions depend on the final chain of deployment.
.. warning::
From version 0.8.18 and up, the use of ``selfdestruct`` in both Solidity and Yul will trigger a
deprecation warning, since the ``SELFDESTRUCT`` opcode will eventually undergo breaking changes in behaviour
as stated in `EIP-6049 <https://eips.ethereum.org/EIPS/eip-6049>`_.
In some internal dialects, there are additional functions: In some internal dialects, there are additional functions:
datasize, dataoffset, datacopy datasize, dataoffset, datacopy

View File

@ -311,7 +311,7 @@ vector<YulString> AsmAnalyzer::operator()(FunctionCall const& _funCall)
if (BuiltinFunction const* f = m_dialect.builtin(_funCall.functionName.name)) if (BuiltinFunction const* f = m_dialect.builtin(_funCall.functionName.name))
{ {
if (_funCall.functionName.name.str() == "selfdestruct") if (_funCall.functionName.name == "selfdestruct"_yulstring)
m_errorReporter.warning( m_errorReporter.warning(
1699_error, 1699_error,
nativeLocationOf(_funCall.functionName), nativeLocationOf(_funCall.functionName),