solidity - 无法将 Uniswap V2 Periphery 作为包添加到 Brownie

标签 solidity brownie

我正在按照 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 (截至目前)。

这是我要做的:

  1. fork 存储库
  2. 在您自己的 github 上发布版本
  3. brownie-config.yaml 中指向该存储库,类似于我们在上面引用中显示的内容。

关于solidity - 无法将 Uniswap V2 Periphery 作为包添加到 Brownie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70070876/

相关文章:

ethereum - 获取错误 "creation of HelloWorld errored: TypeError: Cannot convert undefined or null to object"

javascript - 如何使用自定义提示解锁以太坊帐户?

python - M1 Mac : Running Brownie Python

python - 尝试从 chainlink 导入时 brownie-config 重新映射错误

chainlink - v0.8 AggregatorV3Interface.sol ,它在@chainlink/contracts 中可用吗?

python - 使用 pipx 在 Windows10 上安装 eth-brownie 时如何解决此 UnicodeEncodeError?

import - 如何导入 AggregatorV3Interface

javascript - 当 JS 将数值作为参数传递给 Solidity 函数时,为什么最好将它们用引号引起来?

blockchain - 如何在solidity中将uint转换为字符串?

python - 无法在 Ubuntu 上安装 eth-brownie