From aa4d3cabf1e698bf871877d66d88d4bb48139611 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 8 Nov 2021 13:22:23 +0100 Subject: [PATCH] Clarify ``pure``. --- docs/contracts/functions.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/contracts/functions.rst b/docs/contracts/functions.rst index 7d1ce7256..ff49e4f28 100644 --- a/docs/contracts/functions.rst +++ b/docs/contracts/functions.rst @@ -222,6 +222,9 @@ Pure Functions -------------- Functions can be declared ``pure`` in which case they promise not to read from or modify the state. +In particular, it should be possible to evaluate a ``pure`` function at compile-time given +only its inputs and ``msg.data``, but without any knowledge of the current blockchain state. +This means that reading from ``immutable`` variables can be a non-pure operation. .. note:: If the compiler's EVM target is Byzantium or newer (default) the opcode ``STATICCALL`` is used,