April 2018
Intermediate to advanced
222 pages
5h 28m
English
Interfaces are like abstract contracts, but there are differences. Interfaces cannot contain any definition. They can only contain function declarations. It means functions in interfaces cannot contain any code. They are also known as pure abstract contracts. An interface can contain only the signature of functions. It also cannot contain any state variables. They cannot inherit from other contracts or contain enums or structures. However, interfaces can inherit other interfaces. The function signatures terminate using the semicolon ; character. Interfaces are declared using the interface keyword following by an identifier. The next code example shows an implementation of the interface. Solidity provides the interface keyword for ...