mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge remote-tracking branch 'origin/develop' into breaking
This commit is contained in:
@@ -33,6 +33,13 @@ that call them, similar to internal library functions.
|
||||
}
|
||||
}
|
||||
|
||||
.. note::
|
||||
Functions defined outside a contract are still always executed
|
||||
in the context of a contract. They still have access to the variable ``this``,
|
||||
can call other contracts, send them Ether and destroy the contract that called them,
|
||||
among other things. The main difference to functions defined inside a contract
|
||||
is that free functions do not have direct access to storage variables and functions
|
||||
not in their scope.
|
||||
|
||||
.. _function-parameters-return-variables:
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ Team Calls
|
||||
If you have issues or pull requests to discuss, or are interested in hearing what
|
||||
the team and contributors are working on, you can join our public team calls:
|
||||
|
||||
- Mondays at 12pm CET/CEST.
|
||||
- Mondays at 3pm CET/CEST.
|
||||
- Wednesdays at 2pm CET/CEST.
|
||||
|
||||
Both calls take place on `Google Meet <https://meet.google.com/mrq-kbwv-edg>`_.
|
||||
|
||||
@@ -39,6 +39,7 @@ Getting Started
|
||||
|
||||
If you are new to the concept of smart contracts we recommend you to get started by digging
|
||||
into the "Introduction to Smart Contracts" section, which covers:
|
||||
|
||||
* :ref:`A simple example smart contract <simple-smart-contract>` written in Solidity.
|
||||
* :ref:`Blockchain Basics <blockchain-basics>`.
|
||||
* :ref:`The Ethereum Virtual Machine <the-ethereum-virtual-machine>`.
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
|
||||
.. index: calldata layout
|
||||
|
||||
*******************
|
||||
Layout of Call Data
|
||||
*******************
|
||||
|
||||
@@ -36,4 +36,37 @@ elements.
|
||||
definitely zeroed out memory area, using such a pointer non-temporarily
|
||||
without updating the free memory pointer can have unexpected results.
|
||||
|
||||
.. index: calldata layout
|
||||
|
||||
Differences to Layout in Storage
|
||||
================================
|
||||
|
||||
As described above the layout in memory is different from the layout in
|
||||
:ref:`storage<storage-inplace-encoding>`. Below there are some examples.
|
||||
|
||||
Example for Difference in Arrays
|
||||
--------------------------------
|
||||
|
||||
The following array occupies 32 bytes (1 slot) in storage, but 128
|
||||
bytes (4 items with 32 bytes each) in memory.
|
||||
|
||||
::
|
||||
|
||||
uint8[4] a;
|
||||
|
||||
|
||||
|
||||
Example for Difference in Struct Layout
|
||||
---------------------------------------
|
||||
|
||||
The following struct occupies 96 bytes (3 slots of 32 bytes) in storage,
|
||||
but 128 bytes (4 items with 32 bytes each) in memory.
|
||||
|
||||
|
||||
::
|
||||
|
||||
struct S {
|
||||
uint a;
|
||||
uint b;
|
||||
uint8 c;
|
||||
uint8 d;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user