December 2018
Intermediate to advanced
222 pages
6h 6m
English
The import keyword in solidity is very similar to JavaScript's past version, ES6. It is used to import libraries and other related features into your solidity source file. Solidity does not support export statements.
Here are a few import examples:
import * as symbolName from “solidityFile”
The preceding line shown will create a global symbol called symbolName, containing the global symbol's member from the import file: solidityFile.
Another solidity-specific syntax equivalent to the preceding import is the following:
import solidityFile as symbolName;
You can also import multiple symbols, and name some of the symbols as alias, demonstrated as follows:
import {symbol1 as alias, symbol2} from " solidityFile";
Here is an example where ...
Read now
Unlock full access