smartcontractkit / full-blockchain-solidity-course-py

Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition
MIT License
10.8k stars 2.9k forks source link

Deploying Deploy.py #689

Open Ya-Sin150 opened 2 years ago

Ya-Sin150 commented 2 years ago

I am trying to deploy my script on the rinkeby network but it seems like there is a bug somewhere and i would like to find out what it is.

After typing in 'brownie run scripts/deploy.py --network rinkeby' in my terminal, I am getting the error below:

Running '\Users\sahar\OneDrive\Documents\Python\Blockchain\brownie_simple_storage\scripts\deploy.py::main'... File "C:\Users\sahar\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\_cli\run.py", line 50, in main return_value, frame = run( File "C:\Users\sahar.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\project\scripts.py", line 103, in run return_value = f_locals[method_name](*args, **kwargs) File "\Users\sahar\OneDrive\Documents\Python\Blockchain\brownie_simple_storage\scripts\deploy.py", line 23, in main deploy_simple_storage() File "\Users\sahar\OneDrive\Documents\Python\Blockchain\brownie_simple_storage\scripts\deploy.py", line 6, in deploy_simple_storage simple_storage = SimpleStorage.deploy({"from": accounts}) File "C:\Users\sahar.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\contract.py", line 524, in call return tx["from"].deploy(`

AttributeError: 'Accounts' object has no attribute 'deploy'

How will I be able to fix this?

cromewar commented 2 years ago

Hello @Ya-Sin150 you are using: simple_storage = SimpleStorage.deploy({"from": accounts}) you should use a variable in singular called account, if you use accounts brownie will try to use the accounts object.