Ola language
  • Introduction
  • 🏃‍♂️Quick Start
  • 👀Ola Examples
  • 👏Ola Language
    • Variables
    • Data Types
    • Operators
    • Control Flow
    • Functions
    • Event
    • Contracts
    • Interfaces and Librariese
    • Import
    • Comment Lines
    • Features TODO
  • Standard Libraries
    • CoreLib Functions
    • Prophet Functions
  • Ola Language ABI
  • Ola Compiler
    • Compiler Frontend
    • Compiler Backend
  • Ola Language Grammar
  • Appendix
Powered by GitBook
On this page
Edit on GitHub
  1. Ola Language

Import

The import directive is used to import items from other Ola files. This can be useful to keep a single definition in one file, which can be used in multiple other files. For example, you could have an interface in one source file, which several contracts implement or use which are in other files.

In order to use the code from other files, we can import them into our program using the keyword import and aswith the corresponding file name. Using import makes it easier for us to import some modular ibs, eliminating the need for repeated development. The basic syntax is as follow,path-speccan be absolute path(the full path of source file) or relative path (file path starts with./ or ../).

import "path-spec"

e.g.:

import "./math/u256.ola";
import "crypto/sha256.ola"
import "erc20.ola"
PreviousInterfaces and LibrarieseNextComment Lines

Last updated 1 year ago

👏