我正在按照 Brownie 的文档将包添加到我的 Solidity 项目中。我必须添加 Uniswap/v2-core 和 Uniswap/v2-periphery。为了做到这一点,我在终端中调用了以下几行:
这个工作正常,它安装了软件包
brownie pm install Uniswap/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ee98dcc38d819c8baedfc0dec0df" rel="noreferrer noopener nofollow">[email protected]</a>
但是,当我调用以下行时,我收到错误 ValueError: Invalid version for this package。可用版本是:1.0.0-beta.0
这很奇怪,因为 on Github有 @1.1.0-beta.0
版本而不是 1.0.0-beta.0
brownie pm install Uniswap/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bacc8897cadfc8d3cad2dfc8c3fa8b948b948a97d8dfcedb948a" rel="noreferrer noopener nofollow">[email protected]</a>
问题是我可以以某种方式强制布朗尼识别有效版本还是有其他方法可以解决这个问题?
最佳答案
在Stack Exchange ETH上也询问了这个版本
You do exactly as you have here, you add the whole release string.
For example:
dependencies: - OpenZeppelin/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d6b9a6b3b8acb3a6a6b3babfb8fbb5b9b8a2a4b7b5a2a596e5f8e4f8e7fba5b9bab5fbe6f8e1" rel="noreferrer noopener nofollow">[email protected]</a> compiler: solc: remappings: - "@openzeppelin=OpenZeppelin/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b3dcc3d6ddc9d6c3c3d6dfdadd9ed0dcddc7c1d2d0c7c0f3809d819d829e" rel="noreferrer noopener nofollow">[email protected]</a>> 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.
失败的原因是 there are no releases of that package on Github (截至目前)。
这是我要做的:
- fork 存储库
- 在您自己的 github 上发布版本
- 在
brownie-config.yaml
中指向该存储库,类似于我们在上面引用中显示的内容。
关于solidity - 无法将 Uniswap V2 Periphery 作为包添加到 Brownie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70070876/