Open ellyblueeyes opened 2 years ago
You didn't upload the codes for your helpful-scripts. The get_account() function might be missing
The code for helpful_scripts.py
from brownie import network, config, accounts from scripts.helpful_scripts import get_account
def get_account(): if network.show_active()=="development": return accounts[0] else: return accounts.add(config["wallets"]["from_key"])
In your scripts.helpful_scripts. You cannot add this line in your input parameters
from scripts.helpful_scripts import get_account
Remove it and let's see if your code works this time.
I remove the line and I got the following error: constructor Sequence has incorrect length, expected 1 but got 0
I would prefer a screenshot of the error codes
After following step by step the lesson I find an error that I cannot solve. I am putting here the entire code.
1.FUND ME // SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol"; import "@chainlink/contracts/src/v0.6/vendor/SafeMathChainlink.sol";
contract FundMe { using SafeMathChainlink for uint256;
} 2.BROWNIE-CONFIG.YAML dependencies:
def deploy_fund_me(): account=get_account() fund_me=FundMe.deploy({"from": account}, publish_source=True) print(f"Contract deployed to {fund_me.address}")
def main(): deploy_fund_me()
When I try to run it in terminal I get this error: Brownie v1.19.0 - Python development framework for Ethereum
BrownieFundMeProject is the active project. File "brownie/_cli/run.py", line 55, in main _include_frame=True, File "brownie/project/scripts.py", line 60, in run module = _import_from_path(script) File "brownie/project/scripts.py", line 156, in _import_from_path _import_cache[import_str] = importlib.import_module(import_str) File "/home/elly/anaconda3/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen, line line, in in File "<frozen, line line, in in File "<frozen, line line, in in File "<frozen, line line, in in File "<frozen, line line, in in File "<frozen, line line, in in File "./scripts/deploy.py", line 2, in
from scripts.helpful_scripts import get_account
File "./scripts/helpful_scripts.py", line 2, in
from scripts.helpful_scripts import get_account
ImportError: cannot import name 'get_account' from 'scripts.helpful_scripts' (/home/elly/demos/web3_py_simple_storage/brownie_fund_me/scripts/helpful_scripts.py)