error- after running make
Error: Compiler run failed: Error (2333): Identifier already declared. --> script/APIConsumer.s.sol:7:1: | 7 | import "../src/test/mocks/MockOracle.sol"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Note: The previous declaration is here: --> lib/chainlink-brownie-contracts/contracts/src/v0.8/shared/interfaces/LinkTokenInterface.sol:4:1: | 4 | interface LinkTokenInterface { | ^ (Relevant source part starts here and spans across multiple lines).
@anindyasroy It seems like the issue you're encountering was raised earlier in issue #15 ("Unable to find current origin/master revision in submodule path 'lib/chainlink-brownie-contracts'"). @0xAplki found a solution, and here's what you can do to resolve the current problem:
-
The simplest solution is to clone the repository again and bypass running make. Instead, directly execute
make tests. This should automatically install any missing dependencies, as the necessary lib files are likely already present in the repository upon cloning. -
Alternatively, you can install a functional version by executing
forge install smartcontractkit/[email protected]. If you encounter a git error, consider adding a--no-commit flagto the command.
@anindyasroy the chainlink-brownie repo is a "slim" version of the full chainlink repo ...because foundry uses git submodules, it installes the entire repo even when you only need just the folder with the contracts and ABIs.
So the chainlink-brownie repo is a slim "mirror" of just the contracts that foundry can install. Its much faster and lighter.
However the chainlink-brownie repo was out of sync and broken and the main chainlink contracts repo had some changes to file structure -- which likely explains the issue.
This should be resolved now.
@juanc004 thank you for your contributions!
Please reopen if this is not the case and tag me. Thank you!