v0.8 AggregatorV3Interface.sol , its available in @chainlink/contracts?
Asked Answered
L

6

7

I get a error when i change the version to 0.8 , but works fine with 0.6, how i see the most recent version? , i tried downloaded from npm install @chainlink/contracts --save, but only works with mock mode.

This is my repo: https://github.com/irwingtello/lottery

Compiling contracts... Solc version: 0.8.9 Optimizer: Enabled Runs: 200 EVM Version: Istanbul CompilerError: solc returned the following errors:

ParserError: Source "C:/Users/irwin/.brownie/packages/smartcontractkit/[email protected]/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol" not found: File not found. --> contracts/Lottery.sol:4:1: | 4 | import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

ERROR: Unable to load project

Letrice answered 3/11, 2021 at 4:37 Comment(2)
Im getting the same with Brownie compile - doesn't like the reference to 0.8 but switching back to 0.6 is fine....Arboreal
Hey @LDJ, check this discussion on github: github.com/smartcontractkit/full-blockchain-solidity-course-py/… Its relationed about this repo from NPM packages: github.com/smartcontractkit/chainlink-brownie-contracts "As of 1.2.0 and onward all the releases of this package are going to match the @chainlink/contracts NPM tags So it will look "backwards", but we are starting with 0.2.1"Letrice
L
6

"As of 1.2.0 and onward all the releases of this package are going to match the @chainlink/contracts NPM tags So it will look backwards, but we are starting with 0.2.1"

Change: @chainlink=smartcontractkit/[email protected] To: @chainlink=smartcontractkit/[email protected]

https://github.com/smartcontractkit/chainlink-brownie-contracts/tree/v0.2.1

Letrice answered 3/11, 2021 at 19:19 Comment(0)
T
4

change your import to

import "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol";
Tepper answered 8/4 at 11:28 Comment(0)
C
1

Try this

import '../node_modules/@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol';
Curfew answered 3/6 at 18:2 Comment(0)
P
0

STEP 1: change the @chainlink/contacts version from @chainlink=smartcontractkit/[email protected] to @chainlink=smartcontractkit/[email protected] in the config file of your project

STEP 2: compile your project using brownie compile

STEP 3: go to https://github.com/StarBlockDAO/SBox-VRF-Random/commit/dbbe6a7933cef13dc905965ceb6d1cfe57818fc2 and get the VRFCoordinatorV2Interface.sol and save it to your v.08/interfaces directory

STEP 4: compile your project using brownie compile

Premonish answered 1/5, 2022 at 12:39 Comment(0)
D
0

More elegant solution.

1.yarn add @chainlink/contracts
yarn add @openzeppelin/contracts #I use it for the SafeMath

  1. import"node_modules/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; import"node_modules/@openzeppelin/contracts/utils/math/SafeMath.sol";
Dubiety answered 5/3, 2023 at 22:55 Comment(0)
S
0

The import can beimport "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol";

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

Staccato answered 12/7 at 18:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.