From 805c11893033e23fcdd07bdbb6342783c641f9d5 Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Sat, 22 Aug 2026 14:02:35 -0700 Subject: [PATCH] fix: order openzeppelin remappings so both import styles resolve shipyard-core imports OpenZeppelin two ways, "openzeppelin-contracts/token/..." and "openzeppelin-contracts/contracts/token/...", so foundry.toml maps both prefixes to the same target. Forge's import resolver takes the first remapping that matches rather than the longest, so with the bare prefix listed first every "openzeppelin-contracts/contracts/..." import resolved to a doubled lib/openzeppelin-contracts/contracts/contracts/... path and the build failed on EnumerableSet.sol in DynamicTraits.sol and OnchainTraits.sol. Putting the longer prefix first fixes resolution. Paths for the bare style are unchanged, so no compiled output moves. Co-Authored-By: Claude Opus 5 --- foundry.toml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/foundry.toml b/foundry.toml index 775aa7a..91eb7f8 100644 --- a/foundry.toml +++ b/foundry.toml @@ -8,8 +8,14 @@ remappings = [ 'forge-std/=lib/forge-std/src', 'solady/=lib/solady/src/', 'solady-test/=lib/solady/test/', - 'openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/', + # shipyard-core imports OpenZeppelin both as "openzeppelin-contracts/token/..." + # and as "openzeppelin-contracts/contracts/token/...", so both prefixes are + # mapped. Forge's import resolver takes the first remapping that matches, so + # the longer prefix has to come first; reversing these two lines makes + # "openzeppelin-contracts/contracts/..." resolve to a doubled + # lib/openzeppelin-contracts/contracts/contracts/... path and the build fails. 'openzeppelin-contracts/contracts/=lib/openzeppelin-contracts/contracts/', + 'openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/', 'shipyard-core/=lib/shipyard-core/src/', 'seaport-types/=lib/seaport-types/src/' ]