Lesson 4: can't find AggregatorV3Interface.sol #6444
Replies: 13 comments 7 replies
|
i find it in v0.7 and change my solidity version, then i successfully run the contract, but i still want to find AggregatorV3Interface.sol |
|
try import with this @chainlink/blob/develop/contracts/src/v0.7/interfaces/AggregatorV3Interface.sol the contract is here. Hope this helps. |
|
I followed Patrick's example in here: https://github.com/PatrickAlphaC/fund-me-fcc/blob/main/PriceConverter.sol If you want to check the inner code in AggregatorV3Interface.sol, you can go directly to the Chainlink repo: Hope this helps! 🦾 |
|
Hey guys the updated link now is the following:
as mentioned by @jujuvideogirlai This works with solidity version Link to the contract: https://github.com/smartcontractkit/chainlink/tree/develop/contracts/src/v0.8/shared/interfaces |
|
The whole problem is with your chainlink package version, just use same as it is in course repo (check |
|
I run "yarn add @chainlink/contracts@v0.8" and AggregatorV3Interface.sol came up. |
|
@Bellatlich Its here |
|
The correct import path for AggregatorV3Interface.sol in Chainlink v0.8+ is: import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";If you can't find it in GitHub, ensure you have installed the correct Chainlink dependency: npm install @chainlink/contractsYou can also check older versions on GitHub: https://github.com/smartcontractkit/chainlink. |
|
If you're facing same issue right now, it's probably because foundry cannot locate the chainlink contract interface (AggregatorV3Interface.sol) at the path specified in your solidity import statement and foundry.toml remappings. The easy solution is: go to your Ensure your Solidity contract files (FundMe.sol, PriceConverter.sol, etc.) use the standard import path for Chainlink contracts: import {AggregatorV3Interface} from "@chainlink-brownie-contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol";Open your terminal, run |
|
I had the same error where the AggregatorV3Interface.sol file was not being recognized. What I did was the following: First, I ran this command to install the Chainlink contracts repository: This installed the contracts inside the After that, I created a file called This tells Foundry how to find the Chainlink contract files when I use imports in my code. Finally, in my Solidity contract, I imported the interface using: import "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol"; |
|
Try to import this. |
paste this line in your code. it's also given in chainlink documentation. at the time i'm writing this, this works perfectly fine. import {AggregatorV3Interface} from "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol"; if this doesn't work for you, please refer to the documentation for any new update in the url: |
|
The confusion is because Chainlink moved the file from If you're using Foundry: forge install smartcontractkit/chainlink-brownie-contracts --no-commitAdd to your remappings = [
"@chainlink-brownie-contracts/=lib/chainlink-brownie-contracts/contracts/",
"forge-std/=lib/forge-std/src/",
]Then import: import {AggregatorV3Interface} from "@chainlink-brownie-contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol";If you're using Hardhat/npm: npm install @chainlink/contractsThen import: import {AggregatorV3Interface} from "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol";The old path |
Uh oh!
There was an error while loading. Please reload this page.
In docs.chain.link i find the example data feed contract, but in chainlink github i can't find the ABI contract. i find its path written in contract didnt change but in that path i cant find it(@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol)
so what can i import?
All reactions