Open N-NeelPatel opened 2 years ago
Also can someone please tell me the usecase of using mocks
What are you running to compile?
Mocks are so that you can "mock" being a chainlink node or external actor. Chainlink nodes don't run on our local chains so we pretend to be one.
I am compiling the Mocks files.
@PatrickAlphaC any help would be appreciated. I am facing a similar issue. Following exactly like you show it in your tutorial (link to exact timestamp), I have the following error when I run brownie run scripts/deploy_lottery.py
:
ImportError: cannot import name 'LinkToken' from 'brownie' (/opt/homebrew/lib/python3.9/site-packages/brownie/__init__.py)
.
I see that after running a brownie compile
the LinkToken
does not get compiled and its JSON object is not present under build/contracts/test/
(that's why it can't be imported I suppose).
.
Should we play around with the version of Solidity or the version of the chainlink import in the LinkToken.sol
?
.
Thanks for your help in advance!
.
P.S: I tried switching between compiler versions (latest
/0.8.0
/0.6.6
), but same effect unfortunately...
UPDATE: @PatrickAlphaC Sorry about that, while copy-pasting, I had accidentally put some gibberish after the code for LinkToken.sol
. When I fixed that, I am now getting the same error as @N-NeelPatel is.
.
It appears that the compiler version constraint in LinkToken.sol
(^0.4.11) is the same as in both of its imports (@chainlink/contracts/src/v0.4/ERC677Token.sol
+ @chainlink/contracts/src/v0.4/vendor/StandardToken.sol
)
.
Any ideas how to work around this?
.
If we search for a LinkToken mock in @chainlink/contracts/src/v0.6
it's missing.
.
What if we try to import the LinkToken.sol
from here (in @chainlink/contracts/src/v0.4/LinkToken.sol
)? Although we will still run into the compiler version issue... (if you try to compile with 0.4.11
brownie complains with IncompatibleSolcVersion: Brownie only supports Solidity versions >=0.4.22
)
.
¯\_(ツ)_/¯
I am having the same issue with the LinkToken.sol when running
I am currently experiencing the same "LinkToken version not compactible with brownie" problem. Was anyone able to find a solution in the end?
I am using solidity version 0.8.0 while creating the Lottery.sol file. But For LinkToken.sol file there is not corresponding version 0.8 or 0.6. There is only one version 0.4.11 and it gives me this issue while compile.
Can someone please help me with this? thanks