ethereum-optimism / ethereum-optimism/optimism

Use file-relative paths instead of project-relative

Open
#10,202 8 comments 0 reactions 0 assignees View on GitHub
C-customer-issue
Dominant language
Go
Stars
6.5k
Forks
4k
Avg merge
2d 15h
Merged PRs (30d)
145

Description

**Is your feature request related to a problem? Please describe.**

These project relative paths:

https://github.com/ethereum-optimism/optimism/blob/a4c47fe1cdb8b83bfc27482e0e9fc84d3b62b65c/packages/contracts-bedrock/src/libraries/Encoding.sol#L4

**Describe the solution you'd like**

Should be changed to file relative paths:

```solc
import { Types } from "./Types.sol";
```

**Additional context**

For example, these files cannot be used in Remix as the npm imports cannot disambiguate "src/"

This also causes issues with Foundry, where the same file is imported twice causing `T != T` errors.

Contributor guide

Open the contributing guide

Research direction

Start with the import in packages/contracts-bedrock/src/libraries/Encoding.sol and inspect the referenced Types.sol path. Find the other project-relative Solidity imports in the contracts package, convert them to file-relative paths, and verify that the affected files can be resolved by Remix and Foundry without duplicate-type errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
blockchain
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.