Pragma, import, and comments

A pragma directive of solidity always has versions in the form 0.x.0 or x .0.0, as shown in Figure 6.1. This ensures that any future version of the solidity compiler is ignored that might introduce incompatibility:

Figure 6.1: Pragma directives

Although solidity does not have the ability to export or spool-out results yet, it supports import statements, which are very similar to JavaScript. This keyword is used at contract compile time in our local build environment. Once a contract gets deployed on a blockchain using EVM, it can neither read nor write files. Figure 6.2, lists down a few uses of the import statement ...

Get Ethereum Smart Contract Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.