Member-only story

Solidity Tutorial: All About Imports

Dive into import statements with Solidity

Jean Cvllr
Better Programming
10 min readMar 21, 2022

Photo by Tim Schmidbauer on Unsplash

Table of Contents

Modules and Code Modularity.Solidity Imports.Types of Solidity Import Syntax.
* Global Import
* Specific Imports
Import Aliases.
* Global Alias
* Alias Specific
Which import syntax to use?What can you import from a Solidity file?Solidity Import Syntax Cheatsheet

Modules and Code Modularity

Before diving into Import statements in Solidity, let’s first understand modular programming. The concept of modules is very old. It first appeared 44 years ago with the programming languages Modula-2 and Pascal.

The idea behind modules is to break code into reusable components. You group functionalities in a module file and expose them to other files so that these other files can use them.

A module system helps organise your code by grouping variables and functions that make sense together in one single file.

Let’s take the example of modules in Javascript (ES6). In ES6, modules are files that export one or more values (objects, functions or variables). Then, any other…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Jean Cvllr
Jean Cvllr

Written by Jean Cvllr

Smart Contract engineer at @LUKSO. Full Stack Developer. https://github.com/CJ42

Responses (1)

Write a response