Q Remix Documentation
  • INTRODUCTION
    • Welcome to Q-Remix IDE's documentation
    • Navigating Q-Remix
    • Using Q-Remix Safely
    • Q-Remix Links
    • FAQ
  • CORE MODULES
    • File Explorer
    • Search in Files
    • Settings
    • Editor
    • Autocompletion & Suggestions in Editor
    • Contract Creation & Compiling
    • Deploy & Run
    • Accessing and Interacting with the Deployed Contracts
    • Terminal
  • Solidity modules
    • Solidity Compiler
    • AI Assistant
    • Q-Remix Chatbot
    • AI Code Generation
    • Multi AI Models switch
    • AI Project Generation
    • Debugger
  • Guide
    • Creating and Deploying a Contract
    • Importing and Loading Source Files in Solidity
  • Unit Testing
    • Testing by Example
  • MISCELLANEOUS
    • Q-Remix as Code Viewer
    • Code Contribution Guide
Powered by GitBook
On this page
  1. Guide

Importing and Loading Source Files in Solidity

PreviousCreating and Deploying a ContractNextTesting by Example

Last updated 12 days ago

  • Importing Folders:

    • Using the same "Import" option, select "Upload Folder."

    • Choose a folder containing Solidity files (e.g., OpenZeppelin contracts).

    • The folder will be added as a collapsible directory in the file explorer, with all its files accessible.

this feature helps to import github repos:

QRemix introduces a flexible Code Viewer feature that enhances developer productivity by allowing seamless integration with external smart contract repositories — particularly from GitHub.

This feature is especially useful for developers looking to reference, learn from, or extend widely used contract libraries. Whether you're experimenting with OpenZeppelin standards or diving into the Uniswap v4 ecosystem, QRemix allows easy access through a structured import system.

How to Import a GitHub Repository

To import a repository:

  1. Click the Import GitHub Repository option (available in the sidebar).

  2. Choose one of the following:

    • Preset Libraries:

      • OpenZeppelin

      • Uniswap v4

    • Custom URL:

      • Provide the public GitHub URL of the smart contract repository.

      • Private repositories are currently not supported.

Once imported:

  • A folder named library/ will be created in your workspace.

  • Inside it, a subfolder matching the name of the imported library will appear (e.g., uniswapv4/).

What Gets Imported?

  • All .sol (Solidity) files and related resources are fetched.

  • The folder structure of the original GitHub repository is preserved.

  • You can browse, view, and reference the imported contracts directly within the Code Viewer.

Notes & Limitations

  • Duplicate imports are restricted. You must delete an existing library folder before re-importing the same repository.

  • Repositories must be public; importing from private repositories will fail.

  • Multiple repositories can be imported, as long as they are unique.

Example

After importing Uniswap v4, your workspace will look like this:

markdownCopyEditlibrary/
└── uniswapv4/
    ├── core/
    ├── periphery/
    └── contracts/

All Solidity contracts within the uniswapv4 repo become instantly viewable and accessible through the Code Viewer panel.

This is a new feature mainly for the smart contract developers to use. it comes with two different approaches. On clicking the link option (number 6 in the above picture), the following screen pops up

The first option is select a library which allows the user to select between two predetermined libraries mostly used for creating smart contracts, these libraries are openzepellin and uniswapv4.

The GitHub Import feature is tailored for smart contract developers, especially those who work with popular libraries like OpenZeppelin or Uniswap.

Steps:

  1. Click the Import GitHub Repository option

  2. Choose one of the following:

    • Preset Libraries: Choose between:

      • OpenZeppelin

      • Uniswap v4

    • Custom URL: Enter the public URL of a GitHub repo

      • Private repos are not supported

  3. Once imported:

    • A new folder named library/ will be created

    • Inside it, the selected repo will be added as a subfolder (e.g., uniswapv4/)

Notes:

  • The import process supports .sol and other relevant files

  • Duplicate imports are not allowed

    • You must delete a previously imported repo before re-importing it

If another project needs to be called, the user can select Custom url option. On selecting custom URL the user would be asked to give the link to that repository. The repository must be public in nature otherwise the import would fail.

After giving the URL or selecting any option between openzepellin contracts and uniswapv4, a new folder would be created called library having a folder with the same name as the one getting imported

In this example I imported uniswapv4 using the above option. This is the result

As you can see all the folders and files which contain smart contracts or any file with .sol extension gets imported. This process can be repeated as many times needed but same repo cant be imported twice until and unless the previous one is deleted.

Import Github Repository
Import Repo result