Skip to content

Commit

Permalink
docs: clarify skip_contract_check=True can result in undefined beha…
Browse files Browse the repository at this point in the history
…vior (#3386)
  • Loading branch information
charles-cooper authored May 7, 2023
1 parent c13f26d commit cf00f41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/interfaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ The ``default_return_value`` parameter can be used to handle ERC20 tokens affect
ERC20(USDT).transfer(msg.sender, 1, default_return_value=True) # returns True
ERC20(USDT).transfer(msg.sender, 1) # reverts because nothing returned
.. warning::

When ``skip_contract_check=True`` is used and the called function returns data (ex.: ``x: uint256 = SomeContract.foo(skip_contract_check=True)``, no guarantees are provided by the compiler as to the validity of the returned value. In other words, it is undefined behavior what happens if the called contract did not exist. In particular, the returned value might point to garbage memory. It is therefore recommended to only use ``skip_contract_check=True`` to call contracts which have been manually ensured to exist at the time of the call.

Importing Interfaces
====================

Expand Down

0 comments on commit cf00f41

Please sign in to comment.