-
Notifications
You must be signed in to change notification settings - Fork 2.9k
##lesson5: doesnt display the account created in code #197
-
(venv) PS D:\Solidity\brownie_simple_storage> brownie run scripts/deploy.py
INFO: Could not find files for the given pattern(s).
Brownie v1.16.4 - Python development framework for Ethereum
BrownieSimpleStorageProject is the active project.
Attached to local RPC client listening at '127.0.0.1:8545'...
Running 'scripts\deploy.py::main'...
Hello!
deploy.py
from brownie import accounts def deploy_simple_storage(): account = accounts.load("freecodecamp-account") print("account") def main(): print("Hello!")
it just prints hello and exits.
Beta Was this translation helpful? Give feedback.
All reactions
Brownie starts with your main
function, and your main
function currently only does print("Hello!")
!
To fix this, you'd have to move your other function into the main function, and change your "account"
string to "account" the variable:
from brownie import accounts def deploy_simple_storage(): account = accounts.load("freecodecamp-account") print(account) def main(): print("Hello!") deploy_simple_storage()
Replies: 2 comments 2 replies
-
Did you set up the account in brownie?
brownie accounts new account-name
make sure to provide a secret key and a password.
Additionally don't forget to import accounts
from brownie import accounts
Beta Was this translation helpful? Give feedback.
All reactions
-
Yeppers, i did as per the tutorial, something very strange not sure why it skips.
Beta Was this translation helpful? Give feedback.
All reactions
-
Brownie starts with your main
function, and your main
function currently only does print("Hello!")
!
To fix this, you'd have to move your other function into the main function, and change your "account"
string to "account" the variable:
from brownie import accounts def deploy_simple_storage(): account = accounts.load("freecodecamp-account") print(account) def main(): print("Hello!") deploy_simple_storage()
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
thanks, i figured it soon as i posted here. exactly as you mentioned i missed calling the function after the main. thanks patrick. great video.
Beta Was this translation helpful? Give feedback.