Search code examples
soliditybrownie

Can't add Uniswap V2 Periphery as a package to Brownie


I am following Brownie's documentation to add packages to my Solidity project. I have to add Uniswap/v2-core and Uniswap/v2-periphery. In order to do this I called the following lines in the terminal:

This one is working correctly, it installed the package

brownie pm install Uniswap/[email protected]

However when I call the below line I am getting the error ValueError: Invalid version for this package. Available versions are: 1.0.0-beta.0 what is weird because on Github there is the @1.1.0-beta.0 version instead of 1.0.0-beta.0

brownie pm install Uniswap/[email protected]

The question is can I somehow force Brownie to recognize the valid version or is there any other way to fix this?


Solution

  • A version of this was also asked on Stack Exchange ETH

    You do exactly as you have here, you add the whole release string.

    For example:

    dependencies:
       - OpenZeppelin/[email protected]
    compiler:
        solc:
            remappings:
                - "@openzeppelin=OpenZeppelin/[email protected]> solc-0.7"
    

    The reason that yours isn't working right now is that https://github.com/Uniswap/v2-periphery doesn't have any releases, it only has tags.

    What you could do then, is fork the repo, make a release yourself and point to your own release until they actually release something.

    The reason this is failing is that there are no releases of that package on Github (as of right now).

    Here is what I'd do:

    1. Fork the repo
    2. Cut a release on your own github
    3. Point to that repo in your brownie-config.yaml similar to what we show in the quote above.