0

I get these version import errors when I tried to execute "brownie run scripts/deploy_lottery.py" I'm learning blockchain with the help of freecodecamp.org's youtube video.

it's working fine with the older version.

pragma solidity ^0.4.11;
import "@chainlink/contracts/src/v0.4/ERC677Token.sol";
import {StandardToken as linkStandardToken} from 
"@chainlink/contracts/src/v0.4/vendor/StandardToken.sol";

but I'm using this new version,

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;

import "@chainlink/contracts/src/v0.8/ERC677Token.sol";
import {StandardToken as linkStandardToken} from 
"@chainlink/contracts/src/v0.8/vendor/StandardToken.sol";

contract LinkToken is linkStandardToken, ERC677Token {
    uint256 public constant totalSupply = 10**27;
    string public constant name = "ChainLink Token";
    uint8 public constant decimals = 18;
    string public constant symbol = "LINK";

    function LinkToken() public {
        balances[msg.sender] = totalSupply;
    }........
  # REST OF THE CODE...

This is the error I'm getting on my terminal....--> brownie run scripts/deploy_lottery.py Brownie v1.16.4 - Python development framework for Ethereum

New compatible solc version available: 0.8.11
Compiling contracts...
  Solc version: 0.8.11
  Optimizer: Enabled  Runs: 200
  EVM Version: Istanbul
CompilerError: solc returned the following errors:

ParserError: Source"/Users/mohameduzair/.brownie/packages/smartcontractkit/chainlink-       [email protected]/contracts/src/v0.8/ERC677Token.sol" not found: File not found.
 --> contracts/test/LinkToken.sol:4:1:
  |
4 | import "@chainlink/contracts/src/v0.8/ERC677Token.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


ParserError: Source"/Users/mohameduzair/.brownie/packages/smartcontractkit/[email protected]/contracts/src/v0.8/vendor/StandardToken.sol" not found: File not found.
 --> contracts/test/LinkToken.sol:5:1:
  |
5 | import {StandardToken as linkStandardToken} from "@chainlink/contracts/src/v0.8/vendor/StandardToken.sol"; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

So, how can I fix this issue, please? these are the images... this is the LinkToken.sol file and errors this is the brownie-config.yaml file

1 Answer 1

0

LinkToken is available for v0.4 only. Change directory address to @chainlink/contracts/src/v0.4/LinkToken

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.