Skip to content

Having trouble installing the package in HardHat #208

Closed Answered by PaulRBerg
kkoshiya asked this question in Q&A
Discussion options

You must be logged in to vote

The instructions in the README pertain to a Foundry environment in which the PRBMath submodules are remapped to remove the src. But in Hardhat and Node.js, that is not possible, so you have to import the contracts using the full paths.

As you can see in the node modules installed in CauchyAMM, the @prb/math path contains a src directory:

https://github.com/kkoshiya/CauchyAMM/tree/main/node_modules/%40prb/math

So the solution is to change this line:

import { SD59x18 } from "@prb/math/SD59x18.sol";

To this:

import { SD59x18 } from "@prb/math/src/SD59x18.sol";

Side note: I will update the imports in the README to use src because now I recommend this approach even for Foundry projects.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@kkoshiya
Comment options

@PaulRBerg
Comment options

Comment options

You must be logged in to vote
2 replies
@kkoshiya
Comment options

@PaulRBerg
Comment options

Answer selected by kkoshiya
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants