Skip to content

Conversation

@nisedo
Copy link
Contributor

@nisedo nisedo commented Nov 27, 2025

Summary

This PR fixes build configuration issues for both Foundry and Hardhat environments, ensuring the repository works out-of-the-box for new users without manual setup steps.

Key Changes

  • Foundry: Added a root remappings.txt and updated tests/ERC4626/foundry/remappings.txt to correctly resolve dependencies (OpenZeppelin, Solmate) from the root directory.
  • Hardhat: Updated the project to support Hardhat v3, which defaults to ESM.
    • Added "type": "module" to package.json.
    • Converted hardhat.config.js to ESM syntax (export default).
    • Fixed the edr-simulated network configuration error.
  • Submodules: Added a postinstall script to automatically initialize the ABDKMath64x64 submodule upon npm install.
  • Documentation: Updated CLAUDE.md with accurate, root-relative commands for running Echidna and Medusa tests.

Verification

  • forge build passes successfully.
  • npm run compile passes successfully.
  • ✅ Echidna tests pass for ERC20 (CryticERC20InternalHarness).
  • ✅ Echidna tests pass for ERC721 (CryticERC721InternalHarness).
  • ✅ Echidna tests pass for ERC4626 (CryticERC4626InternalHarness).

Updates the project to support Hardhat v3 which defaults to ESM.
- Sets "type": "module" in package.json.
- Updates hardhat.config.js to use ESM export syntax.
- Sets the correct network type for the hardhat network in config.

This resolves Error HHE15 (invalid network config) and ensures 'npm run compile' works correctly alongside the Foundry build.
The previous examples assumed running from inside the test directory. Updated commands to work from the project root, matching the workflow established in this PR.
Add a self-reference in package.json to fix Hardhat compilation:

`"@crytic/properties": "file:.",`

Without this, `npm run compile` fails with: `The package "@crytic/properties" is not installed`"
@nisedo nisedo merged commit c793cd9 into main Nov 28, 2025
9 checks passed
Copy link

@pcaversaccio pcaversaccio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I think this PR introduces a bug:

@openzeppelin/=lib/openzeppelin-contracts/contracts/

and you e.g. have here:

import "@openzeppelin/contracts/utils/Address.sol";

which would resolve to lib/properties/lib/openzeppelin-contracts/contracts/contracts/utils/Address.sol which cannot be found (contracts/contracts).

The full error log from snekmate after testing:

Run forge test
Compiler run failed:
Error (6275): Source "lib/properties/lib/openzeppelin-contracts/contracts/contracts/utils/Address.sol" not found: File not found. Searched the following locations: "/home/runner/work/snekmate/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate/auth", "/home/runner/work/snekmate/snekmate/src/snekmate/extensions", "/home/runner/work/snekmate/snekmate/src/snekmate/governance", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens/interfaces", "/home/runner/work/snekmate/snekmate/src/snekmate/utils".
ParserError: Source "lib/properties/lib/openzeppelin-contracts/contracts/contracts/utils/Address.sol" not found: File not found. Searched the following locations: "/home/runner/work/snekmate/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate/auth", "/home/runner/work/snekmate/snekmate/src/snekmate/extensions", "/home/runner/work/snekmate/snekmate/src/snekmate/governance", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens/interfaces", "/home/runner/work/snekmate/snekmate/src/snekmate/utils".
 --> lib/properties/contracts/ERC721/external/util/ERC721ExternalTestBase.sol:7:1:
  |
7 | import "@openzeppelin/contracts/utils/Address.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "lib/properties/lib/openzeppelin-contracts/contracts/contracts/token/ERC721/utils/ERC721Holder.sol" not found: File not found. Searched the following locations: "/home/runner/work/snekmate/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate/auth", "/home/runner/work/snekmate/snekmate/src/snekmate/extensions", "/home/runner/work/snekmate/snekmate/src/snekmate/governance", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens/interfaces", "/home/runner/work/snekmate/snekmate/src/snekmate/utils".
ParserError: Source "lib/properties/lib/openzeppelin-contracts/contracts/contracts/token/ERC721/utils/ERC721Holder.sol" not found: File not found. Searched the following locations: "/home/runner/work/snekmate/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate/auth", "/home/runner/work/snekmate/snekmate/src/snekmate/extensions", "/home/runner/work/snekmate/snekmate/src/snekmate/governance", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens/interfaces", "/home/runner/work/snekmate/snekmate/src/snekmate/utils".
 --> lib/properties/contracts/ERC721/external/util/MockReceiver.sol:4:1:
  |
4 | import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "lib/properties/lib/openzeppelin-contracts/contracts/contracts/token/ERC721/IERC721.sol" not found: File not found. Searched the following locations: "/home/runner/work/snekmate/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate/auth", "/home/runner/work/snekmate/snekmate/src/snekmate/extensions", "/home/runner/work/snekmate/snekmate/src/snekmate/governance", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens/interfaces", "/home/runner/work/snekmate/snekmate/src/snekmate/utils".
ParserError: Source "lib/properties/lib/openzeppelin-contracts/contracts/contracts/token/ERC721/IERC721.sol" not found: File not found. Searched the following locations: "/home/runner/work/snekmate/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate/auth", "/home/runner/work/snekmate/snekmate/src/snekmate/extensions", "/home/runner/work/snekmate/snekmate/src/snekmate/governance", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens/interfaces", "/home/runner/work/snekmate/snekmate/src/snekmate/utils".
 --> lib/properties/contracts/ERC721/util/IERC721Internal.sol:4:1:
  |
4 | import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "lib/properties/lib/openzeppelin-contracts/contracts/contracts/token/ERC721/extensions/IERC721Enumerable.sol" not found: File not found. Searched the following locations: "/home/runner/work/snekmate/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate/auth", "/home/runner/work/snekmate/snekmate/src/snekmate/extensions", "/home/runner/work/snekmate/snekmate/src/snekmate/governance", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens/interfaces", "/home/runner/work/snekmate/snekmate/src/snekmate/utils".
ParserError: Source "lib/properties/lib/openzeppelin-contracts/contracts/contracts/token/ERC721/extensions/IERC721Enumerable.sol" not found: File not found. Searched the following locations: "/home/runner/work/snekmate/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate", "/home/runner/work/snekmate/snekmate/src/snekmate/auth", "/home/runner/work/snekmate/snekmate/src/snekmate/extensions", "/home/runner/work/snekmate/snekmate/src/snekmate/governance", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens", "/home/runner/work/snekmate/snekmate/src/snekmate/tokens/interfaces", "/home/runner/work/snekmate/snekmate/src/snekmate/utils".
 --> lib/properties/contracts/ERC721/util/IERC721Internal.sol:5:1:
  |
5 | import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants