header-langage
简体中文
English
Tiếng Việt
Scan to Download the APP
Partnered With:

Simple Introduction to Solidity|Lecture 18: Import

Read this article in 4 Minutes
This article introduces the method of using the import keyword to import external source code.
Original title: " A minimalist introduction to Solidity: 18. Import "
Original author: 0xAA 


I am re-learning solidity recently, consolidate the details, and write a "Solidity minimalist introduction" , for beginners (programmers can find another tutorial), update 1-3 lectures every week.


All codes and tutorials are open source on github: github.com/AmazingAng/WTFSolidity


solidity Support using the import keyword to import contracts in other source codes, making development more modular.


import usage


Import through the relative position of the source file, example:  < br>



  Import online contract through source file URL



Import through npm directory 



Import specific contracts through global symbols

< br>


Test the import result


We can use the following code to test whether the external source code has been successfully imported:



Summary

< p style="text-align: left;">

In this lecture, we introduced the method of using the import keyword to import external source code. import allows us to directly import code written by others, which is very convenient.


Original link


Welcome to join the official BlockBeats community:

Telegram Subscription Group: https://t.me/theblockbeats

Telegram Discussion Group: https://t.me/BlockBeats_App

Official Twitter Account: https://twitter.com/BlockBeatsAsia

举报 Correction/Report
Choose Library
Add Library
Cancel
Finish
Add Library
Visible to myself only
Public
Save
Correction/Report
Submit