LOGBOOK

HELP

Quiz Entry - updated: 2026.07.30

What does the import keyword do in Solidity?

It pulls another Solidity file's contents into the current one — equivalent to copy-pasting that file at the import line, but with a single canonical source to maintain.

import "./SimpleStorage.sol";                       // local file
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; // package

Rather than duplicating a contract's code into every file that needs it, import references it by path — a local path (./SimpleStorage.sol), or a package/GitHub path that Remix resolves from npm (e.g. @chainlink/contracts). The effect is identical to pasting the imported contract at the top of your file, but changes live in one place. Importing a contract or interface also gives you its ABI once compiled, which is what lets you interact with it.

Go deeper:

From Quiz: IOTHACK / Smart Contracts & the Remix IDE | Updated: Jul 30, 2026