diff --git a/docs/_static/css/dark.css b/docs/_static/css/dark.css index cb96b428c8..158f08e0fc 100644 --- a/docs/_static/css/dark.css +++ b/docs/_static/css/dark.css @@ -20,6 +20,10 @@ a:visited { background-color: #2d2d2d !important; } +.descname { + color: inherit !important; +} + .rst-content dl:not(.docutils) dt { color: #aaddff; border-top: solid 3px #525252; @@ -164,6 +168,10 @@ pre { /* table of contents */ +.wy-body-for-nav { + background-color: rgb(26, 28, 29); +} + .wy-nav-content-wrap { background-color: rgba(0, 0, 0, 0.6) !important; } diff --git a/docs/conf.py b/docs/conf.py index 12af82b6e4..5dc1eee8f5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -56,7 +56,7 @@ # General information about the project. project = "Vyper" -copyright = "2017-2020 CC-BY-4.0 Vyper Team" +copyright = "2017-2024 CC-BY-4.0 Vyper Team" author = "Vyper Team (originally created by Vitalik Buterin)" # The version info for the project you're documenting, acts as replacement for @@ -190,5 +190,5 @@ intersphinx_mapping = { "brownie": ("https://eth-brownie.readthedocs.io/en/stable", None), "pytest": ("https://docs.pytest.org/en/latest/", None), - "python": ("https://docs.python.org/3.8/", None), + "python": ("https://docs.python.org/3.10/", None), } diff --git a/docs/control-structures.rst b/docs/control-structures.rst index 2f890bcb2f..14202cbae7 100644 --- a/docs/control-structures.rst +++ b/docs/control-structures.rst @@ -125,7 +125,7 @@ You cannot put the ``@nonreentrant`` decorator on a ``pure`` function. You can p The ``__default__`` Function --------------------------- +---------------------------- A contract can also have a default function, which is executed on a call to the contract if no other functions match the given function identifier (or if none was supplied at all, such as through someone sending it Eth). It is the same construct as fallback functions `in Solidity `_. @@ -165,7 +165,7 @@ Lastly, although the default function receives no arguments, it can still access * the gas provided (``msg.gas``). The ``__init__`` Function ------------------------ +------------------------- ``__init__`` is a special initialization function that may only be called at the time of deploying a contract. It can be used to set initial values for storage variables. A common use case is to set an ``owner`` variable with the creator the contract: diff --git a/docs/installing-vyper.rst b/docs/installing-vyper.rst index fb2849708d..8eaa93590a 100644 --- a/docs/installing-vyper.rst +++ b/docs/installing-vyper.rst @@ -79,10 +79,10 @@ To install a specific version use: pip install vyper==0.3.7 You can check if Vyper is installed completely or not by typing the following in your terminal/cmd: - :: vyper --version + nix *** diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 3db11dc451..3689433af7 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -51,7 +51,7 @@ Notable fixes: - update tload/tstore opcodes per latest 1153 EIP spec (`#3484 `_) - fix: raw_call type when max_outsize=0 is set (`#3572 `_) - fix: implements check for indexed event arguments (`#3570 `_) -- fix: type-checking for ``_abi_decode()`` arguments (`#3626 `_) +- fix: type-checking for ``_abi_decode()`` arguments (`#3626 `__) Other docs updates, chores and fixes: ------------------------------------- @@ -164,7 +164,7 @@ Other docs updates, chores and fixes: - fix docs of ``blockhash`` to reflect revert behaviour (`#3168 `_) - improvements to compiler error messages (`#3121 `_, `#3134 `_, `#3312 `_, `#3304 `_, `#3240 `_, `#3264 `_, `#3343 `_, `#3307 `_, `#3313 `_ and `#3215 `_) -These are really just the highlights, as many other bugfixes, docs updates and refactoring (over 150 pull requests!) made it into this release! For the full list, please see the `changelog `_. Special thanks to contributions from @tserg, @trocher, @z80dev, @emc415 and @benber86 in this release! +These are really just the highlights, as many other bugfixes, docs updates and refactoring (over 150 pull requests!) made it into this release! For the full list, please see the `changelog `__. Special thanks to contributions from @tserg, @trocher, @z80dev, @emc415 and @benber86 in this release! New Contributors: @@ -346,7 +346,7 @@ Notable Fixes: * Referencing immutables in constructor (`#2627 `_) * Arrays of interfaces in for loops (`#2699 `_) -Lots of optimizations, refactoring and other fixes made it into this release! For the full list, please see the `changelog `_. +Lots of optimizations, refactoring and other fixes made it into this release! For the full list, please see the `changelog `__. Special thanks to @tserg for typechecker fixes and significant testing of new features! Additional contributors to this release include @abdullathedruid, @hi-ogawa, @skellet0r, @fubuloubu, @onlymaresia, @SwapOperator, @hitsuzen-eth, @Sud0u53r, @davidhq. diff --git a/docs/testing-contracts-ethtester.rst b/docs/testing-contracts-ethtester.rst index 1b7e9e3263..27e67831de 100644 --- a/docs/testing-contracts-ethtester.rst +++ b/docs/testing-contracts-ethtester.rst @@ -16,7 +16,7 @@ Prior to testing, the Vyper specific contract conversion and the blockchain rela Since the testing is done in the pytest framework, you can make use of `pytest.ini, tox.ini and setup.cfg `_ and you can use most IDEs' pytest plugins. -.. literalinclude:: ../tests/base_conftest.py +.. literalinclude:: ../tests/conftest.py :language: python :linenos: @@ -35,7 +35,7 @@ Assume the following simple contract ``storage.vy``. It has a single integer var We create a test file ``test_storage.py`` where we write our tests in pytest style. -.. literalinclude:: ../tests/examples/storage/test_storage.py +.. literalinclude:: ../tests/functional/examples/storage/test_storage.py :linenos: :language: python @@ -61,7 +61,7 @@ Next, we take a look at the two fixtures that will allow us to read the event lo The fixture to assert failed transactions defaults to check for a ``TransactionFailed`` exception, but can be used to check for different exceptions too, as shown below. Also note that the chain gets reverted to the state before the failed transaction. -.. literalinclude:: ../tests/base_conftest.py +.. literalinclude:: ../tests/conftest.py :language: python :pyobject: get_logs @@ -69,6 +69,6 @@ This fixture will return a tuple with all the logs for a certain event and trans Finally, we create a new file ``test_advanced_storage.py`` where we use the new fixtures to test failed transactions and events. -.. literalinclude:: ../tests/examples/storage/test_advanced_storage.py +.. literalinclude:: ../tests/functional/examples/storage/test_advanced_storage.py :linenos: :language: python diff --git a/docs/types.rst b/docs/types.rst index a8be721b1a..0f5bfe7b04 100644 --- a/docs/types.rst +++ b/docs/types.rst @@ -316,7 +316,7 @@ Syntax as follows: ``_address.``, where ``_address`` is of the type ``ad ``_address.code`` requires the usage of :func:`slice ` to explicitly extract a section of contract bytecode. If the extracted section exceeds the bounds of bytecode, this will throw. You can check the size of ``_address.code`` using ``_address.codesize``. M-byte-wide Fixed Size Byte Array ----------------------- +--------------------------------- **Keyword:** ``bytesM`` This is an M-byte-wide byte array that is otherwise similar to dynamically sized byte arrays. On an ABI level, it is annotated as bytesM (e.g., bytes32). @@ -452,6 +452,7 @@ Note that ``in`` is not the same as strict equality (``==``). ``in`` checks that The following code uses bitwise operations to add and revoke permissions from a given ``Roles`` object. .. code-block:: python + @external def add_user(a: Roles) -> Roles: ret: Roles = a @@ -676,4 +677,4 @@ All type conversions in Vyper must be made explicitly using the built-in ``conve * Converting between bytes and int types which have different sizes follows the rule of going through the closest integer type, first. For instance, ``bytes1 -> int16`` is like ``bytes1 -> int8 -> int16`` (signextend, then widen). ``uint8 -> bytes20`` is like ``uint8 -> uint160 -> bytes20`` (rotate left 12 bytes). * Enums can be converted to and from ``uint256`` only. -A small Python reference implementation is maintained as part of Vyper's test suite, it can be found `here `_. The motivation and more detailed discussion of the rules can be found `here `_. +A small Python reference implementation is maintained as part of Vyper's test suite, it can be found `here `__. The motivation and more detailed discussion of the rules can be found `here `__. diff --git a/requirements-docs.txt b/requirements-docs.txt index 157d7bcab5..5906384fc7 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,3 +1,3 @@ -sphinx==5.0.0 -recommonmark==0.6.0 -sphinx_rtd_theme==0.5.2 +sphinx==7.2.6 +recommonmark==0.7.1 +sphinx_rtd_theme==2.0.0