smartcontractkit / chainlink-brownie-contracts

A repository for automatically using the latest chainlink repo from the core chainlink repo.
303 stars 65 forks source link

Suggested Modification to Remappings in README.md #30

Open jackie-cn opened 3 months ago

jackie-cn commented 3 months ago

I propose a modification to the remappings example provided in the README.md file to enhance compatibility with the official usage examples provided by Chainlink. The current remapping configuration is as follows:

remappings = [
  '@chainlink/contracts/=lib/chainlink-brownie-contracts/contracts/src/',
]

However, based on the example usage documented on Chainlink's official documentation page Using Data Feeds, imports include the src directory within the path, as seen here:

import {AggregatorV3Interface} from "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol";

With the current remapping setup, the path to AggregatorV3Interface.sol incorrectly includes an additional src, resulting in a file-not-found error. To rectify this, I suggest updating the remappings in the README.md to remove the extra src segment:

remappings = [
  '@chainlink/contracts/=lib/chainlink-brownie-contracts/contracts/',
]

This adjustment will align the remappings with the paths used in official examples, ensuring correct file resolution and smoother integration for users following the documentation.