Brownie 项目,无法编译 Solidity 代码:字典更新序列元素 #0 的长度为 1; 2 是必需的

Brownie project, failed to compile Solidity code: dictionary update sequence element #0 has length 1; 2 is required

我有一个带有 deploy.py 和 solidity 文件的简单布朗尼项目。两个项目都很好。我得到了同样的错误,即使我删除了两个文件中的内容。

dictionary update sequence element #0 has length 1; 2 is required

这是我的 Solidity 文件:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";

contract Test {
    AggregatorV3Interface internal priceFeed;

    constructor() public {
    priceFeed = AggregatorV3Interface(
            0x9326BFA02ADD2366b30bacB125260Af641031331
        );

    function getCurrentPrice() public view returns (int256) {
        (, int256 price, , , ) = priceFeed.latestRoundData();
        return price;
    }
}

我明白了。我的 brownie-config.yaml 文件中存在拼写错误。 而不是 / 我需要一个 =.

我有:

dependencies:
  - smartcontractkit/chainlink@1.0.1
compiler:
  solc:
    remappings: 
      - "@chainlink/smartcontractkit/chainlink@1.0.1"

应该是:

dependencies:
  - smartcontractkit/chainlink@1.0.1
compiler:
  solc:
    remappings:
      - "@chainlink=smartcontractkit/chainlink@1.0.1"