Skip to content

Commit

Permalink
Document _origin.
Browse files Browse the repository at this point in the history
  • Loading branch information
vaivaswatha committed Dec 16, 2020
1 parent 196be1b commit ac99615
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
6 changes: 5 additions & 1 deletion docs/source/interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ Field Description
=========== ===========================================
``_tag`` Transition to be invoked
``_amount`` Number of QA to be transferred
``_sender`` Address of the invoker
``_sender`` Address of the invoker (in a chain call, this is the immediate caller)
``_origin`` Address from which the transaction originated
``params`` An array of parameter objects
=========== ===========================================

Expand Down Expand Up @@ -240,6 +241,7 @@ an example ``input_message.json`` is given below:
"_tag" : "SayHello",
"_amount" : "0",
"_sender" : "0x1234567890123456789012345678901234567890",
"_origin" : "0x1234567890123456789012345678901234567890",
"params" : []
}
Expand All @@ -259,6 +261,7 @@ an example ``input_message.json`` is given below:
"_tag" : "TransferFrom",
"_amount" : "0",
"_sender" : "0x64345678901234567890123456789012345678cd",
"_origin" : "0x64345678901234567890123456789012345678cd",
"params" : [
{
"vname" : "from",
Expand Down Expand Up @@ -327,6 +330,7 @@ Say that the contract has been deployed at address ``0x1234567890123456789012345
"_tag": "MoveAction",
"_amount": "0",
"_sender" : "0x64345678901234567890123456789012345678cd",
"_origin" : "0x64345678901234567890123456789012345678cd",
"params": [
{
"vname" : "dir",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/scilla-by-example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ procedure with the arguments ``True`` and ``0``:
.. note::

The special parameters ``_sender`` and ``_amount`` are available to
The special parameters ``_sender``, ``_origin`` and ``_amount`` are available to
a procedure even though the procedure is invoked by a transition
rather than by an incoming message. It is not necessary to pass
these special parameters as arguments to the procedure.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/scilla-checker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ as representing money. Similarly, a local variable used to initialise
the ``_amount`` field of an outgoing message is also tagged as
representing money.

Conversely, the message fields ``_sender``, ``_recipient``, and
Conversely, the message fields ``_sender``, ``_origin``, ``_recipient``, and
``_tag``, the event field ``_eventname``, the exception field
``_exception``, and the blockchain field ``BLOCKNUMBER``, are known to
not represent money, so any variable used to initialise those fields
Expand Down
9 changes: 7 additions & 2 deletions docs/source/scilla-in-depth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,12 @@ multiple parameters are separated by ``,``.
- ``_sender : ByStr20`` : The account address that triggered this
transition. If the transition was called by a contract account
instead of a user account, then ``_sender`` is the address of
the contract that called this transition.
the contract that called this transition. In a chain call, this is
always the immediate caller.

- ``_origin : ByStr20`` : The account address that triggered this
transaction (which can possibly be a chain call). This is always
a non-contract address.

- ``_amount : Uint128`` : Incoming amount, in QA (see section
above on the units), sent by the sender. To transfer the money
Expand Down Expand Up @@ -344,7 +349,7 @@ procedure does not return a result.

.. note::

The implicit transition parameters ``_sender`` and ``_amount`` are
The implicit transition parameters ``_sender``, ``_origin`` and ``_amount`` are
implicitly passed to all the procedures that a transition
calls. There is therefore no need to declare those parameters
explicitly when defining a procedure.
Expand Down

0 comments on commit ac99615

Please sign in to comment.