concept interface in category ethereum

appears as: interface, interfaces, n interface, An interface, interface
Building Ethereum Dapps: Decentralized applications on the Ethereum blockchain

This is an excerpt from Manning's book Building Ethereum Dapps: Decentralized applications on the Ethereum blockchain.

If you’re using the Ethereum wallet for Mac OS or LINUX, the interface is slightly different, screenshots won’t match what you see, and my descriptions might not work to the letter. Also, the default network shown might be different. But you should be able to find alternative ways to perform the operations I describe.

In this chapter, you’ll keep extending SimpleCrowdsale’s functionality by using other object-oriented features, such as abstract contracts and interfaces. I’ll show you how an abstract contract can help you generalize a contract while avoiding code duplication. I’ll also demonstrate how interfaces can add flexibility to the design of your contract so you can choose to plug in one of many possible implementations of a specific aspect of the contract functionality.

Figure 7.5. Relationships between an interface and its concrete implementations. You can represent this relationship in two ways. The first one resembles inheritance, with the interface being the parent of its implementations. The second one uses an explicit interface symbol that’s useful if you don’t want to show all the interface implementations.
  • An interface defines the set of functions that must be implemented; you must declare them with external visibility:
    interface ReleasableToken {
        function mint(address _beneficiary, uint256 _numberOfTokens) external;
    
        function release() external;
        function transfer(address _to, uint256 _amount) external;
    }