From ce42b0fe7adfc3985fe8facb933ced5bd4ef249d Mon Sep 17 00:00:00 2001 From: elenadimitrova Date: Thu, 4 Jan 2018 11:57:15 +0200 Subject: [PATCH] Pull Interfaces and Abstract contracts below a common docs section --- docs/contracts.rst | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/contracts.rst b/docs/contracts.rst index 93e351c60f9e..9a9b840e1638 100644 --- a/docs/contracts.rst +++ b/docs/contracts.rst @@ -1048,13 +1048,22 @@ When the inheritance results in a contract with a function and a modifier of the This error is produced also by an event and a modifier of the same name, and a function and an event of the same name. As an exception, a state variable getter can override a public function. +.. index:: ! abstractions + +.. _abstractions: + +************ +Abstractions +************ + +An abstraction type describes a contract but does not provide a full implementation of the contract. An abstraction is implemented as either an abstract contract or interface. + .. index:: ! contract;abstract, ! abstract contract .. _abstract-contract: -****************** Abstract Contracts -****************** +================== Contracts are marked as abstract when at least one of their functions lacks an implementation as in the following example (note that the function declaration header is terminated by ``;``):: @@ -1080,9 +1089,8 @@ If a contract inherits from an abstract contract and does not implement all non- .. index:: ! contract;interface, ! interface contract -********** Interfaces -********** +========== Interfaces are similar to abstract contracts, but they cannot have any functions implemented. There are further restrictions: