Having opened a project in Superblocks lab, you will have access to the files of the project on the left. Right clicking on the root (Files) or any of the folders apart from 'app' will reveal the context menu.
Clicking on 'Import File' in the context menu opens a modal, where you can import smart-contracts from different libraries. The imported files are either placed in the folder that you have right-clicked on, or in the 'contracts' folder, if the root 'Files' folder has been clicked.
The modal is divided into three resizable columns:
- In the first column, users can select the library of their choice.
- The middle column is used for selecting any particular smart contract (e.g.: ERC20, SafeMath, etc.), organized in folders.
- The last column is used for displaying information about the particular selected library or, in case a smart-contract has been selected, showing the name of the chosen smart contract and its source code.
As of Lab version 1.6, the only supported library is the OpenZeppelin, which provides secure implementations of different Solidity components to be used in your own project.
If a smart-contract has been selected, the 'Import' button can be clicked. This imports the selected smart contract and its dependencies to the project.
In this example, the 'Crowdsale.sol' smart contract from the 'crowdsale' directory has been imported to the project. As you can see not only the selected smart contract itself, but its dependencies has also been imported.
Now you know how to use this feature to import files into your own projects effortlessly and avoiding unnecessary copy-pasting :)