Skip to content

Lesson 4: Cannot create a Contract Call in Ganache #1823

Answered by cromewar
Pasonnn asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @Pasonnn
First of all please do not share your private keys here, I edited the post and remove it. Remember is a security risk.

Now, based on the error message it seems you are not getting correctly that private key from your env, so please be sure you are using load_dotenv and actually loading the .env key before using on this line:

signed_txn = w3.eth.account.sign_transaction(transaction, private_key=private_key)

My guess is that you should have a wrong name on the env file.. like not setting up a dot .env or creating it no the incorrect folder.
Please let us know if this make sense for you.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cromewar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants