Skip to content

Commit

Permalink
docs: msg.sender is available even in internal fns (#2659)
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper authored Feb 15, 2022
1 parent b0f40fd commit 43f491f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
4 changes: 0 additions & 4 deletions docs/constants-and-vars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ Name Type Value
``tx.gasprice`` ``uint256`` Gas price of current transaction in wei
==================== ================ =============================================

.. note::

``msg.data``, ``msg.sender`` and ``msg.value`` can only be accessed from external functions. If you require these values within a private function, they must be passed as parameters.

.. note::

``msg.data`` requires the usage of :func:`slice <slice>` to explicitly extract a section of calldata. If the extracted section exceeds the bounds of calldata, this will throw. You can check the size of ``msg.data`` using :func:`len <len>`.
Expand Down
7 changes: 0 additions & 7 deletions docs/vyper-by-example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ contract, we are provided with a built-in variable ``msg`` and we can access
the public address of any method caller with ``msg.sender``. Similarly, the
amount of ether a user sends can be accessed by calling ``msg.value``.

.. note:: ``msg.sender`` and ``msg.value`` can only be accessed from external
functions. If you require these values within an internal function they must be passed as parameters.

Here, we first check whether the current time is within the bidding period by
comparing with the auction's start and end times using the ``assert`` function
which takes any boolean statement. We also check to see if the new bid is greater
Expand Down Expand Up @@ -419,10 +416,6 @@ Let’s move onto the constructor.
:lineno-start: 53
:lines: 53-62

.. note:: ``msg.sender`` and ``msg.value`` can only be accessed from external
functions. If you require these values within an internal function they must be
passed as parameters.

In the constructor, we hard-coded the contract to accept an
array argument of exactly two proposal names of type ``bytes32`` for the contracts
initialization. Because upon initialization, the ``__init__()`` method is called
Expand Down

0 comments on commit 43f491f

Please sign in to comment.