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: