Error logs:
> @tokamak-network/[email protected] build /home/max/src/tokamak-thanos/packages/tokamak/sdk
> tsc -p tsconfig.json
src/adapters/usdc-bridge.ts(3,34): error TS2307: Cannot find module '@tokamak-network/thanos-contracts/forge-artifacts/L1UsdcBridge.sol/L1UsdcBridge.json' or its corresponding type declarations.
src/utils/contracts.ts(21,26): error TS2307: Cannot find module '@tokamak-network/thanos-contracts/forge-artifacts/L1UsdcBridge.sol/L1UsdcBridge.json' or its corresponding type declarations.
ELIFECYCLE Command failed with exit code 2.
https://cloud.nx.app/runs/bL4Vm4UWAt
Dependency version at runtime
The cause seems to be that it's looking for the file @tokamak-network/thanos-contracts/forge-artifacts/L1UsdcBridge.sol/L1UsdcBridge.json
, but the system thinks it didn't create it because the actual files created by the install are named L1UsdcBridge0.8.15.json
and L1UsdcBridge0.8.25.json
.
The first thing I tried was to rename the L1UsdcBridge0.8.15.json
file in that folder to L1UsdcBridge.json and rebuild it, which completed without issue. I went into the folder where those ‘sol’ are located and typed forge build --force
, but nothing changed, so I dug a little deeper. However, this is a temporary workaround and not the normal workaround.
The fundamental solution to the above problem is to correct the foundry version, and my foundry version at the time was 0.2.0 (ea3ba89)
as shown above. To match the proper foundry version as of September 11, 2024, you can use tokamak-thanos/ops/scripts/install-foundry.sh
and change it to '63fff3510408b552f11efb8196f48cfe6c1da664
'. You should have no problems with subsequent builds.