Merge pull request #6154 from ethereum/meta-name

Add type(C).name to the documentation
This commit is contained in:
chriseth 2019-03-04 13:04:47 +01:00 committed by GitHub
commit 68e1bf47d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -385,6 +385,7 @@ Global Variables
- ``<address>.balance`` (``uint256``): balance of the :ref:`address` in Wei - ``<address>.balance`` (``uint256``): balance of the :ref:`address` in Wei
- ``<address payable>.send(uint256 amount) returns (bool)``: send given amount of Wei to :ref:`address`, returns ``false`` on failure - ``<address payable>.send(uint256 amount) returns (bool)``: send given amount of Wei to :ref:`address`, returns ``false`` on failure
- ``<address payable>.transfer(uint256 amount)``: send given amount of Wei to :ref:`address`, throws on failure - ``<address payable>.transfer(uint256 amount)``: send given amount of Wei to :ref:`address`, throws on failure
- ``type(C).name`` (``string``): the name of the contract
- ``type(C).creationCode`` (``bytes memory``): creation bytecode of the given contract, see :ref:`Type Information<meta-type>`. - ``type(C).creationCode`` (``bytes memory``): creation bytecode of the given contract, see :ref:`Type Information<meta-type>`.
- ``type(C).runtimeCode`` (``bytes memory``): runtime bytecode of the given contract, see :ref:`Type Information<meta-type>`. - ``type(C).runtimeCode`` (``bytes memory``): runtime bytecode of the given contract, see :ref:`Type Information<meta-type>`.

View File

@ -269,6 +269,9 @@ type ``X``. Currently, there is limited support for this feature, but
it might be expanded in the future. The following properties are it might be expanded in the future. The following properties are
available for a contract type ``C``: available for a contract type ``C``:
``type(C).name``:
The name of the contract.
``type(C).creationCode``: ``type(C).creationCode``:
Memory byte array that contains the creation bytecode of the contract. Memory byte array that contains the creation bytecode of the contract.
This can be used in inline assembly to build custom creation routines, This can be used in inline assembly to build custom creation routines,