Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

version issue in LinkToken.sol file #64

Open
N-NeelPatel opened this issue Apr 26, 2022 · 7 comments
Open

version issue in LinkToken.sol file #64

N-NeelPatel opened this issue Apr 26, 2022 · 7 comments

Comments

@N-NeelPatel
Copy link

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.

contracts/test/LinkToken.sol:3:1: ParserError: Source file requires different compiler version (current compiler is 0.6.12+commit.27d51765.Windows.msvc) - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.4.11;
^----------------------^

Can someone please help me with this?
thanks

@N-NeelPatel
Copy link
Author

Also can someone please tell me the usecase of using mocks

@PatrickAlphaC
Copy link
Owner

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.

@N-NeelPatel
Copy link
Author

I am compiling the Mocks files.

@teddy931130
Copy link

teddy931130 commented Aug 29, 2022

@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...

@teddy931130
Copy link

teddy931130 commented Aug 29, 2022

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)
.
¯\_(ツ)_/¯

@LWN-10
Copy link

LWN-10 commented Feb 26, 2023

I am having the same issue with the LinkToken.sol when running - I have tried updating compiler version in the yaml file but this is incompatible with the 0.4.11 version of the LinkToken.sol. Attempting to downgrade the compiler version leads to an 'immutable' error where immutable keyword was added in Solidity 0.6.5

srithon added a commit to srithon/solidity-lottery-system that referenced this issue May 16, 2023
It doesn't actually compile since some dependencies require v4 of the
compiler, while others depend on v8. [This issue](PatrickAlphaC/smartcontract-lottery#64),
which turned out to be for the same idea that I'm implementing, is about
the same issue, and is still unresolved.
@niy42
Copy link

niy42 commented Nov 30, 2023

I am currently experiencing the same "LinkToken version not compactible with brownie" problem. Was anyone able to find a solution in the end?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants